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

update: serverConnection logic

parent b951e4a1
No related branches found
No related tags found
2 merge requests!9Clhp map,!8Clhp map
......@@ -11,7 +11,6 @@ const int fetchInterval = 60; // Fetch marker data every n minutes
// Map variables
LatLng mapCenter = LatLng(60.7666, 10.8471);
DateTime ?lastUpdate; // Last time data was fetched from server
bool gServerConnection = false;
// Font variables
const textColor = Colors.white;
......
......@@ -142,7 +142,11 @@ class _DefaultPageState extends State<DefaultPage> {
),
child: ListView(
children: [
MapContainerWidget(markerList: markerList, relation: relation),
MapContainerWidget(
markerList: markerList,
relation: relation,
serverConnection: serverConnection,
),
],
),
);
......
......@@ -16,10 +16,12 @@ import 'quick_view_chart.dart';
class MapContainerWidget extends StatefulWidget {
final List<Measurement> markerList;
final Uint8List relation;
final bool serverConnection;
const MapContainerWidget({Key? key,
required this.markerList,
required this.relation,
required this.serverConnection,
}) : super(key: key);
@override
......@@ -279,7 +281,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
});
},
child: Visibility( // Show icon only when no server connection
visible: !gServerConnection,
visible: !widget.serverConnection,
child: Container(
padding: const EdgeInsets.all(8),
decoration: isTapped ? const BoxDecoration(
......
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