forked from fleaflet/flutter_map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap_inside_listview.dart
57 lines (54 loc) · 1.86 KB
/
map_inside_listview.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
import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_map_example/pages/zoombuttons_plugin_option.dart';
import 'package:flutter_map_example/widgets/drawer.dart';
import 'package:latlong2/latlong.dart';
class MapInsideListViewPage extends StatelessWidget {
static const String route = 'map_inside_listview';
const MapInsideListViewPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Map inside ListView')),
drawer: buildDrawer(context, MapInsideListViewPage.route),
body: Padding(
padding: const EdgeInsets.all(8),
child: ListView(
scrollDirection: Axis.vertical,
children: [
SizedBox(
height: 300,
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
zoom: 5,
),
children: [
TileLayer(
urlTemplate:
'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'dev.fleaflet.flutter_map.example',
),
const FlutterMapZoomButtons(
minZoom: 4,
maxZoom: 19,
mini: true,
padding: 10,
alignment: Alignment.bottomLeft,
),
],
),
),
const Card(
child: ListTile(
title: Text(
'Scrolling inside the map does not scroll the ListView')),
),
const SizedBox(height: 500),
const Card(child: ListTile(title: Text('look at that scrolling')))
],
),
),
);
}
}