galli_vector_plugin 0.0.1 copy "galli_vector_plugin: ^0.0.1" to clipboard
galli_vector_plugin: ^0.0.1 copied to clipboard

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

example/lib/main.dart

import 'dart:math' hide log;

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const NewMainMap(),
    );
  }
}

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

  @override
  State<NewMainMap> createState() => _NewMainMapState();
}

class _NewMainMapState extends State<NewMainMap> {
  GalliMapController? controller;
  GalliMethods methods = GalliMethods("89a40903-b75a-46b6-822b-86eebad4fa36");
  List<Marker> markers = [];
  late void Function() clearMarkers;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: GalliMap(
            authToken: "89a40903-b75a-46b6-822b-86eebad4fa36",
            size: (
              height: MediaQuery.of(context).size.height * 2,
              width: MediaQuery.of(context).size.width * 2,
            ),
            compassPosition: (
              position: CompassViewPosition.topRight,
              offset: const Point(32, 82)
            ),
            showCompass: true,
            onMapCreated: (newC) {
              controller = newC;
              setState(() {});
            },
            onMapClick: (LatLng latLng) {
              methods.get360Image(latLng).then((value) {
                GalliViewer galliViewer = GalliViewer(
                  builder: (BuildContext context, Function() methodFromChild) {
                    clearMarkers = methodFromChild;
                  },
                  image: value,
                  onTap: (latitude, longitude, tilt) {},
                  markers: markers,
                  maxMarkers: 2,
                );
                Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (_) => Scaffold(
                            appBar: AppBar(
                              actions: [
                                GestureDetector(
                                    onTap: () {
                                      clearMarkers();
                                    },
                                    child: const Text("Clear"))
                              ],
                            ),
                            body: galliViewer)));
              });

              // String? data =
              //     await galliMapController!.reverGeoCoding(latLng);
            },
          ),
        ),
      ),
    );
  }
}
3
likes
0
pub points
57%
popularity

Publisher

unverified uploader

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

Homepage

License

unknown (license)

Dependencies

flutter, flutter_cube, http, meta, motion_sensors, plugin_platform_interface

More

Packages that depend on galli_vector_plugin