This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
main.dart
73 lines (66 loc) · 1.98 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'animate_camera.dart';
import 'lite_mode.dart';
import 'map_click.dart';
import 'map_coordinates.dart';
import 'map_ui.dart';
import 'marker_icons.dart';
import 'move_camera.dart';
import 'padding.dart';
import 'page.dart';
import 'place_circle.dart';
import 'place_marker.dart';
import 'place_polygon.dart';
import 'place_polyline.dart';
import 'scrolling_map.dart';
import 'snapshot.dart';
import 'tile_overlay.dart';
final List<GoogleMapExampleAppPage> _allPages = <GoogleMapExampleAppPage>[
const MapUiPage(),
const MapCoordinatesPage(),
const MapClickPage(),
const AnimateCameraPage(),
const MoveCameraPage(),
const PlaceMarkerPage(),
const MarkerIconsPage(),
const ScrollingMapPage(),
const PlacePolylinePage(),
const PlacePolygonPage(),
const PlaceCirclePage(),
const PaddingPage(),
const SnapshotPage(),
const LiteModePage(),
const TileOverlayPage(),
];
/// MapsDemo is the Main Application.
class MapsDemo extends StatelessWidget {
/// Default Constructor
const MapsDemo({Key? key}) : super(key: key);
void _pushPage(BuildContext context, GoogleMapExampleAppPage page) {
Navigator.of(context).push(MaterialPageRoute<void>(
builder: (_) => Scaffold(
appBar: AppBar(title: Text(page.title)),
body: page,
)));
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('GoogleMaps examples')),
body: ListView.builder(
itemCount: _allPages.length,
itemBuilder: (_, int index) => ListTile(
leading: _allPages[index].leading,
title: Text(_allPages[index].title),
onTap: () => _pushPage(context, _allPages[index]),
),
),
);
}
}
void main() {
runApp(const MaterialApp(home: MapsDemo()));
}