forked from flutter-mapbox-gl/maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[example] add full page map example (flutter-mapbox-gl#201)
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<FullMap> { | ||
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)), | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters