Last updated:
0 purchases
map pin picker
Map Pin Picker #
A Swipe Drawer Library for Easy and Quick Usage.
Checkout the Original Author : ![GitHub followers])
The source code is 100% Dart, and everything resides in the /lib folder.
Show some ❤️ and star the repo to support the project #
GIF #
💻 Installation #
In the dependencies: section of your pubspec.yaml, add the following line:
map_pin_picker: <latest_version>
copied to clipboard
❔ Usage #
Import this class #
import 'package:map_pin_picker/map_pin_picker.dart';
copied to clipboard
Use MapPicker #
import 'package:geocoder/geocoder.dart'; //import geocoder to get address line from coordinates
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:map_pin_picker/map_pin_picker.dart';
@override
Widget build(BuildContext context) {
return new Scaffold(
body: Column(
children: [
Expanded(
child: MapPicker(
// pass icon widget
iconWidget: Icon(Icons.location_pin,
size: 50,
),
//add map picker controller
mapPickerController: mapPickerController,
child: GoogleMap(
zoomControlsEnabled: false,
// hide location button
myLocationButtonEnabled: false,
mapType: MapType.normal,
// camera position
initialCameraPosition: cameraPosition,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
onCameraMoveStarted: () {
// notify map is moving
mapPickerController.mapMoving();
},
onCameraMove: (cameraPosition) {
this.cameraPosition = cameraPosition;
},
onCameraIdle: () async {
// notify map stopped moving
mapPickerController.mapFinishedMoving();
//get address name from camera position
List<Address> addresses = await Geocoder.local
.findAddressesFromCoordinates(Coordinates(
cameraPosition.target.latitude,
cameraPosition.target.longitude));
// update the ui with the address
textController.text='${addresses.first?.addressLine ?? ''}';
},
),
),
),
],
),
);
}
copied to clipboard
🎨 Customization and Attributes #
MapPicker attributes
Attribute Name
Example Value
Description
child
GoogleMap()
Google map widget
iconWidget
Icon(
Icons.location_pin,
size: 50,
)
Pin icon widget
mapPickerController
20.0
body radius value the default value is 0.0
bodyBackgroundPeekSize
MapPickerController()
The controller that control pin animation
showDot
true
show dot under the pin ,the default value is true
Contributors ✨ #
Thanks goes to these wonderful people (emoji key):
Ahmed Eslayed💻
📃 License #
Copyright (c) 2012 Pharous
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
copied to clipboard
Getting Started #
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.