flutter_map_line_editor 7.0.0 copy "flutter_map_line_editor: ^7.0.0" to clipboard
flutter_map_line_editor: ^7.0.0 copied to clipboard

A basic Line and Polygon editor for `flutter_map` using drag markers

example/lib/main.dart

import 'package:example/list_page.dart';
import 'package:example/map_in_map_page.dart';
import 'package:example/polygon_page.dart';
import 'package:example/polyline_page.dart';
import 'package:flutter/material.dart';

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

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

  @override
  State<App> createState() => _AppState();
}

class _AppState extends State<App> {
  int _selectedIndex = 0;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: IndexedStack(
          index: _selectedIndex,
          children: const [
            PolylinePage(),
            PolygonPage(),
            ListPage(),
            MapInMapPage()
          ],
        ),
        bottomNavigationBar: BottomNavigationBar(
          unselectedItemColor: Colors.black45,
          selectedItemColor: Colors.black,
          currentIndex: _selectedIndex,
          onTap: (index) => setState(() {
            _selectedIndex = index;
          }),
          items: const [
            BottomNavigationBarItem(
              icon: Icon(Icons.linear_scale_rounded),
              label: 'Polyline',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.dashboard_outlined),
              label: 'Polygon',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.list),
              label: 'List',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.zoom_in),
              label: 'Map in Map',
            ),
          ],
        ),
      ),
    );
  }
}
25
likes
150
pub points
89%
popularity

Publisher

unverified uploader

A basic Line and Polygon editor for `flutter_map` using drag markers

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_map_dragmarker, latlong2

More

Packages that depend on flutter_map_line_editor