Skip to content

About

Favorite-places map app — OpenStreetMap via flutter_map with live device location, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Favorite Map App — Flutter Assignment (Map & Location)

A Flutter app that uses OpenStreetMap via flutter_map — no API key, no credit card, no billing account required.

The app:

  1. Displays an interactive map at launch with zoom controls and OSM base tiles.
  2. 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.
  3. 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.
  4. 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.


Project structure

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

Setup

flutter pub get
flutter run

That'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.

Features checklist

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()

Screenshots (to capture for submission)

  1. Map after launch (favorite markers visible).
  2. Current location after pressing My Location.
  3. Tapping a favorite marker → details bottom sheet.
  4. Tapping Favorites → list bottom sheet.

Submission

Push this folder to a public GitHub repository and submit the repo link along with the screenshots.

About

Favorite-places map app — OpenStreetMap via flutter_map with live device location, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages