Skip to main content

marker_crafter 2.2.1 copy "marker_crafter: ^2.2.1" to clipboard
marker_crafter: ^2.2.1 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 'package:flutter_localizations/flutter_localizations.dart';

import 'src/app_strings.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 ValueListenableBuilder<Locale?>(
      valueListenable: appLocale,
      builder: (BuildContext context, Locale? locale, _) => MaterialApp(
        title: 'Marker Crafter',
        debugShowCheckedModeBanner: false,
        theme: AppTheme.light(),
        darkTheme: AppTheme.dark(),
        // Null follows the device language (Turkish or English).
        locale: locale,
        supportedLocales: supportedLocales,
        localeListResolutionCallback: resolveLocale,
        localizationsDelegates: GlobalMaterialLocalizations.delegates,
        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) {
    final AppStrings strings = AppStrings.of(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: <NavigationDestination>[
          NavigationDestination(
            icon: const Icon(Icons.map_outlined),
            selectedIcon: const Icon(Icons.map),
            label: strings.navMap,
          ),
          NavigationDestination(
            icon: const Icon(Icons.tune_outlined),
            selectedIcon: const Icon(Icons.tune),
            label: strings.navStudio,
          ),
        ],
      ),
    );
  }
}
3
likes
160
points
220
downloads
screenshot

Documentation

API reference

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

MIT (license)

Dependencies

flutter, google_maps_flutter

More

Packages that depend on marker_crafter