This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
flutter_map: 7.0.0 | |
latlong2: 0.9.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.INTERNET"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget build(BuildContext context) { | |
return FlutterMap( | |
options: MapOptions( | |
initialCenter: LatLng(41, 29), | |
initialZoom: 8.0, | |
) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'], | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flutter create halk_ekmek_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MapOptions( | |
plugins: [ | |
MarkerClusterPlugin(), | |
], | |
center: LatLng(41, 29), | |
zoom: 10.0, | |
interactiveFlags: InteractiveFlag.all & ~InteractiveFlag.rotate, | |
onTap: (_, x) { | |
if (popupController.selectedMarkers.isNotEmpty) { | |
popupController.hideAllPopups(); |
OlderNewer