Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

A flutter package for select a city from svg map

City Picker From Map

A flutter package for select a city from svg map.

Supported countries (+150) are here.

Screenshots

Getting Started

In the pubspec.yaml of your Flutter project, add the following dependency:

dependencies:
  ...
  city_picker_from_map: any

In your library file add the following import:

import 'package:city_picker_from_map/city_picker_from_map.dart';

Usage

CityPickerMap(
	width: double.infinity,
	height: double.infinity,
	map: Maps.TURKEY,
	onChanged: (city) {
	  setState(() {
		selectedCity = city;
	  });
	},
	actAsToggle: true,
	dotColor: Colors.white,
	selectedColor: Colors.lightBlueAccent,
	strokeColor: Colors.white24,
)

Props

propstypesdescription
keyKey?
mapStringName of the map you want to show. Use as Maps.<MAP_NAME> All maps are in the maps.dart
widthdouble?Map width. Default value is double.infinity
heightdouble?Map height. Default value is double.infinity
dotColorColor?Color of the dot in the center of the city
strokeColorColor?Color of the city borders
selectedColorColor?Color of the selected city
actAsToggleboolean?City selecting act as like toggle button
onChangedFunction(City? city)Returns new city value when it changed

Download City Picker From Map package source code on GitHub

https://github.com/ahm3tcelik/city_picker_from_map
Exit mobile version