-
Notifications
You must be signed in to change notification settings - Fork 7
/
data.dart
39 lines (36 loc) · 1.1 KB
/
data.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
import 'package:flutter/material.dart';
import 'package:universe/universe.dart';
class RectangleWithDataMap extends StatefulWidget {
const RectangleWithDataMap({super.key});
@override
State<RectangleWithDataMap> createState() => _RectangleWithDataMapState();
}
class _RectangleWithDataMapState extends State<RectangleWithDataMap> {
@override
Widget build(BuildContext context) {
return U.OpenStreetMap(
center: [51.555015, -0.108331],
zoom: 16,
rectangles: U.RectangleLayer(
[
[51.554488, -0.108964], // bottom left corner
[51.555682, -0.107580], // top right corner
],
stroke: true,
isDotted: true,
strokeColor: Colors.lightBlue,
strokeOpacity: 0.8,
strokeWidth: 3.6,
fillColor: Colors.red,
fillOpacity: 0.75,
data: 'Arsenal Football Club',
onTap: (position, data) {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Welcome to $data')),
);
},
),
);
}
}