Skip to content

Instantly share code, notes, and snippets.

View berkayoruc's full-sized avatar
🎯
Focusing

Berkay Oruç berkayoruc

🎯
Focusing
View GitHub Profile
dependencies:
flutter_map: 7.0.0
latlong2: 0.9.1
<uses-permission android:name="android.permission.INTERNET"/>
Widget build(BuildContext context) {
return FlutterMap(
options: MapOptions(
initialCenter: LatLng(41, 29),
initialZoom: 8.0,
)
);
}
Widget build(BuildContext context) {
return FlutterMap(
options: MapOptions(
initialCenter: LatLng(41, 29),
initialZoom: 8.0,
),
children: [
TileLayer(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c']
# OSM Katmani
TileLayer(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c']
),
# Google Maps Katmani
TileLayer(
urlTemplate: 'http://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',
subdomains: ['0', '1', '2', '3'],
),
FlutterMap(
options: MapOptions(
initialCenter: LatLng(41, 29),
initialZoom: 8.0,
),
children: [
TileLayer(
urlTemplate:
"https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg",
subdomains: ['a', 'b', 'c']),
flutter create halk_ekmek_app
class Buffet {
int _id;
String _district;
String _neighborhood;
String _name;
String _latitude;
String _longitude;
Buffet(this._id, this._district, this._neighborhood, this._name,
this._latitude, this._longitude);
Future<List<Buffet>> getBuffets() async {
var headers = {'Access-Control-Allow-Origin': '*'};
final response = await http.get(Uri.parse(buffetUrl), headers: headers);
return compute(parseBuffets, [response.body]);
}
List<Buffet> parseBuffets(List<dynamic> arguments) {
final body = arguments.elementAt(0);
final parsed = jsonDecode(body)['result']['records'];
List<Buffet> values = [];
MapOptions(
plugins: [
MarkerClusterPlugin(),
],
center: LatLng(41, 29),
zoom: 10.0,
interactiveFlags: InteractiveFlag.all & ~InteractiveFlag.rotate,
onTap: (_, x) {
if (popupController.selectedMarkers.isNotEmpty) {
popupController.hideAllPopups();