Skip to main content

gps_camera_snap 0.0.2 copy "gps_camera_snap: ^0.0.2" to clipboard
gps_camera_snap: ^0.0.2 copied to clipboard

A Flutter camera package that overlays GPS location, address, date, and time on captured images.

GPS Camera #

A Flutter package to capture images with GPS coordinates, address, date, and time overlays.

Features #

  • Capture images with a camera preview.
  • Overlay GPS coordinates, address, date, and time on the captured image.
  • Display a map with the captured location.
  • Customizable overlay elements.

Getting Started #

  1. Get a MapTiler API Key:

    • Go to MapTiler and create a free account.
    • Get your API key from the MapTiler dashboard.
  2. Set the API Key in your project:

    • When you run your Flutter app, you need to provide the MapTiler API key as a Dart environment variable. Use the following command:

      flutter run --dart-define=MAPTILER_API_KEY=YOUR_API_KEY
      

      Replace YOUR_API_KEY with your actual MapTiler API key.

  3. Add the package to your pubspec.yaml:

    dependencies:
      gps_camera: ^0.0.1 # Replace with the latest version
    

Usage #

import 'package:flutter/material.dart';
import 'package:gps_camera_snap/gps_camera_snap.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('GPS Camera Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              Navigator.of(context).push(
                MaterialPageRoute(
                  builder: (context) => GpsCamera(
                    config: const GpsCameraConfig(
                      mapTilerApiKey: String.fromEnvironment('MAPTILER_API_KEY'),
                      showMap: true,
                      showAddress: true,
                      showCoordinates: true,
                      showDate: true,
                      showTime: true,
                    ),
                    onImageCaptured: (path) {
                      // Handle the captured image path
                      print('Image captured at: $path');
                      Navigator.of(context).pop();
                    },
                  ),
                ),
              );
            },
            child: const Text('Open Camera'),
          ),
        ),
      ),
    );
  }
}
3
likes
0
points
235
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter camera package that overlays GPS location, address, date, and time on captured images.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

camera, flutter, flutter_map, geocoding, geolocator, http, intl, latlong2, path, path_provider

More

Packages that depend on gps_camera_snap