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

Merge branch 'clhp_map' into 'main'

Clhp map

See merge request !11
parents 237612ad 35b1d6f6
No related branches found
No related tags found
1 merge request!11Clhp map
Showing
with 496 additions and 156 deletions
...@@ -16,8 +16,8 @@ Uint8List selectedRelation = Uint8List(0); ...@@ -16,8 +16,8 @@ Uint8List selectedRelation = Uint8List(0);
List<Measurement> selectedMarkerList = []; List<Measurement> selectedMarkerList = [];
LatLng mapCenter = LatLng(60.8000, 10.8471); LatLng mapCenter = LatLng(60.8000, 10.8471);
DateTime ?lastUpdate; // Last time data was fetched from server DateTime ?lastUpdate; // Last time data was fetched from server
List<String> lakeSearchOptions = []; // Init empty List<String> lakeSearchOptions = []; // Init empty
bool internetConnection = true;
// Font settings // Font settings
const textColor = Colors.white; const textColor = Colors.white;
......
import 'package:get/get.dart';
import 'package:app/controller/network_controller.dart';
class DependencyInjection {
static void init() {
Get.put<NetworkController>(NetworkController(), permanent:true);
}
}
\ No newline at end of file
import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import '../consts.dart';
/// NetworkController checks the network connection of the application globally
class NetworkController extends GetxController {
final Connectivity _connectivity = Connectivity();
@override
void onInit() {
super.onInit();
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
}
void _updateConnectionStatus(ConnectivityResult connectivityResult) {
// If no network connection, show snack-bar
if (connectivityResult == ConnectivityResult.none) {
internetConnection = false;
Get.rawSnackbar(
messageText: Text(
'No internet connection. The displayed information may be outdated!',
style: regTextStyle,
),
isDismissible: false,
duration: const Duration(days: 1), // Display the message until a network connection is established
backgroundColor: Colors.black45,
icon: const Icon(
Icons.wifi_off,
color: Colors.white,
size: 35,
),
margin: EdgeInsets.zero,
snackStyle: SnackStyle.GROUNDED,
);
} else {
internetConnection = true;
if (Get.isSnackbarOpen) { // Close snack-bar upon establishing internet connection
Get.closeCurrentSnackbar();
}
}
}
}
\ No newline at end of file
import 'package:get/get.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'pages/loading_page.dart'; import 'pages/loading_page.dart';
import 'package:app/controller/dependency_injection.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
DependencyInjection.init();
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
...@@ -11,7 +14,7 @@ class MyApp extends StatelessWidget { ...@@ -11,7 +14,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const MaterialApp( return const GetMaterialApp( // GetMaterialApp for snack-bar support
home: LoadingPage(), home: LoadingPage(),
); );
} }
......
...@@ -62,18 +62,23 @@ Future<FetchResult> fetchMeasurements() async { ...@@ -62,18 +62,23 @@ Future<FetchResult> fetchMeasurements() async {
} }
Future<FetchResult> loadSavedData() async { Future<FetchResult> loadSavedData() async {
// Get latest saved data from file if the server does not respond try {
Directory appDocumentsDirectory = await getApplicationDocumentsDirectory(); // Get latest saved data from file if the server does not respond
String filePath = '${appDocumentsDirectory.path}/last_data.json'; Directory appDocumentsDirectory = await getApplicationDocumentsDirectory();
String filePath = '${appDocumentsDirectory.path}/last_data.json';
// Read file contents // Read file contents
File file = File(filePath); File file = File(filePath);
if (await file.exists()) { if (await file.exists()) {
String contents = await file.readAsString(); String contents = await file.readAsString();
List<dynamic> jsonData = json.decode(contents); // Parse JSON string from file List<dynamic> jsonData = json.decode(contents); // Parse JSON string from file
List<Measurement> measurements = jsonData.map((data) => Measurement.fromJson(data)).toList(); List<Measurement> measurements = jsonData.map((data) => Measurement.fromJson(data)).toList();
return FetchResult(measurements, false); return FetchResult(measurements, false);
} else { } else {
throw Exception('File does not exist'); throw Exception('File does not exist');
}
} catch (error) {
print('Error in reading measurements from file: $error');
return FetchResult([], false);
} }
} }
...@@ -45,20 +45,23 @@ Future<Uint8List> fetchRelation() async { ...@@ -45,20 +45,23 @@ Future<Uint8List> fetchRelation() async {
} }
} }
/// Load last saved relation data form last_relation.json
Future<Uint8List> loadSavedRelation() async { Future<Uint8List> loadSavedRelation() async {
// Get latest saved relation from file if the server does not respond try {
Directory appDocumentsDirectory = await getApplicationDocumentsDirectory(); // Get latest saved relation from file if the server does not respond
String filePath = '${appDocumentsDirectory.path}/last_relation.json'; Directory appDocumentsDirectory = await getApplicationDocumentsDirectory();
String filePath = '${appDocumentsDirectory.path}/last_relation.json';
// Read file contents // Read file contents as bytes
File file = File(filePath); File file = File(filePath);
if (await file.exists()) { if (await file.exists()) {
String contents = await file.readAsString(); Uint8List bytes = await file.readAsBytes();
List<dynamic> jsonData = json.decode(contents); // Parse JSON string from file return bytes;
Uint8List relation = Uint8List.fromList(utf8.encode(jsonData.toString())); } else {
return relation; throw Exception('Relation file does not exist');
} else { }
throw Exception('File does not exist'); } catch (error) {
print('Error in reading relation from file: $error');
return Uint8List(0);
} }
} }
...@@ -4,42 +4,62 @@ import 'dart:convert'; ...@@ -4,42 +4,62 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:app/consts.dart'; import 'package:app/consts.dart';
import '../consts.dart';
import '../data_classes.dart'; import '../data_classes.dart';
import '../server_requests/fetch_markers.dart'; import '../server_requests/fetch_markers.dart';
import '../server_requests/fetch_relation.dart'; import '../server_requests/fetch_relation.dart';
Future<void> initialiseState() async{ /// initialiseState makes three requests to the server, one requesting
/// measurements for the selected relation, the other requesting the relation,
/// and the last requesting the list of all system lakes
Future<void> initialiseState() async {
bool serverConnection = true; bool serverConnection = true;
late Future<List<Measurement>> markerListFuture; late Future<List<Measurement>> markerListFuture;
late Future<Uint8List> relationFuture; late Future<Uint8List> relationFuture;
// Try to fetch measurement data from server try {
markerListFuture = fetchMeasurements().then((fetchResult) { if (!internetConnection) { // Read data from files if no internet connection
List<Measurement> measurements = fetchResult.measurements; selectedRelation = await loadSavedRelation();
serverConnection = fetchResult.connected;
FetchResult fetchResult = await loadSavedData();
// Return the measurements List<Measurement> measurements = fetchResult.measurements;
return measurements; selectedMarkerList = measurements;
}).catchError((error) {
serverConnection = false;
throw Exception("Failed to fetch measurements: $error");
});
// Attempt to fetch relation from server if app establishes connection
if (serverConnection) {
relationFuture = fetchRelation();
} else { // Read last saved data
relationFuture = loadSavedRelation();
}
initSearchOptions(); lakeSearchOptions = ["Mjøsa"];
} else { // Try to fetch measurement data from server
markerListFuture = fetchMeasurements().then((fetchResult) {
List<Measurement> measurements = fetchResult.measurements;
serverConnection = fetchResult.connected;
// Return measurements
return measurements;
}).catchError((error) {
serverConnection = false;
throw Exception("Failed to fetch measurements: $error");
});
// If measurements were fetched successfully, request relation
if (serverConnection) {
relationFuture = fetchRelation();
} else { // Read last saved data
relationFuture = loadSavedRelation();
}
selectedRelation = await relationFuture; initSearchOptions();
selectedMarkerList = await markerListFuture;
//selectedRelation = await relationFuture;
selectedRelation = await relationFuture; // NB update once fixed
selectedMarkerList = await markerListFuture;
}
} catch (e) {
// Handle any errors that occur during the initialization process
print("Error during initialization: $e");
}
} }
/// initSearchOptions fetches a list of all lake names in the system /// initSearchOptions fetches a list of all lake names in the system
/// and initialises lakeSearchOptions /// and initialises lakeSearchOptions
Future<void> initSearchOptions() async { Future<void> initSearchOptions() async {
......
import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart';
class BarData extends StatefulWidget {
const BarData({super.key});
@override
State<StatefulWidget> createState() => _BarDataState();
}
class _BarDataState extends State<BarData> {
static const double barWidth = 30;
// NB should be rounded to two decimals in server
// NB should be allocated values dynamically
// Bar items show data for 10 previous days
static const barData = <int, List<double>>{
0: [1.5, 4, 2.5],
1: [1.8, 5.6, 3],
2: [1.5, 3.1, 3.5],
3: [1.5, 1.5, 4],
4: [2, 2, 5],
5: [1.2, 1.5, 4.3],
6: [1.2, 4.8, 5],
};
int touchedIndex = -1;
@override
void initState() {
super.initState();
}
BarChartGroupData generateGroup(
int x,
double value1,
double value2,
double value3,
) {
final sum = value1 + value2 + value3;
final isTouched = touchedIndex == x;
return BarChartGroupData(
x: x,
showingTooltipIndicators: isTouched ? [0] : [],
barRods: [
BarChartRodData(
y: sum,
width: barWidth,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
rodStackItems: [
BarChartRodStackItem(
0,
value1,
const Color(0xFF13dbff),
),
BarChartRodStackItem(
value1,
value1 + value2,
const Color(0xFF000085),
),
BarChartRodStackItem(
value1 + value2,
value1 + value2 + value3,
Colors.white60,
),
],
),
],
);
}
// _buildLegendItem renders a colored circle and text to form a legend
Widget _buildLegendItem(Color color, String text) {
return Row(
children: [
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
),
),
const SizedBox(width: 8),
Text(
text,
style: const TextStyle(
fontSize: 14,
color: Colors.white,
),
),
],
);
}
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(
width: MediaQuery.of(context).size.width, // Set the desired width
child: BarChart(
BarChartData(
alignment: BarChartAlignment.center,
maxY: 12,
minY: 0,
titlesData: FlTitlesData(
show: true,
bottomTitles: SideTitles(
showTitles: true,
reservedSize: 5,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
reservedSize: 30,
interval: 2,
),
rightTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
reservedSize: 30,
interval: 2,
),
),
groupsSpace: 14,
gridData: FlGridData(
show: true,
),
borderData: FlBorderData(
show: false,
),
barGroups: barData.entries
.map(
(e) => generateGroup(
e.key,
e.value[0],
e.value[1],
e.value[2],
),
).toList(),
),
),
),
Padding( // Legend items
padding: const EdgeInsets.only(top: 20),
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildLegendItem(Colors.white60, "Snow"),
_buildLegendItem(const Color(0xFF000085), "Black ice"),
_buildLegendItem(const Color(0xFF13dbff), "Slush ice"),
],
),
),
),
],
);
}
}
\ No newline at end of file
...@@ -208,7 +208,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -208,7 +208,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
lastUpdate?.month == DateTime.now().month && lastUpdate?.month == DateTime.now().month &&
lastUpdate?.year == DateTime.now().year ? lastUpdate?.year == DateTime.now().year ?
'${lastUpdate?.hour}:${lastUpdate?.minute}' : '${lastUpdate?.hour}:${lastUpdate?.minute}' :
'${lastUpdate?.day}-${lastUpdate?.month}-${lastUpdate?.year}') : ''}', '${lastUpdate?.day}.${formatMonth(lastUpdate!.month)} ${lastUpdate?.year}') : ''}',
style: GoogleFonts.dmSans( style: GoogleFonts.dmSans(
fontSize: 14, fontSize: 14,
color: Colors.white60, color: Colors.white60,
...@@ -217,49 +217,85 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -217,49 +217,85 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
], ],
), ),
const SizedBox(height: contPadding), // Padding between containers const SizedBox(height: contPadding), // Padding between containers
ClipRRect( Column(
borderRadius: BorderRadius.circular(20), crossAxisAlignment: CrossAxisAlignment.start,
child: SizedBox( children: [
width: screenWidth * boxWidth, SizedBox(
height: screenWidth * boxHeight * 1.5, // NB: make dynamic width: screenWidth * boxWidth,
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(top: 20, left: 30), // Updated padding
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ice stats',
style: titleStyle,
),
const Divider(),
const SizedBox(height: 10), // Reduced padding
Text(
'Measured at ',
style: subHeadingStyle,
),
Text(
'Date: ${(selectedTile?.timeMeasured.day ?? '-')}/${(selectedTile?.timeMeasured.month ?? '-')}/${(selectedTile?.timeMeasured.year ?? '-')}',
style: regTextStyle,
),
Text(
'Time: ${selectedTile?.timeMeasured.hour}:00',
style: regTextStyle,
),
],
),
),
),
),
const SizedBox(height: contPadding*2),
SizedBox(
width: screenWidth * boxWidth * 1.2,
child: Center(
child: Text(
'Measuring point: (${selectedTile?.measurementID}, ${selectedTile?.measurementID})',
style: regTextStyle,
),
),
),
SizedBox(
width: screenWidth * boxWidth * 1.2,
child: const StatCharts(),
),
const SizedBox(height: contPadding*2),
SizedBox(
width: screenWidth * boxWidth * 1.2,
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 20, left: 20), // Edge padding, text padding: const EdgeInsets.only(top: 20, left: 30),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
'Ice stats', children: [
style: titleStyle, const Icon(
), Icons.info,
const Divider(), color: Colors.white54,
const Padding(padding: EdgeInsets.all(10)), ),
Text( const SizedBox(width: 10),
'Measured at ', Expanded(
style: subHeadingStyle, child: Text(
), 'For every x of y, there has to be z cm of '
Text( 'q for every kg of applied weight to ensure ?',
'Date: ${(selectedTile?.timeMeasured.day ?? '-')}/${(selectedTile?.timeMeasured.month ?? '-')}/${(selectedTile?.timeMeasured.year ?? '-')}', style: regTextStyle,
style: regTextStyle, ),
), ),
Text( ],
'Time: ${selectedTile?.timeMeasured.hour}:00',
style: regTextStyle,
), ),
const SizedBox(height: contPadding),
Text(
'Measuring point: (${selectedTile?.measurementID}, ${selectedTile?.measurementID})',
style: regTextStyle,
),
const SizedBox(height: contPadding),
const SizedBox(height: 15),
const StatCharts(),
], ],
), ),
), ),
), ),
), const SizedBox(height: contPadding*2),
],
), ),
], ],
); );
...@@ -267,3 +303,34 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -267,3 +303,34 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
); );
} }
} }
String formatMonth(int month) {
switch (month) {
case 1:
return 'Jan';
case 2:
return 'Feb';
case 3:
return 'Mar';
case 4:
return 'Apr';
case 5:
return 'May';
case 6:
return 'Jun';
case 7:
return 'Jul';
case 8:
return 'Aug';
case 9:
return 'Sep';
case 10:
return 'Oct';
case 11:
return 'Nov';
case 12:
return 'Dec';
default:
return '';
}
}
\ No newline at end of file
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'bar_graph/bar_data.dart';
class StatCharts extends StatelessWidget { class StatCharts extends StatelessWidget {
const StatCharts({Key? key}) : super(key: key); const StatCharts({Key? key}) : super(key: key);
...@@ -63,84 +64,19 @@ class StatCharts extends StatelessWidget { ...@@ -63,84 +64,19 @@ class StatCharts extends StatelessWidget {
); );
} }
Widget buildBarChart(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(right: 20),
child: BarChart(
BarChartData(
alignment: BarChartAlignment.spaceAround,
maxY: 20,
barTouchData: BarTouchData(enabled: false),
backgroundColor: Colors.grey.shade800,
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
getTitles: (value) {
switch (value.toInt()) {
case 0:
return 'Value';
case 1:
return 'Value';
case 2:
return 'Value';
default:
return '';
}
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
reservedSize: 30,
interval: 5,
),
),
borderData: FlBorderData(
show: true,
border: Border.all(color: Colors.white60, width: 1),
),
barGroups: [
BarChartGroupData(
x: 0,
barRods: [
BarChartRodData(y: 15, width: 10),
],
),
BarChartGroupData(
x: 1,
barRods: [
BarChartRodData(y: 10, width: 10),
],
),
BarChartGroupData(
x: 2,
barRods: [
BarChartRodData(y: 18, width: 10),
],
),
],
),
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
SizedBox( /*SizedBox(
width: MediaQuery.of(context).size.width * 0.8, // Set the width of the LineChart width: MediaQuery.of(context).size.width * 0.8, // Set the width of the LineChart
height: 200, height: 200,
child: buildLineChart(context), child: buildLineChart(context),
), ),*/
const SizedBox(height: 20), const SizedBox(height: 20),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width,
height: 160, child: const BarData(),
child: buildBarChart(context),
), ),
], ],
); );
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import connectivity_plus
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
} }
# Generated by pub # Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.2"
async: async:
dependency: transitive dependency: transitive
description: description:
...@@ -41,6 +49,22 @@ packages: ...@@ -41,6 +49,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.18.0" version: "1.18.0"
connectivity_plus:
dependency: "direct main"
description:
name: connectivity_plus
sha256: b74247fad72c171381dbe700ca17da24deac637ab6d43c343b42867acb95c991
url: "https://pub.dev"
source: hosted
version: "3.0.6"
connectivity_plus_platform_interface:
dependency: transitive
description:
name: connectivity_plus_platform_interface
sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a
url: "https://pub.dev"
source: hosted
version: "1.2.4"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
...@@ -49,6 +73,14 @@ packages: ...@@ -49,6 +73,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.3" version: "3.0.3"
dbus:
dependency: transitive
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
equatable: equatable:
dependency: transitive dependency: transitive
description: description:
...@@ -128,6 +160,14 @@ packages: ...@@ -128,6 +160,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.1" version: "0.5.1"
get:
dependency: "direct main"
description:
name: get
sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e
url: "https://pub.dev"
source: hosted
version: "4.6.6"
google_fonts: google_fonts:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -160,6 +200,14 @@ packages: ...@@ -160,6 +200,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.19.0"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
latlong2: latlong2:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -248,6 +296,14 @@ packages: ...@@ -248,6 +296,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
nm:
dependency: transitive
description:
name: nm
sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
path: path:
dependency: transitive dependency: transitive
description: description:
...@@ -328,6 +384,14 @@ packages: ...@@ -328,6 +384,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.1" version: "1.11.1"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.dev"
source: hosted
version: "6.0.2"
platform: platform:
dependency: transitive dependency: transitive
description: description:
...@@ -573,6 +637,14 @@ packages: ...@@ -573,6 +637,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
xml:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.dev"
source: hosted
version: "6.5.0"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0" flutter: ">=3.19.0"
...@@ -9,9 +9,9 @@ environment: ...@@ -9,9 +9,9 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_map: ^4.0.0 # Various maps flutter_map: ^4.0.0 # Maps ans map customization
http: ^0.13.3 # HTTPS requests http: ^0.13.3 # HTTPS requests
latlong2: ^0.8.2 latlong2: ^0.8.2 # LatLng object
provider: ^5.0.0 provider: ^5.0.0
fl_chart: ^0.20.0-nullsafety1 # Charts and diagrams fl_chart: ^0.20.0-nullsafety1 # Charts and diagrams
google_fonts: any # Fonts google_fonts: any # Fonts
...@@ -20,6 +20,8 @@ dependencies: ...@@ -20,6 +20,8 @@ dependencies:
path_provider: ^2.0.8 path_provider: ^2.0.8
shared_preferences: any # Persistent data storage shared_preferences: any # Persistent data storage
fuzzy: any # Search algorithm fuzzy: any # Search algorithm
connectivity_plus: ^3.0.3 # Check internet connection
get: ^4.6.5
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST
......
...@@ -13,6 +13,7 @@ import sqlite3 ...@@ -13,6 +13,7 @@ import sqlite3
app = Flask(__name__) app = Flask(__name__)
terminate_server = 0 terminate_server = 0
class IceHTTPServer(HTTPServer): class IceHTTPServer(HTTPServer):
def __init__(self, server_address, handler_class, cursor): def __init__(self, server_address, handler_class, cursor):
super().__init__(server_address, handler_class) super().__init__(server_address, handler_class)
...@@ -65,7 +66,8 @@ class IceHTTP(BaseHTTPRequestHandler): ...@@ -65,7 +66,8 @@ class IceHTTP(BaseHTTPRequestHandler):
def do_POST(self): def do_POST(self):
if self.path == '/new_lidar_data': if self.path == '/new_lidar_data':
input_new_Lidar_data(self,self.cursor, 1, 'Mjosa') # hardcoded body of water must change later input_new_Lidar_data(self, self.cursor, 1, 'Mjosa') # hardcoded body of water must change later
# Start a server on port 8443 using self defined HTTP class # Start a server on port 8443 using self defined HTTP class
if __name__ == "__main__": if __name__ == "__main__":
......
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