Skip to content

FriMohamed/map-markers

Repository files navigation

Map Markers

Map Markers is a Flutter application that allows users to explore locations on a map, search for places, save their favorite spots, and view detailed information about the app.

Features

  • Interactive Map: Utilizes Google Maps to display geographical locations.
  • Location Search: Search for specific places using an integrated search functionality powered by the LocationIQ API.
  • Tap to Mark: Tap on any location on the map to get its address and temporarily mark it.
  • Favorite Places: Save your preferred locations to a favorites list for quick access.
  • Persistent Storage: Favorite places are stored locally using shared_preferences and persist across app sessions.
  • Current Location: Easily jump to your current geographical position on the map.
  • Location Permissions: Handles location service checks and permission requests.
  • App Information: A dedicated screen providing details about the application and its developer.

Technologies Used

  • Flutter & Dart: The core framework for building the cross-platform application.
  • Google Maps Flutter: Integration for interactive maps.
  • Geolocator: For accessing device location and handling permissions.
  • Shared Preferences: For local data storage of favorite places.
  • HTTP: For making API requests to LocationIQ.
  • LocationIQ API: Used for place search and reverse geocoding (API key included in map_screen.dart).

Project Structure

The core application logic resides in the lib/ directory:

  • main.dart: The entry point of the application, setting up the MainScreen.
  • models/place.dart: Defines the Place data model.
  • screens/: Contains the UI for different parts of the app:
    • favorite_screen.dart: Displays the list of favorited places.
    • info_screen.dart: Shows information about the application.
    • main_screen.dart: Manages the tab-based navigation (Map, Favorites, About).
    • map_screen.dart: Implements the map view, search, marker handling, and location services.
  • services/: Contains services for data handling and location:
    • favorites_storage.dart: Handles saving and loading favorite places.
    • lacation.dart: Provides utilities for getting current location and permission handling.
  • utils/debouncer.dart: A utility class for debouncing search input.

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Flutter SDK installed (version compatible with this project).
  • A physical device or emulator to run the app.

Installation

  1. Clone the repository:
    git clone https://github.com/your_username/map-markers.git
    cd map-markers
  2. Install Flutter dependencies:
    flutter pub get
  3. Google Maps API Key (Android/iOS):
    • You will need to set up a Google Maps API key for Android and iOS. Follow the official google_maps_flutter plugin instructions: https://pub.dev/packages/google_maps_flutter
    • For Android, add your API key to android/app/src/main/AndroidManifest.xml:
      <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_GOOGLE_MAPS_API_KEY"/>
    • For iOS, add your API key to ios/Runner/AppDelegate.swift:
      import GoogleMaps
      // ... inside application:didFinishLaunchingWithOptions:
      GMSServices.provideAPIKey("YOUR_GOOGLE_MAPS_API_KEY")
  4. LocationIQ API Key:
    • This project uses a hardcoded LocationIQ API key (pk.c6f213784e1d18ec14a5c858eb11c5e5) in lib/screens/map_screen.dart. For production environments, it is recommended to manage API keys more securely (e.g., environment variables, backend services).

Running the Application

Connect a device or start an emulator and run:

flutter run

Usage

  • Map Tab: View the map, search for places using the search bar, tap on the map to mark a location, and use the floating action button to go to your current location.
  • Favorites Tab: See a list of all your saved favorite places. Tap on a favorite to jump to its location on the map, or swipe left to delete it.
  • About Tab: Access information about the application.

Screen Shots

About

Mobile app, Map Markers is a Flutter application that allows users to explore locations on a map, search for places, save their favorite spots, and view detailed information about the app.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors