map_panels 0.0.2

Flutter Android iOS web

A new Flutter package project.

map_panels #

A Flutter package that you can use to create panel style map app easily.

image

Usage #

1. Wrap your app (or screen/widget) with MapPanelsProvider

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MapPanelsProvider(child: YourScreen())
    );
  }
}

2. Write your own panel


class MainPanel extends MapPanel {
  MainPanel() : super();

  @override
  Widget panelBuilder(BuildContext context, ScrollController scrollController, MapPanelsController panelsController) {
    return Container(child: Text('My awesome panel'));
  }
}

3. Show your panel


class _MapPageState extends State<MapPage> {
  @override
  void didChangeDependencies() {
    Timer(Duration(seconds: 1), () async {
      MainPanel().show(context);
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FlutterMap(
        options: MapOptions(
        center: LatLng(23.130847, 120.883967),
        zoom: 7,
      ),
      layers: [
        TileLayerOptions(
          urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
          subdomains: ['a', 'b', 'c']
        ),
      ]
    );
  }
}

Credit #

This package is built with sliding_up_panel