From 3854cef54a062ca68308a1b74d4d4ea04e3bc590 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Fri, 17 May 2024 20:12:59 +0200 Subject: [PATCH 1/7] adding google maps baby! --- .gitea/workflows/frontend_build-android.yaml | 2 +- frontend/android/app/build.gradle | 3 + .../android/app/src/main/AndroidManifest.xml | 4 +- frontend/lib/modules/map.dart | 81 +++++++++++++ frontend/lib/modules/overview.dart | 78 ++---------- frontend/pubspec.lock | 111 +++++++++++++++++- frontend/pubspec.yaml | 1 + frontend/web/index.html | 1 + 8 files changed, 212 insertions(+), 69 deletions(-) create mode 100644 frontend/lib/modules/map.dart diff --git a/.gitea/workflows/frontend_build-android.yaml b/.gitea/workflows/frontend_build-android.yaml index de430ce..02bf3bf 100644 --- a/.gitea/workflows/frontend_build-android.yaml +++ b/.gitea/workflows/frontend_build-android.yaml @@ -35,7 +35,7 @@ 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 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..54f939a 100644 --- a/frontend/android/app/src/main/AndroidManifest.xml +++ b/frontend/android/app/src/main/AndroidManifest.xml @@ -28,7 +28,9 @@ This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> + android:value="2" + android:name="com.google.android.geo.API_KEY" + android:value="AIzaSyCeWk_D2xvfOHLidvV56EZeQCUybypEntw"/> /> + From 66fc4e7d33712e6b202ea933e381f3efb501792c Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sat, 18 May 2024 10:56:04 +0200 Subject: [PATCH 2/7] update deps --- frontend/pubspec.lock | 88 ++----------------------------------------- frontend/pubspec.yaml | 4 +- 2 files changed, 5 insertions(+), 87 deletions(-) diff --git a/frontend/pubspec.lock b/frontend/pubspec.lock index f72974c..21fb46f 100644 --- a/frontend/pubspec.lock +++ b/frontend/pubspec.lock @@ -74,18 +74,10 @@ 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" - description: - name: flutter_map - sha256: cda8d72135b697f519287258b5294a57ce2f2a5ebf234f0e406aad4dc14c9399 - url: "https://pub.dev" - source: hosted - version: "6.1.0" + version: "4.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -216,14 +208,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - intl: - dependency: transitive - description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf - url: "https://pub.dev" - source: hosted - version: "0.19.0" js: dependency: transitive description: @@ -240,14 +224,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4" - latlong2: - dependency: "direct main" - description: - name: latlong2 - sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" - url: "https://pub.dev" - source: hosted - version: "0.9.1" leak_tracker: dependency: transitive description: @@ -276,26 +252,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: @@ -320,14 +280,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: @@ -344,22 +296,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - polylabel: - 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 - url: "https://pub.dev" - source: hosted - version: "2.1.0" sanitize_html: dependency: transitive description: @@ -445,14 +381,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: @@ -477,14 +405,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" - wkt_parser: - dependency: transitive - description: - name: wkt_parser - sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" - url: "https://pub.dev" - source: hosted - version: "2.0.0" sdks: dart: ">=3.3.4 <4.0.0" flutter: ">=3.19.0" diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 4c794d1..b0409b2 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -35,9 +35,7 @@ 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 @@ -51,7 +49,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 From f6e3cfc8a0482f3ad95a0f5d86b4f253f1c639fb Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Mon, 20 May 2024 12:09:33 +0200 Subject: [PATCH 3/7] build like this --- .gitea/workflows/frontend_build-android.yaml | 6 +++--- deployment/kustomization.yaml | 0 frontend/lib/modules/scaffold.dart | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 deployment/kustomization.yaml diff --git a/.gitea/workflows/frontend_build-android.yaml b/.gitea/workflows/frontend_build-android.yaml index 02bf3bf..b255196 100644 --- a/.gitea/workflows/frontend_build-android.yaml +++ b/.gitea/workflows/frontend_build-android.yaml @@ -8,13 +8,13 @@ name: Build and release APK jobs: build: name: Build APK - runs-on: k8s + runs-on: ubuntu-latest steps: - 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 diff --git a/deployment/kustomization.yaml b/deployment/kustomization.yaml new file mode 100644 index 0000000..e69de29 diff --git a/frontend/lib/modules/scaffold.dart b/frontend/lib/modules/scaffold.dart index 34c603c..822f208 100644 --- a/frontend/lib/modules/scaffold.dart +++ b/frontend/lib/modules/scaffold.dart @@ -22,7 +22,7 @@ class _BasePageState extends State { }); } - Widget currentView = MapPage(); + Widget currentView = MainPage(); @override Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); @@ -51,7 +51,7 @@ class _BasePageState extends State { // Update the state of the app _onItemTapped(0); // Then close the drawer - currentView = MapPage(); + currentView = MainPage(); Navigator.pop(context); }, ), From 6405f33a34ff28e9404dde72d0095d2b4477ef8f Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Mon, 20 May 2024 21:07:10 +0200 Subject: [PATCH 4/7] update flutter builder --- .gitea/workflows/frontend_build-android.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/frontend_build-android.yaml b/.gitea/workflows/frontend_build-android.yaml index b255196..e510298 100644 --- a/.gitea/workflows/frontend_build-android.yaml +++ b/.gitea/workflows/frontend_build-android.yaml @@ -18,15 +18,19 @@ jobs: - 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 From 3688229d7b159f07ee182c20af127a4a7c7ebf2c Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Mon, 20 May 2024 22:18:08 +0000 Subject: [PATCH 5/7] Update frontend/android/app/src/main/AndroidManifest.xml --- frontend/android/app/src/main/AndroidManifest.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/android/app/src/main/AndroidManifest.xml b/frontend/android/app/src/main/AndroidManifest.xml index 54f939a..58e6f22 100644 --- a/frontend/android/app/src/main/AndroidManifest.xml +++ b/frontend/android/app/src/main/AndroidManifest.xml @@ -29,8 +29,13 @@ + /> + android:value="AIzaSyCeWk_D2xvfOHLidvV56EZeQCUybypEntw" + /> + + + 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 822f208..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 = MainPage(); + 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 = MainPage(); + 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/overview.dart b/frontend/lib/modules/overview.dart index d9bc126..bfcf18f 100644 --- a/frontend/lib/modules/overview.dart +++ b/frontend/lib/modules/overview.dart @@ -9,9 +9,9 @@ import 'package:fast_network_navigation/modules/map.dart'; -class MainPage extends StatefulWidget { +class NavigationOverview extends StatefulWidget { @override - State createState() => _MainPageState(); + State createState() => _NavigationOverviewState(); } @@ -35,7 +35,7 @@ class Debounce { } -class _MainPageState extends State { +class _NavigationOverviewState extends State { @override Widget build(BuildContext context) { 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 21fb46f..7c2f396 100644 --- a/frontend/pubspec.lock +++ b/frontend/pubspec.lock @@ -65,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 @@ -193,7 +209,7 @@ packages: source: hosted version: "0.15.4" http: - dependency: transitive + dependency: "direct main" description: name: http sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" @@ -288,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: @@ -304,6 +352,62 @@ packages: 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 @@ -405,6 +509,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + win32: + dependency: transitive + description: + name: win32 + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + url: "https://pub.dev" + source: hosted + 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" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.19.0" diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index b0409b2..9f1732c 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -39,6 +39,8 @@ dependencies: 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: 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));