interactive_world_map 0.1.3 copy "interactive_world_map: ^0.1.3" to clipboard
interactive_world_map: ^0.1.3 copied to clipboard

Interactive world map widget for Flutter with pre-generated geometry, pan/zoom, hit testing, and UN geoscheme helpers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'interactive_map_demo_page.dart';
import 'icon_examples_page.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    const seed = Color(0xFF355E79);
    final scheme = ColorScheme.fromSeed(
      seedColor: seed,
      brightness: Brightness.light,
    );
    return MaterialApp(
      theme: ThemeData(
        useMaterial3: true,
        colorScheme: scheme,
        scaffoldBackgroundColor: const Color(0xFFF4F2ED),
        fontFamily: 'serif',
        textTheme: ThemeData.light()
            .textTheme
            .apply(bodyColor: scheme.onSurface, displayColor: scheme.onSurface)
            .copyWith(
              headlineMedium: const TextStyle(
                fontFamily: 'serif',
                fontWeight: FontWeight.w700,
                letterSpacing: -0.3,
              ),
              titleLarge: const TextStyle(
                fontFamily: 'serif',
                fontWeight: FontWeight.w600,
                letterSpacing: -0.2,
              ),
            ),
      ),
      home: const ExampleHome(),
    );
  }
}

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

  @override
  State<ExampleHome> createState() => _ExampleHomeState();
}

class _ExampleHomeState extends State<ExampleHome> {
  int _index = 0;
  final _pages = const [
    InteractiveMapDemoPage(),
    IconExamplesPage(),
  ];

  String get _title => _index == 0 ? 'Interactive Map' : 'World Icons';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(_title),
        centerTitle: false,
      ),
      body: IndexedStack(
        index: _index,
        children: _pages,
      ),
      bottomNavigationBar: NavigationBar(
        selectedIndex: _index,
        onDestinationSelected: (value) => setState(() => _index = value),
        destinations: const [
          NavigationDestination(
            icon: Icon(Icons.public),
            label: 'Map',
          ),
          NavigationDestination(
            icon: Icon(Icons.grid_view),
            label: 'Icons',
          ),
        ],
      ),
    );
  }
}
1
likes
150
points
27
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Interactive world map widget for Flutter with pre-generated geometry, pan/zoom, hit testing, and UN geoscheme helpers.

Repository (GitHub)
View/report issues

Topics

#flutter #map #geospatial #cartography #visualization

License

MIT (license)

Dependencies

flutter, meta, path_drawing

More

Packages that depend on interactive_world_map