Skip to content
Snippets Groups Projects
Commit 7156000c authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

add: share button, and bottom sheet

parent 97d95fa4
No related branches found
No related tags found
1 merge request!14Clhp map
......@@ -10,7 +10,7 @@ const String serverURI = "https://127.0.0.1:$port/";
const String mapEndpoint = "update_map";
// Map variables
String selectedLake = 'Skumsjøen'; // NB should be initialised to last selected lake
String selectedLake = 'Mjøsa'; // NB should be initialised to last selected lake
Uint8List selectedRelation = Uint8List(0);
List<Measurement> selectedMarkerList = [];
SubDiv? selectedSubDiv;
......
......@@ -65,9 +65,7 @@ class _DefaultPageState extends State<DefaultPage> {
// Make request only if the selected lake is different from the current selected lake
if (result != selectedLake) {
initialiseState(false);
setState(() {
print("SetState called!");
selectedLake = result;
// NB update lastLake persistent variable
});
......
......@@ -162,34 +162,37 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
),
),
Positioned( // No wifi icon
top: 80,
Positioned( // Export button
top: 90,
right: 10,
child: GestureDetector(
onTapDown: (_) {
setState(() {
// Add functionality
});
},
onTapUp: (_) {
setState(() {
// Add functionality
});
},
onTapCancel: () {
setState(() {
// Add functionality
});
onTap: () {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 400,
child: Center(
child: ElevatedButton(
child: const Text('Close'),
onPressed: () {
Navigator.pop(context);
},
),
),
);
},
);
},
child: Visibility( // Show icon only when no server connection
visible: !widget.serverConnection,
child: Container(
child: Container(
padding: const EdgeInsets.all(8),
decoration: isSatTapped ? const BoxDecoration(
shape: BoxShape.circle,
color: Colors.blue,
) : null,
child: const Icon(Icons.perm_scan_wifi, color: Color(0xFF5B0000)),
child: const Icon(
Icons.share,
color: Colors.white54,
),
),
),
......@@ -270,3 +273,4 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
);
}
}
......@@ -27,7 +27,7 @@ class OSM extends StatelessWidget {
),
children: [
TileLayer(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
urlTemplate: "https://{s}.tile.openstreetmap.org/{z/{x}/{y}.png",
subdomains: const ['a', 'b', 'c'],
),
PolygonLayer(
......
This diff is collapsed.
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment