galli_vector_package 0.0.5 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.
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) {},
);
}),
)),
);
}
}