Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahm3tcelik/city_picker_from_map
A flutter package for select a city from svg map.
https://github.com/ahm3tcelik/city_picker_from_map
dart flutter flutter-maps flutter-svg flutter-widget
Last synced: 3 days ago
JSON representation
A flutter package for select a city from svg map.
- Host: GitHub
- URL: https://github.com/ahm3tcelik/city_picker_from_map
- Owner: ahm3tcelik
- License: mit
- Created: 2021-03-21T11:02:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T21:55:24.000Z (over 3 years ago)
- Last Synced: 2023-08-20T21:33:29.509Z (about 1 year ago)
- Topics: dart, flutter, flutter-maps, flutter-svg, flutter-widget
- Language: Dart
- Homepage: https://pub.dev/packages/city_picker_from_map
- Size: 3.78 MB
- Stars: 52
- Watchers: 4
- Forks: 24
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# City Picker From Map
A flutter package for select a city from svg map.
![](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/showcase/selecting_city.gif)
Supported countries (+150) are [here](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/lib/src/maps.dart).
## Screenshots
![](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/showcase/responsive.gif)![](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/showcase/ss3.jpg)
![](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/showcase/ss4.png)## Getting Started
In the `pubspec.yaml` of your **Flutter** project, add the following dependency:
```yaml
dependencies:
...
city_picker_from_map: any
```In your library file add the following import:
```dart
import 'package:city_picker_from_map/city_picker_from_map.dart';
```## Usage
```dart
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
| props | types | description |
| :---------------------- | :-------------: | :---------------------------------------------------------------------------------------------------------------: |
| key | `Key?` | |
| map | `String` | Name of the map you want to show. Use as Maps. All maps are in the [maps.dart](https://github.com/ahm3tcelik/city_picker_from_map/blob/master/lib/src/maps.dart) |
| width | `double?` | Map width. Default value is double.infinity |
| height | `double?` | Map height. Default value is double.infinity |
| dotColor | `Color?` | Color of the dot in the center of the city |
| strokeColor | `Color?` | Color of the city borders |
| selectedColor | `Color?` | Color of the selected city |
| actAsToggle | `boolean?` | City selecting act as like toggle button |
| onChanged | `Function(City? city)` | Returns new city value when it changed |Author
------* [Ahmet ÇELİK](https://github.com/ahm3tcelik/)