A Flutter app that uses OpenStreetMap via flutter_map — no API key, no credit card, no billing account required.
The app:
- Displays an interactive map at launch with zoom controls and OSM base tiles.
- Has a custom "My Location" button that uses
geolocator(the device's real GPS) to fetch latitude / longitude, recenter the camera and drop a marker at the user's spot. - Drops markers for 3 predefined favorite locations (Khulna University, Khulna Railway Station, Shibbari More). Tapping a marker opens a bottom sheet with ID, Name, Latitude, Longitude.
- Has a "Favorites" button that opens a list of favorite locations. Tapping a list entry animates the camera to that location and shows its details.
The current location is never hard-coded — it always comes from the device's location service.
ℹ️ We chose
flutter_map+ CartoDB Voyager tiles over the official Google Maps SDK because Google Maps now requires a credit-card-linked billing account, which isn't practical for a student assignment. CartoDB Voyager tiles are free for low-volume use, and the assignment only says "Map View" — it does not require the Google brand.
lib/
├── main.dart # MaterialApp + theme
├── models/
│ └── favorite_location.dart # id, name, latitude, longitude (latlong2.LatLng)
├── data/
│ └── favorite_locations_data.dart # 3 default locations
└── screens/
└── map_screen.dart # FlutterMap + markers + buttons + sheets
android/app/src/main/AndroidManifest.xml # Permissions only — no Maps API key needed
ios/Runner/Info.plist # iOS location usage description
pubspec.yaml # flutter_map + latlong2 + geolocator + permission_handler
test/widget_test.dart # Smoke + model unit test
flutter pub get
flutter runThat's it — no .env, no API keys, no project files to edit.
The map works on any Android emulator or device. No Google Play Services needed for OSM tiles.
| Requirement | Where it lives |
|---|---|
| Map at start | map_screen.dart → FlutterMap widget |
| Zoom controls | _ZoomControls widget (custom +/-) + pinch gesture |
| My Location button (custom) | _onMyLocationPressed() |
| ≥ 3 favorite markers | _buildFavoriteMarkers() from kDefaultFavoriteLocations |
| Marker tap → details (ID, Name, Lat, Lng) | _showFavoriteDetails() → _FavoriteDetailsSheet |
| Favorites list button | _showFavoritesSheet() → _FavoritesListSheet |
| Tap a list item → move map | _FavoritesListSheet.onTap → _mapController.move() |
| Permission handling | _ensureLocationPermission() |
| Location is NOT hard-coded | Geolocator.getCurrentPosition() |
- Map after launch (favorite markers visible).
- Current location after pressing My Location.
- Tapping a favorite marker → details bottom sheet.
- Tapping Favorites → list bottom sheet.
Push this folder to a public GitHub repository and submit the repo link along with the screenshots.