diff --git a/example/lib/full_map.dart b/example/lib/full_map.dart new file mode 100644 index 000000000..ee9b42950 --- /dev/null +++ b/example/lib/full_map.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:mapbox_gl/mapbox_gl.dart'; + +import 'page.dart'; + +class FullMapPage extends Page { + FullMapPage() + : super(const Icon(Icons.map), 'Full screen map'); + + @override + Widget build(BuildContext context) { + return const FullMap(); + } +} + +class FullMap extends StatefulWidget { + const FullMap(); + + @override + State createState() => FullMapState(); +} + +class FullMapState extends State { + MapboxMapController mapController; + + void _onMapCreated(MapboxMapController controller) { + mapController = controller; + } + + @override + Widget build(BuildContext context) { + return new Scaffold( + body: MapboxMap( + onMapCreated: _onMapCreated, + initialCameraPosition: + const CameraPosition(target: LatLng(0.0, 0.0)), + ) + ); + } +} diff --git a/example/lib/main.dart b/example/lib/main.dart index e81ce1804..4fec3b987 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -4,8 +4,10 @@ import 'package:flutter/material.dart'; import 'package:location/location.dart'; +import 'package:mapbox_gl_example/full_map.dart'; import 'animate_camera.dart'; +import 'full_map.dart'; import 'line.dart'; import 'map_ui.dart'; import 'move_camera.dart'; @@ -16,6 +18,7 @@ import 'scrolling_map.dart'; final List _allPages = [ MapUiPage(), + FullMapPage(), AnimateCameraPage(), MoveCameraPage(), PlaceSymbolPage(),