bd_location_picker 0.0.1 bd_location_picker: ^0.0.1 copied to clipboard
A Flutter package that provides an easy-to-use dropdown menu for selecting locations within Bangladesh, with cascading dropdowns for Division, District, and City.
A Flutter package that provides an easy-to-use dropdown menu for selecting locations within Bangladesh. This widget includes cascading dropdowns for divisions, districts, and cities, making it simple for users to pinpoint their location.
Features #
- Select locations within Bangladesh using cascading dropdowns.
- Dropdown menus for Division, District, and City update dynamically based on user selections.
- Customizable styling for easy integration into any app theme.
- onLocationSelected callback to retrieve user-selected division, district, and city in real time.
Getting started #
Installation Add bd_location_picker to your pubspec.yaml dependencies:
dependencies:
bd_location_picker: ^0.0.1
Then run:
flutter pub get
Usage #
To use the bd_location_picker widget, import the package and add it to your widget tree. The widget’s onLocationSelected callback provides access to the selected location.
import 'package:bd_location_picker/bd_location_picker.dart';
class LocationDropdownPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Location Picker")),
body: Center(
child: LocationSelecter(
onLocationSelected: (division, district, city) {
print("Selected Division: $division");
print("Selected District: $district");
print("Selected City: $city");
},
),
),
);
}
}
Additional information #
This widget provides three dropdown menus where:
Division: Users can select a division within Bangladesh. District: Populated based on the selected division. City: Populated based on the selected district. Customization The dropdown style (padding, colors, border) is designed for easy customization. You can adjust colors, padding, and borders to suit your app’s design needs.