Skip to main content

marker_crafter 2.1.2 copy "marker_crafter: ^2.1.2" to clipboard
marker_crafter: ^2.1.2 copied to clipboard

Draws custom Google Maps markers (text labels, rings and location pins) with Canvas and turns them into BitmapDescriptors.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'src/app_theme.dart';
import 'src/map_page.dart';
import 'src/studio_page.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Marker Crafter',
      debugShowCheckedModeBanner: false,
      theme: AppTheme.light(),
      darkTheme: AppTheme.dark(),
      home: const HomeShell(),
    );
  }
}

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

  @override
  State<HomeShell> createState() => _HomeShellState();
}

class _HomeShellState extends State<HomeShell> {
  int _index = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // Keeps both pages alive so the map is not recreated on every switch.
      body: IndexedStack(
        index: _index,
        children: const <Widget>[MapPage(), StudioPage()],
      ),
      bottomNavigationBar: NavigationBar(
        selectedIndex: _index,
        onDestinationSelected: (int index) => setState(() => _index = index),
        destinations: const <NavigationDestination>[
          NavigationDestination(icon: Icon(Icons.map_outlined), selectedIcon: Icon(Icons.map), label: 'Map'),
          NavigationDestination(icon: Icon(Icons.tune_outlined), selectedIcon: Icon(Icons.tune), label: 'Studio'),
        ],
      ),
    );
  }
}
3
likes
0
points
220
downloads

Publisher

verified publisherabdurrahmankaraoglu.com

Weekly Downloads

Draws custom Google Maps markers (text labels, rings and location pins) with Canvas and turns them into BitmapDescriptors.

Repository (GitHub)
View/report issues

Topics

#google-maps #maps #marker #canvas

License

unknown (license)

Dependencies

flutter, google_maps_flutter

More

Packages that depend on marker_crafter