diff --git a/.gitea/workflows/frontend_build-android.yaml b/.gitea/workflows/frontend_build-android.yaml index a035322..a1e2d7e 100644 --- a/.gitea/workflows/frontend_build-android.yaml +++ b/.gitea/workflows/frontend_build-android.yaml @@ -16,20 +16,24 @@ jobs: - name: Install prerequisites run: | - sudo apt-get update - sudo apt-get install -y xz-utils unzip + apt-get update + apt-get install -y jq - uses: https://gitea.com/actions/checkout@v4 + - uses: https://github.com/actions/setup-java@v4 with: java-version: '17' distribution: 'zulu' + - name: Fix flutter SDK folder permission + run: git config --global --add safe.directory "*" + - uses: https://github.com/subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.19.6 + flutter-version: 3.22.0 cache: true - name: Setup Android SDK @@ -38,13 +42,13 @@ jobs: - run: flutter pub get working-directory: ./frontend - - run: flutter build apk --debug --split-per-abi + - run: flutter build apk --release --split-per-abi working-directory: ./frontend - name: Release APK uses: https://gitea.com/akkuman/gitea-release-action@v1 with: - files: ./frontendbuild/app/outputs/flutter-apk/*.apk + files: ./frontend/build/app/outputs/flutter-apk/*.apk name: Testing release release_name: testing tag: testing diff --git a/deployment/kustomization.yaml b/deployment/kustomization.yaml new file mode 100644 index 0000000..e69de29 diff --git a/frontend/android/app/build.gradle b/frontend/android/app/build.gradle index 21a5169..f6b499e 100644 --- a/frontend/android/app/build.gradle +++ b/frontend/android/app/build.gradle @@ -45,6 +45,9 @@ android { applicationId "com.example.fast_network_navigation" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + // Minimum Android version for Google Maps SDK + // https://developers.google.com/maps/flutter-package/config#android + minSdk = 21 minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/frontend/android/app/src/main/AndroidManifest.xml b/frontend/android/app/src/main/AndroidManifest.xml index fc057fe..f144d58 100644 --- a/frontend/android/app/src/main/AndroidManifest.xml +++ b/frontend/android/app/src/main/AndroidManifest.xml @@ -28,7 +28,14 @@ This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> + android:value="2" + /> + + + + diff --git a/frontend/lib/modules/scaffold.dart b/frontend/lib/layout.dart similarity index 92% rename from frontend/lib/modules/scaffold.dart rename to frontend/lib/layout.dart index 34c603c..875ccbc 100644 --- a/frontend/lib/modules/scaffold.dart +++ b/frontend/lib/layout.dart @@ -4,9 +4,10 @@ import 'package:fast_network_navigation/modules/overview.dart'; import 'package:fast_network_navigation/modules/profile.dart'; +// BasePage is the scaffold that holds all other pages +// A side drawer is used to switch between pages class BasePage extends StatefulWidget { const BasePage({super.key, required this.title}); - final String title; @override @@ -22,7 +23,7 @@ class _BasePageState extends State { }); } - Widget currentView = MapPage(); + Widget currentView = NavigationOverview(); @override Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); @@ -51,7 +52,7 @@ class _BasePageState extends State { // Update the state of the app _onItemTapped(0); // Then close the drawer - currentView = MapPage(); + currentView = NavigationOverview(); Navigator.pop(context); }, ), @@ -87,3 +88,4 @@ class _BasePageState extends State { ); } } + diff --git a/frontend/lib/main.dart b/frontend/lib/main.dart index 424c0d5..d818628 100644 --- a/frontend/lib/main.dart +++ b/frontend/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:fast_network_navigation/modules/scaffold.dart'; +import 'package:fast_network_navigation/layout.dart'; void main() => runApp(const App()); diff --git a/frontend/lib/modules/map.dart b/frontend/lib/modules/map.dart new file mode 100644 index 0000000..9f7a22d --- /dev/null +++ b/frontend/lib/modules/map.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; + +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class MapWidget extends StatefulWidget { + @override + State createState() => _MapWidgetState(); +} + +class _MapWidgetState extends State { + late GoogleMapController mapController; + + final LatLng _center = const LatLng(45.521563, -122.677433); + + void _onMapCreated(GoogleMapController controller) { + mapController = controller; + } + void _onCameraIdle() { + // print(mapController.getLatLng()); + } + + @override + Widget build(BuildContext context) { + return GoogleMap( + onMapCreated: _onMapCreated, + initialCameraPosition: CameraPosition( + target: _center, + zoom: 11.0, + ), + onCameraIdle: _onCameraIdle, + ); + } +} + + + + // GeoCode geoCode = GeoCode(); + // String _currentCityName = "..."; + // final Debounce _debounce = Debounce(Duration(seconds: 3)); + + // final LatLng _center = const LatLng(45.521563, -122.677433); + // late GoogleMapController mapController; + + // void _onMapCreated(GoogleMapController controller) { + // mapController = controller; + // } + + // // void _setCurrentCityName() async { + // if (mapController.camera.zoom < 9) { + // return; // Don't bother if the view is too wide + // } + // var currentCoordinates = mapController.camera.center; + // String? city; + + // try{ + // List placemarks = await placemarkFromCoordinates(currentCoordinates.latitude, currentCoordinates.longitude); + // city = placemarks[0].locality.toString(); + // } catch (e) { + // debugPrint("Error: $e"); + // try { + // Address address = await geoCode.reverseGeocoding(latitude: currentCoordinates.latitude, longitude: currentCoordinates.longitude); + + // if (address.city == null || address.city.toString().contains("Throttled!")){ + // throw Exception("Probably rate limited"); + // } + // city = address.city.toString(); + // } catch (e) { + // debugPrint("Error: $e"); + + // } + // } + // if (city != null) { + // setState(() { + // _currentCityName = city!; + // }); + // } else { + // _debounce(() async {_setCurrentCityName();}); + // } + // } + + \ No newline at end of file diff --git a/frontend/lib/modules/overview.dart b/frontend/lib/modules/overview.dart index ff03b9b..bfcf18f 100644 --- a/frontend/lib/modules/overview.dart +++ b/frontend/lib/modules/overview.dart @@ -1,17 +1,21 @@ import 'package:flutter/material.dart'; -import 'package:flutter_map/flutter_map.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; -import 'package:latlong2/latlong.dart'; -import 'package:geocoding/geocoding.dart'; import 'package:geocode/geocode.dart'; import 'dart:async'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:fast_network_navigation/modules/navigation.dart'; +import 'package:fast_network_navigation/modules/map.dart'; -class MapPage extends StatefulWidget { + + +class NavigationOverview extends StatefulWidget { @override - _MapPageState createState() => _MapPageState(); + State createState() => _NavigationOverviewState(); } + + + class Debounce { Duration delay; Timer? _timer; @@ -31,44 +35,7 @@ class Debounce { } -class _MapPageState extends State { - GeoCode geoCode = GeoCode(); - final mapController = MapController(); - String _currentCityName = "..."; - final Debounce _debounce = Debounce(Duration(seconds: 3)); - - void _setCurrentCityName() async { - if (mapController.camera.zoom < 9) { - return; // Don't bother if the view is too wide - } - var currentCoordinates = mapController.camera.center; - String? city; - - try{ - List placemarks = await placemarkFromCoordinates(currentCoordinates.latitude, currentCoordinates.longitude); - city = placemarks[0].locality.toString(); - } catch (e) { - debugPrint("Error: $e"); - try { - Address address = await geoCode.reverseGeocoding(latitude: currentCoordinates.latitude, longitude: currentCoordinates.longitude); - - if (address.city == null || address.city.toString().contains("Throttled!")){ - throw Exception("Probably rate limited"); - } - city = address.city.toString(); - } catch (e) { - debugPrint("Error: $e"); - - } - } - if (city != null) { - setState(() { - _currentCityName = city!; - }); - } else { - _debounce(() async {_setCurrentCityName();}); - } - } +class _NavigationOverviewState extends State { @override Widget build(BuildContext context) { @@ -77,21 +44,7 @@ class _MapPageState extends State { renderPanelSheet: false, panel: _floatingPanel(theme), collapsed: _floatingCollapsed(theme), - body: FlutterMap( - mapController: mapController, - options: MapOptions( - initialZoom: 11, - initialCenter: LatLng(51.509364, -0.128928), - onMapReady: () { - mapController.mapEventStream.listen((evt) {_debounce(() async {_setCurrentCityName();});}); - // And any other `MapController` dependent non-movement methods - }, - - ), - children: [ - openStreetMapTileLayer, - ], - ), + body: MapWidget() ); } @@ -138,16 +91,9 @@ class _MapPageState extends State { Widget Greeting (ThemeData theme) { return Center( child: Text( - "Explore ${_currentCityName}", + "Explore #todo", style: TextStyle(color: theme.primaryColor, fontSize: 24.0, fontWeight: FontWeight.bold), ), ); } } - -TileLayer get openStreetMapTileLayer => TileLayer( - urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', - userAgentPackageName: 'flutter_map', -); - -// Add a pin to the map diff --git a/frontend/lib/modules/profile.dart b/frontend/lib/modules/profile.dart index 69bfba4..e8beb08 100644 --- a/frontend/lib/modules/profile.dart +++ b/frontend/lib/modules/profile.dart @@ -1,3 +1,4 @@ +import 'package:fast_network_navigation/structs/preferences.dart'; import 'package:flutter/material.dart'; @@ -8,48 +9,83 @@ class ProfilePage extends StatefulWidget { } class _ProfilePageState extends State { - - double value = 0.0; - void onChanged(double newValue) { - setState(() { - value = newValue; - }); - } @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Profile'), - ), - body: Padding( - padding: EdgeInsets.all(8.0), - child: Column( - children: [ - Card( - child: ListTile( - leading: Icon(Icons.notifications_sharp), - title: Text('Notification 1'), - subtitle: Text('This is a first notification'), - ), - ), - Card( - child: ListTile( - leading: Icon(Icons.notifications_sharp), - title: Text('Notification 2'), - subtitle: Text('This is a notification'), - ), - ), - Card( - child: ListTile( - leading: Icon(Icons.outdoor_grill), - title: Text("Eating preference"), - subtitle: Slider.adaptive(value: value, onChanged: onChanged, min: 0, max: 5, divisions: 5, label: value.toInt().toString(),) - - ) - ) - ], + return ListView( + children: [ + // First a round, centered image + Center( + child: CircleAvatar( + radius: 100, + child: Icon(Icons.person, size: 100), + ) ), - ) + Center( + child: Text('Curious traveler', style: TextStyle(fontSize: 24)) + ), + + Padding( + padding: EdgeInsets.all(10), + ), + + Text('Please rate your preferences for the following activities:'), + + // Now the sliders + ImportanceSliders() + ] ); } } + + + +class ImportanceSliders extends StatefulWidget { + + @override + State createState() => _ImportanceSlidersState(); +} + + +class _ImportanceSlidersState extends State { + + UserPreferences _prefs = UserPreferences(); + + @override + void initState() { + super.initState(); + _prefs.load(); + } + + List _createSliders() { + List sliders = []; + for (SinglePreference pref in _prefs.preferences) { + sliders.add(Card( + child: ListTile( + leading: pref.icon, + title: Text(pref.name), + subtitle: Slider( + value: pref.value.toDouble(), + min: 0, + max: 10, + divisions: 10, + label: pref.value.toString(), + onChanged: (double newValue) { + setState(() { + pref.value = newValue.toInt(); + _prefs.save(); + }); + }, + ) + ), + margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 0), + shadowColor: Colors.grey, + )); + } + return sliders; + } + + @override + Widget build(BuildContext context) { + return Column(children: _createSliders()); + } +} diff --git a/frontend/lib/structs/destination.dart b/frontend/lib/structs/destination.dart index bb8d086..c44fbf9 100644 --- a/frontend/lib/structs/destination.dart +++ b/frontend/lib/structs/destination.dart @@ -1,31 +1,62 @@ +import "package:flutter/material.dart"; class Destination { final double latitude; final double longitude; final String name; final String description; - final DestinationType type; + // final DestinationType type; final Duration duration; final bool visited; - Destination({ + const Destination({ required this.latitude, required this.longitude, required this.name, required this.description, - required this.type, + // required this.type, required this.duration, required this.visited, }); + + factory Destination.fromJson(Map json) { + return switch (json) { + { + 'lat': double latitude, + 'lon': double longitude, + 'name': String name, + 'description': String description, + // 'type': String type, + 'duration': int duration, + 'visited': bool visited + + } => + Destination( + latitude: latitude, + longitude: longitude, + name: name, + description: description, + // type: "DestinationType.values.firstWhere((element) => element.name == type)", + duration: Duration(minutes: duration), + visited: visited + ), + _ => throw const FormatException('Failed to load destination.'), + }; +} + } class DestinationType { final String name; final String description; + final Icon icon; - DestinationType({ + const DestinationType({ required this.name, required this.description, + required this.icon, }); } + + diff --git a/frontend/lib/structs/preferences.dart b/frontend/lib/structs/preferences.dart new file mode 100644 index 0000000..7746393 --- /dev/null +++ b/frontend/lib/structs/preferences.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + + +class SinglePreference { + String name; + String description; + int value; + Icon icon; + String key; + + SinglePreference({ + required this.name, + required this.description, + required this.value, + required this.icon, + required this.key, + }); +} + + +class UserPreferences { + List preferences = [ + SinglePreference( + name: "Sightseeing", + description: "How much do you like sightseeing?", + value: 0, + icon: Icon(Icons.church), + key: "sightseeing", + ), + SinglePreference( + name: "Shopping", + description: "How much do you like shopping?", + value: 0, + icon: Icon(Icons.shopping_bag), + key: "shopping", + ), + SinglePreference( + name: "Foods & Drinks", + description: "How much do you like eating?", + value: 0, + icon: Icon(Icons.restaurant), + key: "eating", + ), + SinglePreference( + name: "Nightlife", + description: "How much do you like nightlife?", + value: 0, + icon: Icon(Icons.wine_bar), + key: "nightlife", + ), + SinglePreference( + name: "Nature", + description: "How much do you like nature?", + value: 0, + icon: Icon(Icons.landscape), + key: "nature", + ), + SinglePreference( + name: "Culture", + description: "How much do you like culture?", + value: 0, + icon: Icon(Icons.palette), + key: "culture", + ), + ]; + + + void save() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + for (SinglePreference pref in preferences) { + prefs.setInt(pref.key, pref.value); + } + } + + void load() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + for (SinglePreference pref in preferences) { + pref.value = prefs.getInt(pref.key) ?? 0; + } + } +} \ No newline at end of file diff --git a/frontend/lib/structs/route.dart b/frontend/lib/structs/route.dart new file mode 100644 index 0000000..8b46787 --- /dev/null +++ b/frontend/lib/structs/route.dart @@ -0,0 +1,14 @@ +import "package:fast_network_navigation/structs/destination.dart"; + + +class Route { + final String name; + final Duration duration; + final List destinations; + + Route({ + required this.name, + required this.duration, + required this.destinations + }); +} \ No newline at end of file diff --git a/frontend/lib/utils/get_route.dart b/frontend/lib/utils/get_route.dart new file mode 100644 index 0000000..fccf6ac --- /dev/null +++ b/frontend/lib/utils/get_route.dart @@ -0,0 +1,18 @@ +import "package:fast_network_navigation/structs/destination.dart"; +import 'package:http/http.dart' as http; +import 'dart:convert'; + +Future fetchDestination() async { + final response = await http + .get(Uri.parse('https://nav.kluster.moll.re/v1/destination/1')); + + if (response.statusCode == 200) { + // If the server did return a 200 OK response, + // then parse the JSON. + return Destination.fromJson(jsonDecode(response.body) as Map); + } else { + // If the server did not return a 200 OK response, + // then throw an exception. + throw Exception('Failed to load destination'); + } +} \ No newline at end of file diff --git a/frontend/macos/Flutter/GeneratedPluginRegistrant.swift b/frontend/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..724bb2a 100644 --- a/frontend/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/frontend/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock index b88a8ef..7c2f396 100644 --- a/frontend/pubspec.lock +++ b/frontend/pubspec.lock @@ -41,6 +41,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" cupertino_icons: dependency: "direct main" description: @@ -57,6 +65,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -66,23 +90,28 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" url: "https://pub.dev" source: hosted - version: "3.0.2" - flutter_map: - dependency: "direct main" + version: "4.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive description: - name: flutter_map - sha256: cda8d72135b697f519287258b5294a57ce2f2a5ebf234f0e406aad4dc14c9399 + name: flutter_plugin_android_lifecycle + sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "2.0.19" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" geocode: dependency: "direct main" description: @@ -123,8 +152,64 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" - http: + google_maps: dependency: transitive + description: + name: google_maps + sha256: "47eef3836b49bb030d5cb3afc60b8451408bf34cf753e571b645d6529eb4251a" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + google_maps_flutter: + dependency: "direct main" + description: + name: google_maps_flutter + sha256: c1972cbad779bc5346c49045f26ae45550a0958b1cbca5b524dd3c8954995d28 + url: "https://pub.dev" + source: hosted + version: "2.6.1" + google_maps_flutter_android: + dependency: transitive + description: + name: google_maps_flutter_android + sha256: "0bcadb80eba39afda77dede89a6caafd3b68f2786b90491eceea4a01c3db181c" + url: "https://pub.dev" + source: hosted + version: "2.8.0" + google_maps_flutter_ios: + dependency: transitive + description: + name: google_maps_flutter_ios + sha256: e5132d17f051600d90d79d9f574b177c24231da702453a036db2490f9ced4646 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + google_maps_flutter_platform_interface: + dependency: transitive + description: + name: google_maps_flutter_platform_interface + sha256: "167af879da4d004cd58771f1469b91dcc3b9b0a2c5334cc6bf71fd41d4b35403" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + google_maps_flutter_web: + dependency: transitive + description: + name: google_maps_flutter_web + sha256: "0c0d5c723d94b295cf86dd1c45ff91d2ac1fff7c05ddca4f01bef9fa0a014690" + url: "https://pub.dev" + source: hosted + version: "0.5.7" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: "direct main" description: name: http sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" @@ -139,22 +224,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - intl: + js: dependency: transitive description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.19.0" - latlong2: - dependency: "direct main" + version: "0.6.7" + js_wrapping: + dependency: transitive description: - name: latlong2 - sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c url: "https://pub.dev" source: hosted - version: "0.9.1" + version: "0.7.4" leak_tracker: dependency: transitive description: @@ -183,26 +268,10 @@ packages: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" url: "https://pub.dev" source: hosted - version: "3.0.0" - lists: - dependency: transitive - description: - name: lists - sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - logger: - dependency: transitive - description: - name: logger - sha256: "8c94b8c219e7e50194efc8771cd0e9f10807d8d3e219af473d89b06cc2ee4e04" - url: "https://pub.dev" - source: hosted - version: "2.2.0" + version: "4.0.0" matcher: dependency: transitive description: @@ -227,14 +296,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.12.0" - mgrs_dart: - dependency: transitive - description: - name: mgrs_dart - sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 - url: "https://pub.dev" - source: hosted - version: "2.0.0" path: dependency: transitive description: @@ -243,6 +304,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + platform: + dependency: transitive + description: + name: platform + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + url: "https://pub.dev" + source: hosted + version: "3.1.4" plugin_platform_interface: dependency: transitive description: @@ -251,22 +344,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - polylabel: + sanitize_html: dependency: transitive description: - name: polylabel - sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - proj4dart: - dependency: transitive - description: - name: proj4dart - sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + name: sanitize_html + sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989" url: "https://pub.dev" source: hosted version: "2.1.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + url: "https://pub.dev" + source: hosted + version: "2.2.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + url: "https://pub.dev" + source: hosted + version: "2.3.0" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" + source: hosted + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -304,6 +445,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -336,14 +485,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - unicode: - dependency: transitive - description: - name: unicode - sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" - url: "https://pub.dev" - source: hosted - version: "0.3.1" vector_math: dependency: transitive description: @@ -368,14 +509,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" - wkt_parser: + win32: dependency: transitive description: - name: wkt_parser - sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + name: win32 + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "5.5.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" sdks: - dart: ">=3.3.4 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 53add6b..9f1732c 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -35,11 +35,12 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 - flutter_map: ^6.1.0 sliding_up_panel: ^2.0.0+1 - latlong2: ^0.9.1 geocoding: ^3.0.0 geocode: ^1.0.3 + google_maps_flutter: ^2.6.1 + http: ^1.2.1 + shared_preferences: ^2.2.3 dev_dependencies: flutter_test: @@ -50,7 +51,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 + flutter_lints: ^4.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/frontend/test/widget_test.dart b/frontend/test/widget_test.dart index 1eacbc4..143b24f 100644 --- a/frontend/test/widget_test.dart +++ b/frontend/test/widget_test.dart @@ -9,16 +9,15 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // import 'package:fast_network_navigation/main.dart'; -import 'package:fast_network_navigation/modules/scaffold.dart'; +import 'package:fast_network_navigation/layout.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(BasePage(title: "City Nav")); - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); + // Verfiy that the title is displayed + expect(find.text('City Nav'), findsOneWidget); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); diff --git a/frontend/web/index.html b/frontend/web/index.html index 30e08e2..5cbcc91 100644 --- a/frontend/web/index.html +++ b/frontend/web/index.html @@ -14,6 +14,7 @@ This is a placeholder for base href that will be replaced by the value of the `--base-href` argument provided to `flutter build`. --> +