GalliMap for Flutter

Galli Map is a Flutter package that provides a customizable map widget for displaying Map with custom markers, lines, circles, and polygons. The widget supports zooming in and out, tapping on the map, and showing the user's current location.
To install and start using this package in your Flutter project, you need to add "galli_map" as a dependency in your project's pubspec.yaml file. You can follow the installation guide provided in the "galli_map" package on pub.dev or use this link (https://pub.dev/packages/galli_map) to access the package page on pub.dev.

GalliMap Widget

A map widget for Flutter. To use this widget import and add the Galli Map widget to the project.

Properties:

height A double value that specifies the height of the map.
width A double value that specifies the width of the map.
zoom A double value that specifies the initial zoom level of the map
maxZoom A double value that specifies the maximum zoom level of the map.
minZoom A double value that specifies the minimum zoom level of the map.
showCurrentLocation A boolean value that determines whether to show the current location or not.
currentLocationMarker A widget that specifies the marker to be used for the current location.
markers A list of GalliMarker objects that specify the markers to be displayed on the map.
lines A list of GalliLine objects that specify the lines to be displayed on the map.
circles A list of GalliCircle objects that specify the circles to be displayed on the map.
polygons A list of GalliPolygon objects that specify the polygons to be displayed on the map.
showSearch A boolean value that determines whether to show the search feature or not.
show360Button A boolean value that determines whether to show the 360 button or not.
three60Widget A widget that specifies the 360 widget to be displayed on the map.
showLocationButton A boolean value that determines whether to show the location button or not.
currentLocationWidget A widget that specifies the location widget to be displayed on the map.
searchHint A string value that specifies the hint text to be displayed in the search bar.
controller A GalliController object that controls the behavior of the map.
onTapAutoComplete A function that is called when an autocomplete item is tapped.
onTap A function that is called when the map is tapped. It receives a LatLng object that represents the tapped location.
children A list of widgets that will be displayed on top of the map but below other overlays.
initialPosition A LatLng value that specifies where the camera will be at the start of the map widget.
three60MarkerSize A double value that determines the size of markers.
on360MarkerTap A function that specifies the actions on 360 marker click. Originally a 360 image will display on marker click. To not display a 360 image return null on360MarkerTap.
onMapLoadComplete A function that returns a controller and lets the user controller the map and display its attributes.
onMapUpdate A function that returns current map state and lets the user display and use those states and events.
markerClusterWidget A list of GalliMarker which will be clustered.
show360ImageOnMarkerClick A boolean value which determines whether to show 360 Image on marker click. It is true by default.
viewer A 360 viewer widget, if not specified a default widget will be displayed on 360 marker click.
viewerPosition An offset value that determines the position of 360 viewer widget within the context. It only works if the user passes a custom 360 viewer widget.
authKey Access Token key provided by GalliExpress.

Example Usage :

Basic Map with markers, circles, lines ,polygons and 360 viewer

import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:galli_map/galli_map.dart';
	
void main() {
	runApp(const MyApp());
}
	
class MyApp extends StatelessWidget {
const MyApp({super.key});
	
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
	return MaterialApp(
	title: 'Flutter Demo',
	debugShowCheckedModeBanner: false,
	theme: ThemeData(
	primarySwatch: Colors.blue,
	),
	home: const MyHomePage(),
	);
	}
}
	
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
	
@override
	State createState() => _MyHomePageState();
}
	
class _MyHomePageState extends State with TickerProviderStateMixin {
	final GalliController controller = GalliController();
	final GalliMethods galliMethods =
	GalliMethods("YOUR-ACCESS-TOKEN");
	
@override
	void initState() {
	super.initState();
}
	
@override
Widget build(BuildContext context) {
	return Scaffold(
	body: SafeArea(
	child: Column(
		children: [
		SizedBox(
		height: MediaQuery.of(context).size.height * 0.8,
		width: MediaQuery.of(context).size.width,
		child: GalliMap(
		onTapAutoComplete: (AutoCompleteModel model) async {
		FeatureModel? feature = await galliMethods.search(
		model.name!, controller.map.center);
		if (feature != null) {
		await galliMethods.getRoute(
		source: controller.map.center,
		destination: feature.geometry!.coordinates!.first);
		}
	},
	onMapLoadComplete: (controller) async {
	galliMethods.animateMapMove(LatLng(27.709857, 85.339195), 18,
	this, mounted, controller);
},
	authKey: "YOUR-ACCESS-TOKEN",
	controller: controller,
	zoom: 16,
	initialPosition: LatLng(27.672905, 85.312215),
	showCurrentLocation: true,
	viewer: Viewer(
		accessToken: "YOUR-ACCESS-TOKEN",
		pinIcon: Icon(
			Icons.abc,
			size: 48,
		),
		animSpeed: 2,
		height: 300,
		width: 300,
		onSaved: (x, y) {
		print("$x,$y");
	}),
		onTap: (tap) {
		galliMethods.reverse(tap);
	},
		on360MarkerTap: () {},
		onMapUpdate: (event) {},
		circles: [
		GalliCircle(
		center: LatLng(27.684222, 85.303778),
		radius: 54,
		color: Colors.white,
		borderStroke: 3,
		borderColor: Colors.black)
	],
		lines: [
		GalliLine(
		line: [
		LatLng(27.684222, 85.303778),
		LatLng(27.684246, 85.303780),
		LatLng(27.684222, 85.303790),
		LatLng(27.684230, 85.303778),
	],
		borderColor: Colors.blue,
		borderStroke: 2,
		lineColor: Colors.white,
		lineStroke: 2)
	],
		polygons: [
		GalliPolygon(
		polygon: [
		LatLng(27.684222, 85.303778),
		LatLng(27.684246, 85.303780),
		LatLng(27.684222, 85.303790),
		LatLng(27.684290, 85.303754),
	],
	    borderColor: Colors.red,
		borderStroke: 2,
		color: Colors.green,
		),
	],
		children: [
		Positioned(
		top: 64,
		right: 64,
		child: Container(
		width: 32,
		height: 32,
		color: Colors.yellow,
		)
	],
		markerClusterWidget: (context, list) {
		return Container(
		width: 20,
		height: 20,
		color: Colors.red,
		child: Center(
			child: Text(list.length.toString()),
			),
		);
	},
		viewerPosition: Offset(32, 32),
		markers: [
		
		GalliMarker(
		latlng: LatLng(27.684222, 85.30134),
		anchor: Anchor.top,
		markerWidget: const Icon(
		Icons.location_history,
		color: Colors.black,
		size: 48,
		)),
		
		GalliMarker(
		latlng: LatLng(27.684222, 85.30134),
		anchor: Anchor.top,
		markerWidget: const Icon(
		Icons.location_history,
		color: Colors.black,
		size: 48,
		)),
		
		GalliMarker(
		latlng: LatLng(27.684222, 85.30134),
		anchor: Anchor.top,
		markerWidget: const Icon(
		Icons.location_history,
		color: Colors.black,
		size: 48,
		)),
		
		GalliMarker(
		latlng: LatLng(27.684222, 85.30134),
		anchor: Anchor.top,
		markerWidget: const Icon(
		Icons.location_history,
		color: Colors.black,
		size: 48,
		))
	],
		),
	  ),
	 ],
    ),
   ),
  ),
 );
}
}

AutoComplete Model

The AutoCompleteModel class represents a suggestion item for an autocomplete field. It has the following properties:

Properties:

name (String) The name of the suggestion item.
fclass (String) The functional class of the suggestion item.
geometryString (String) A string r