galli_vector_package 0.0.5 copy "galli_vector_package: ^0.0.5" to clipboard
galli_vector_package: ^0.0.5 copied to clipboard

A Galli vector map widget that displays a map with custom markers, lines, circles and polygons.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:galli_vector_package/galli_vector_package.dart';
import 'package:geolocator/geolocator.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Future<void> getLocation() async {
    LocationPermission permissionStatus = await Geolocator.checkPermission();
    if (permissionStatus == LocationPermission.denied ||
        permissionStatus == LocationPermission.deniedForever) {
      permissionStatus = await Geolocator.requestPermission();
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
          body: SafeArea(
        child: FutureBuilder(
            future: getLocation(),
            builder: (context, snap) {
              return GalliMap(
                size: (
                  width: MediaQuery.sizeOf(context).width,
                  height: MediaQuery.sizeOf(context).height
                ),
                initialCameraPostion: const CameraPosition(
                    target: LatLng(27.675424, 85.324947), zoom: 19),
                authToken: "token",
                showCurrentLocation: true,
                onMapCreated: (c) {},
              );
            }),
      )),
    );
  }
}
0
likes
150
points
54
downloads

Publisher

unverified uploader

Weekly Downloads

A Galli vector map widget that displays a map with custom markers, lines, circles and polygons.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_cube, http, maplibre_gl

More

Packages that depend on galli_vector_package