Skip to content

Node-us/map_panels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages