diff --git a/assets/fonts/NavikaIcons.ttf b/assets/fonts/NavikaIcons.ttf index 6ff9d206..75e5a0ea 100644 Binary files a/assets/fonts/NavikaIcons.ttf and b/assets/fonts/NavikaIcons.ttf differ diff --git a/l10n.yaml b/l10n.yaml index 35d81e9d..de68eb4e 100644 --- a/l10n.yaml +++ b/l10n.yaml @@ -1,3 +1,4 @@ arb-dir: lib/l10n template-arb-file: app_fr.arb -output-localization-file: app_localizations.dart \ No newline at end of file +output-localization-file: app_localizations.dart +untranslated-messages-file: out.txt \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index a9a11e58..ee3a595d 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -119,6 +119,7 @@ "saved_route": "Saved route, details are now available even offline.", "where_to_board": "Where to board?", "routes": "Routes", + "your_favorites": "Your favourites", "no_saved_routes": "No saved routes.", "go": "Go", "edit_route": "Edit route", @@ -158,6 +159,7 @@ "your_position": "Your position", "where_are_we_departing_from": "Where are we departing from?", "where_are_we_going": "Where are we going?", + "home_search": "Where are we going? Find an address, a station...", "undefined_address_or_label": "Undefined address or label", "home": "Home", "nearby": "Nearby", @@ -232,6 +234,8 @@ "new_departure_station": "New departure station", "exceptional_terminus": "Exceptional terminus", "exceptional_terminus_short": "Exceptional term.", + "modified_train": "Service modified", + "modified_train_short": "Modified", "timetable_sheet": "Timetable sheet", "today": "Today", "tomorrow": "Tomorrow", @@ -240,7 +244,6 @@ "search": "Search", "search_line": "Search for a line", "recent": "Recent", - "search_location_on_map": "Search for a location on the map", "server_not_responding": "Server not responding", "avoid_line": "Avoid a line?", "avoid": "Avoid", @@ -255,8 +258,8 @@ "traffic": "Traffic", "add_stop_to_favorites": "Add a stop to your favorites to access your timetables faster.", "favorite_deletion_error": "Error occurred while deleting the favorite.", - "line_details": "Line details", - "no_work_scheduled": "No work planned at this date", - "choose_display_mode": "Set your preferred display mode." + "no_work_planned": "No work planned at this date", + "choose_display_mode": "Set your preferred display mode.", + "added": "Added" } \ No newline at end of file diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index f64e31d6..ed99ee40 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -119,6 +119,7 @@ "saved_route": "Itinéraire enregistré, les détails sont désormais disponibles même hors connexion.", "where_to_board": "Où monter ?", "routes": "Itinéraires", + "your_favorites": "Vos favoris", "no_saved_routes": "Aucun itinéraire enregistré.", "go": "Y aller", "edit_route": "Modifier un trajet", @@ -159,6 +160,7 @@ "your_position": "Votre position", "where_are_we_departing_from": "D’où partons-nous ?", "where_are_we_going": "Où allons-nous ?", + "home_search": "Où allons-nous ? Rechercher une adresse, une station...", "undefined_address_or_label": "Adresse ou libellé non défini", "home": "Maison", "nearby": "À proximité", @@ -232,7 +234,7 @@ "new_departure_station": "Nouvelle gare de départ", "exceptional_terminus": "Terminus exceptionnel", "exceptional_terminus_short": "Terminus ex.", - "modified_train": "Désserte modifié", + "modified_train": "Desserte modifié", "modified_train_short": "Modifié", "timetable_sheet": "Fiche horaire", "today": "Aujourd’hui", @@ -242,7 +244,6 @@ "search": "Rechercher", "search_line": "Rechercher une ligne", "recent": "Récents", - "search_location_on_map": "Rechercher un lieu sur la carte", "server_not_responding": "Le serveur n’a pas répondu", "avoid_line": "Éviter une ligne ?", "avoid": "Éviter une ligne", @@ -257,10 +258,8 @@ "traffic": "Trafic", "add_stop_to_favorites": "Ajoutez un arrêt à vos favoris pour accéder à vos horaires plus rapidement.", "favorite_deletion_error": "Erreur lors de la suppression du favori.", - "line_details": "Détails de la ligne", "no_work_planned": "Aucun travaux prévu à cette date", "choose_display_mode": "Définissez le mode d’affichage que vous préférez.", - "added": "Supplémentaire" } \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 03f52afb..4986db62 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -275,7 +275,7 @@ Future _initializeFirebase() async { ); if (kDebugMode) { - print({'INFO_', 'User granted permission: ${settings.authorizationStatus}'}); + print(['INFO_', settings.authorizationStatus]); } FirebaseMessaging.onMessage.listen((RemoteMessage message) async { diff --git a/lib/src/api.dart b/lib/src/api.dart index b1438c46..95c2fad6 100644 --- a/lib/src/api.dart +++ b/lib/src/api.dart @@ -8,9 +8,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; // 📦 Package imports: +import 'package:geolocator/geolocator.dart'; import 'package:here_sdk/core.dart'; import 'package:http/http.dart' as http; -import 'package:geolocator/geolocator.dart'; // 🌎 Project imports: import 'package:navika/src/data/app.dart' as app; diff --git a/lib/src/app.dart b/lib/src/app.dart index 18019fc8..e2696612 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -1,5 +1,4 @@ // 🎯 Dart imports: -import 'dart:io'; import 'dart:math'; // 🐦 Flutter imports: @@ -160,9 +159,9 @@ class _NavikaAppState extends State { elevation: 0, margin: const EdgeInsets.all(0) , ), - appBarTheme: AppBarTheme( - surfaceTintColor: Platform.isIOS ? const Color(0xFFFFFFFF) : primaryContainer - ), + // appBarTheme: AppBarTheme( + // surfaceTintColor: Platform.isIOS ? const Color(0xFFFFFFFF) : primaryContainer + // ), tabBarTheme: const TabBarTheme( unselectedLabelColor: Color(0xff919191), ), diff --git a/lib/src/controller/here_map_controller.dart b/lib/src/controller/here_map_controller.dart index 077e0fbb..61e17bc5 100644 --- a/lib/src/controller/here_map_controller.dart +++ b/lib/src/controller/here_map_controller.dart @@ -3,9 +3,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; // 📦 Package imports: +import 'package:geolocator/geolocator.dart'; import 'package:here_sdk/core.dart'; import 'package:here_sdk/mapview.dart'; -import 'package:geolocator/geolocator.dart'; // 🌎 Project imports: import 'package:navika/src/data/global.dart' as globals; @@ -52,8 +52,8 @@ class HereController { if (zoomAuto) { double distanceToEarthInMeters = 1000; - if (position.accuracy! > 0) { - distanceToEarthInMeters = (position.accuracy! * 2) + 1000; + if (position.accuracy > 0) { + distanceToEarthInMeters = (position.accuracy * 2) + 1000; } MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters); _hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(position.latitude ?? 0, position.longitude ?? 0), mapMeasureZoom); diff --git a/lib/src/data/global.dart b/lib/src/data/global.dart index ae843d3a..07974bbd 100644 --- a/lib/src/data/global.dart +++ b/lib/src/data/global.dart @@ -6,8 +6,8 @@ library my_prj.globals; import 'package:flutter/material.dart'; // 📦 Package imports: -import 'package:here_sdk/mapview.dart'; import 'package:geolocator/geolocator.dart'; +import 'package:here_sdk/mapview.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; // 🌎 Project imports: diff --git a/lib/src/data/lines.dart b/lib/src/data/lines.dart index 5fc666c1..16a54ecb 100644 --- a/lib/src/data/lines.dart +++ b/lib/src/data/lines.dart @@ -2,8 +2,8 @@ class LinesInfo { List lines = []; - void setLines(List _lines) { - lines = _lines; + void setLines(List list) { + lines = list; } void reset(){ diff --git a/lib/src/icons/config.json b/lib/src/icons/config.json index 6f458c74..deda97c0 100644 --- a/lib/src/icons/config.json +++ b/lib/src/icons/config.json @@ -1020,20 +1020,6 @@ "navi" ] }, - { - "uid": "f0dc655a7331f379eb9c9da7a64a4c0d", - "css": "navi-1", - "code": 59464, - "src": "custom_icons", - "selected": true, - "svg": { - "path": "M427.5 87.5C92.7 151.4-34.6 555.7 204.8 795.2 408.9 999.2 752.7 940.7 877.5 680.7 1023.2 377.2 755.9 24.8 427.5 87.5M556.9 152.5C793.4 194.4 921.4 450.4 811.4 661.8 667.4 938.5 260.5 903.1 164.8 605.5 85.7 359.4 303.6 107.7 556.9 152.5M589.8 315.3C307.5 420.4 290.5 428 277.7 454.4 252 507.5 275.6 541.9 358.5 572.1L409.4 590.6 425.8 636.1C446.4 693 453.9 706.7 471.2 718.5 500.4 738.6 550.6 730.8 570.3 703.2 587.5 679 684.8 413.7 686.3 386.7 689.4 334 639.3 296.9 589.8 315.3M620.8 385.7C620.1 400.6 517.4 662.1 512.2 662.1 509 662.1 500.2 643.7 489.8 615.2 458.8 530.2 468.8 540.6 390.6 512.3 358.6 500.7 337.9 491.1 337.9 487.9 337.9 482.8 599.6 379.8 614.3 379.2 618.4 379 621 381.6 620.8 385.7", - "width": 1000 - }, - "search": [ - "navi" - ] - }, { "uid": "4433e31b6fd49de97c469d7b0124bde4", "css": "exit", @@ -1107,6 +1093,34 @@ "css": "chevron_down", "code": 61560, "src": "fontawesome5" + }, + { + "uid": "ec5e7892560581b81df2bc756f5e0918", + "css": "position_unavailable", + "code": 59443, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M468.1 84C247.9 111.9 135.1 355.2 257.5 538.3 276.1 566 379.2 683.9 425.7 730.6 468.7 773.8 497.2 782.1 536 762.9 571.5 745.4 735.3 558.9 761.6 506 864.1 300.1 693.9 55.3 468.1 84M544.8 151.3C714.2 187 784.9 387.3 675.1 520.3 598.3 613.2 510.3 707 500 707 490.1 707 398.8 609.6 324.9 520.3 189 355.9 337 107.6 544.8 151.3M398 256.2C388.8 258.7 377.9 270.5 376.2 279.9 373.2 296 376.3 300.7 417.6 342.3L455.9 380.9 417.7 419.4C369.6 467.9 365.6 477.5 385.5 497.3 405.3 517.2 415 513.2 463.4 465.2L502 426.9 540.5 465.2C589 513.2 598.6 517.2 618.4 497.3 638.3 477.5 634.3 467.9 586.3 419.4L548 380.9 586.3 342.3C634.3 293.9 638.3 284.3 618.4 264.4 598.6 244.6 589 248.5 540.5 296.6L502 334.8 463.4 296.5C419.5 252.9 416.8 251.2 398 256.2M228.8 589.8C198.9 600.6 172.7 625.9 161.9 654.5 153.4 676.7 124.9 806.8 124.8 823.2 124.8 868.9 157 908 201.3 916.1 208.5 917.4 314.2 917.9 507 917.5L801.8 917 813 912.5C851.4 896.9 872.7 867.8 874.5 828 875.4 809.2 852.6 698.5 839.6 658.8 831.2 632.8 808.2 607.1 782.6 595 756.7 582.7 760.1 581.3 730.7 615.6L705.1 645.5 724.1 646.7C769.2 649.4 773.4 655.6 795.2 749.7 814.8 834.1 814.5 841 791.6 850.8 782.2 854.8 217.8 854.8 208.4 850.8 185.5 841 185.2 834.1 204.8 749.7 226.6 655.5 230.8 649.4 276.1 646.7L295.3 645.5 269.6 615.7C255.6 599.3 243 586 241.6 586 240.3 586 234.6 587.8 228.8 589.8", + "width": 1000 + }, + "search": [ + "position_unavailable" + ] + }, + { + "uid": "fa0ff5c4bb0ea8613dcc354eb10b7daf", + "css": "position_unknow", + "code": 59469, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M468.1 84C247.9 111.9 135.1 355.2 257.5 538.3 276.1 566 379.2 683.9 425.7 730.6 468.7 773.8 497.2 782.1 536 762.9 571.5 745.4 735.3 558.9 761.6 506 864.1 300.1 693.9 55.3 468.1 84M544.8 151.3C714.2 187 784.9 387.3 675.1 520.3 598.3 613.2 510.3 707 500 707 490.1 707 398.8 609.6 324.9 520.3 189 355.9 337 107.6 544.8 151.3M477.1 210C411.3 224.3 364.5 324.7 412.1 349.3 436 361.6 456.3 347.7 459.1 317.2 463.5 269.1 515.3 253.7 535.9 294.4 547.2 316.6 542.6 329.3 512.8 358.4 479.3 391 468.8 411.6 468.8 444 468.8 493.2 527.7 494.1 532.5 445 534.2 427.2 537.3 422.1 555.6 406.6 573.5 391.3 587.9 373.6 595.1 358.1 631.7 278.9 562.1 191.5 477.1 210M487.8 521.4C441.1 536.4 451.1 604.7 500 604.4 554 604.1 557.3 524.5 503.5 520.4 497.8 520 490.8 520.4 487.8 521.4M228.8 589.8C198.9 600.6 172.7 625.9 161.9 654.5 153.4 676.7 124.9 806.8 124.8 823.2 124.8 868.9 157 908 201.3 916.1 208.5 917.4 314.2 917.9 507 917.5L801.8 917 813 912.5C851.4 896.9 872.7 867.8 874.5 828 875.4 809.2 852.6 698.5 839.6 658.8 831.2 632.8 808.2 607.1 782.6 595 756.7 582.7 760.1 581.3 730.7 615.6L705.1 645.5 724.1 646.7C769.2 649.4 773.4 655.6 795.2 749.7 814.8 834.1 814.5 841 791.6 850.8 782.2 854.8 217.8 854.8 208.4 850.8 185.5 841 185.2 834.1 204.8 749.7 226.6 655.5 230.8 649.4 276.1 646.7L295.3 645.5 269.6 615.7C255.6 599.3 243 586 241.6 586 240.3 586 234.6 587.8 228.8 589.8", + "width": 1000 + }, + "search": [ + "position_unknow" + ] } ] } \ No newline at end of file diff --git a/lib/src/icons/navika_icons_icons.dart b/lib/src/icons/navika_icons_icons.dart index ceb69d8c..5798f92b 100644 --- a/lib/src/icons/navika_icons_icons.dart +++ b/lib/src/icons/navika_icons_icons.dart @@ -78,6 +78,7 @@ class NavikaIcons { static const IconData arrival = IconData(0xe830, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData departure = IconData(0xe831, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData calendar = IconData(0xe832, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData position_unavailable = IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData bellAdd = IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData bellFilled = IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData avance = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); @@ -96,11 +97,11 @@ class NavikaIcons { static const IconData position_middle = IconData(0xe845, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData position_front = IconData(0xe846, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData navi = IconData(0xe847, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData navi_1 = IconData(0xe848, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData exit = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData entrance = IconData(0xe84a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData stars = IconData(0xe84b, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData hearts = IconData(0xe84c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData position_unknow = IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData saved = IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData bell = IconData(0xe86c, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData busFace = IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/src/screens/changes.dart b/lib/src/screens/changes.dart index 08bbc539..7d683141 100644 --- a/lib/src/screens/changes.dart +++ b/lib/src/screens/changes.dart @@ -31,29 +31,29 @@ class _ChangesState extends State { String data = ''; Future _getChanges() async { - ApiStatus _error = ApiStatus.ok; - String _data = ''; + ApiStatus error = ApiStatus.ok; + String data = ''; try { final response = await http.get(Uri.parse(app.APP_CHANGES)); if (response.statusCode == 200) { - _data = utf8.decode(response.bodyBytes); - _error = ApiStatus.ok; + data = utf8.decode(response.bodyBytes); + error = ApiStatus.ok; } else { - _error = ApiStatus.serverException; + error = ApiStatus.serverException; } } on SocketException { - _error = ApiStatus.socketException; + error = ApiStatus.socketException; } on TimeoutException { - _error = ApiStatus.timeoutException; + error = ApiStatus.timeoutException; } catch (e) { - _error = ApiStatus.unknownException; + error = ApiStatus.unknownException; } setState(() { - data = _data; - error = _error; + data = data; + error = error; isLoading = false; }); } diff --git a/lib/src/screens/home.dart b/lib/src/screens/home.dart index e3d7350a..d53882f1 100644 --- a/lib/src/screens/home.dart +++ b/lib/src/screens/home.dart @@ -11,10 +11,10 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter_compass/flutter_compass.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:here_sdk/core.dart'; import 'package:here_sdk/gestures.dart'; import 'package:here_sdk/mapview.dart'; -import 'package:geolocator/geolocator.dart'; import 'package:screenshot/screenshot.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; @@ -31,6 +31,14 @@ import 'package:navika/src/widgets/home/header.dart'; import 'package:navika/src/widgets/home/pannel.dart'; import 'package:navika/src/widgets/map/icone.dart'; +enum PositionState { + defined, // Défini + acquiring, // En cours d’acquisition + permissionDenied, // Permission rejetée + servicesDisabled, // Services désactivés + unknown // Inconnu +} + class Home extends StatefulWidget { final String? displayType; final String? id; @@ -51,6 +59,7 @@ class _HomeState extends State { GeoCoordinates camGeoCoords = GeoCoordinates(0, 0); + PositionState state = PositionState.unknown; Position? position; StreamSubscription? positionStream; @@ -65,7 +74,7 @@ class _HomeState extends State { late Timer _timer; bool isConnected = true; - double panelButtonBottomOffsetClosed = 120; + double panelButtonBottomOffsetClosed = 110; double panelButtonBottomOffset = 120; double _position = 0; @@ -79,7 +88,7 @@ class _HomeState extends State { double _padding = 0; Future _getLocation() async { - bool serviceEnabled; + bool serviceEnabled; LocationPermission permission; LocationSettings locationSettings = const LocationSettings( accuracy: LocationAccuracy.high, @@ -89,16 +98,18 @@ class _HomeState extends State { bool allowGps = await globals.hiveBox?.get('allowGps') ?? false; if (!askGps) { RouteStateScope.of(context).go('/position'); + state = PositionState.permissionDenied; return; } if (!allowGps) { + state = PositionState.permissionDenied; return; } // Check if location services are enabled serviceEnabled = await Geolocator.isLocationServiceEnabled(); if (!serviceEnabled) { - RouteStateScope.of(context).go('/position'); + state = PositionState.servicesDisabled; return; } @@ -106,18 +117,24 @@ class _HomeState extends State { permission = await Geolocator.checkPermission(); if (permission == LocationPermission.deniedForever || permission == LocationPermission.denied) { RouteStateScope.of(context).go('/position'); + state = PositionState.permissionDenied; return; } // Check if we have a recent position + state = PositionState.acquiring; + Position? lastKnownLocation = await Geolocator.getLastKnownPosition(); if (lastKnownLocation != null) { position = lastKnownLocation; - _addLocationIndicator(lastKnownLocation!, false); + _addLocationIndicator(lastKnownLocation, false); } else { position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high); - _addLocationIndicator(lastKnownLocation!, true); + if (position != null) { + _addLocationIndicator(position!, true); + } } + state = PositionState.defined; if (position != null) { camGeoCoords = GeoCoordinates(position!.latitude, position!.longitude); @@ -134,13 +151,19 @@ class _HomeState extends State { } } - Future _getNearPoints() async { + Future _getNearPoints([double? lat, double? lon]) async { double zoom = _controller?.getZoomLevel() ?? 0; - - if (_oldcamGeoCoords == camGeoCoords) { - return; + GeoCoordinates coords = camGeoCoords; + + if (lat != null && lon != null) { + zoom = 1200; + coords = GeoCoordinates(lat, lon); + } else { + if (_oldcamGeoCoords == camGeoCoords) { + return; + } + _oldcamGeoCoords = camGeoCoords; } - _oldcamGeoCoords = camGeoCoords; List bikeNearby = []; List stopsNearby = []; @@ -148,7 +171,7 @@ class _HomeState extends State { if (zoom < 200000) { NavikaApi navikaApi = NavikaApi(); - Map result = await navikaApi.getNearPoints(zoom, camGeoCoords); + Map result = await navikaApi.getNearPoints(zoom, coords); if (result['status'] == ApiStatus.ok && mounted) { setState(() { @@ -307,6 +330,34 @@ class _HomeState extends State { } } + Icon getLocationIcon() { + IconData icon = NavikaIcons.localisationNull; + + switch (state) { + case PositionState.defined: + if (_isInBox) { + icon = NavikaIcons.localisation; + } else { + icon = NavikaIcons.localisationNull; + } + break; + case PositionState.acquiring: + icon = NavikaIcons.position_unknow; + break; + case PositionState.permissionDenied: + icon = NavikaIcons.position_unavailable; + break; + case PositionState.servicesDisabled: + icon = NavikaIcons.position_unavailable; + break; + case PositionState.unknown: + icon = NavikaIcons.position_unknow; + break; + } + + return Icon(icon, color: Theme.of(context).colorScheme.onSurface, size: 30); + } + void setData(data) { setState(() { _data = data; @@ -350,6 +401,7 @@ class _HomeState extends State { removePointMarker: removePointMarker, setData: setData, setPadding: setPadding, + refreshMap: _getNearPoints, panelController: panelController, ), panelBuilder: (ScrollController scrollController) => HomePannel( @@ -360,6 +412,7 @@ class _HomeState extends State { data: _data, padding: _padding, setData: setData, + refreshMap: _getNearPoints, setPadding: setPadding, panelController: panelController, ), @@ -431,11 +484,9 @@ class _HomeState extends State { bottom: panelButtonBottomOffset, child: Opacity( opacity: getOpacity(_position), - child: FloatingActionButton( - backgroundColor: Theme.of(context).colorScheme.onSecondaryContainer, - child: _isInBox - ? Icon(NavikaIcons.localisation, color: Theme.of(context).colorScheme.onSurface, size: 30) - : Icon(NavikaIcons.localisationNull, color: Theme.of(context).colorScheme.onSurface, size: 30), + child: FloatingActionButton ( + backgroundColor: Theme.of(context).colorScheme.surface, + child: getLocationIcon(), onPressed: () { _zoomOn(); _closePanel(); @@ -517,15 +568,17 @@ class _HomeState extends State { globals.panelController = panelController; _getLocation(); - GeoCoordinates geoCoords; + GeoCoordinates geoCoords = GeoCoordinates(48.859481, 2.346711); double distanceToEarthInMeters = 10000; - Position? lastKnownLocation = await Geolocator.getLastKnownPosition(); - if (lastKnownLocation != null) { - // Opening App - geoCoords = GeoCoordinates(lastKnownLocation.latitude, lastKnownLocation.longitude); - } else { - geoCoords = GeoCoordinates(48.859481, 2.346711); + LocationPermission permission; + permission = await Geolocator.checkPermission(); + if (permission == LocationPermission.whileInUse || permission == LocationPermission.always) { + Position? lastKnownLocation = await Geolocator.getLastKnownPosition(); + if (lastKnownLocation != null) { + // Opening App + geoCoords = GeoCoordinates(lastKnownLocation.latitude, lastKnownLocation.longitude); + } } MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters); @@ -612,9 +665,9 @@ class _HomeState extends State { }); } - void _addLocationIndicator(Position position, [isActive = true]) { + void _addLocationIndicator(Position position, [isActive = true, zoomAuto = true]) { if (mounted) { - _controller?.addLocationIndicator(position, LocationIndicatorIndicatorStyle.pedestrian, compass, isActive); + _controller?.addLocationIndicator(position, LocationIndicatorIndicatorStyle.pedestrian, compass, isActive, zoomAuto); } } @@ -656,8 +709,8 @@ class _HomeState extends State { void _onPanelSlide(position) { setState(() { - panelButtonBottomOffset = panelButtonBottomOffsetClosed + ((MediaQuery.of(context).size.height - 230) * position); - _position = position; + panelButtonBottomOffset = panelButtonBottomOffsetClosed + ((availableHeight(context) - 90) * position); + _position = position; }); } diff --git a/lib/src/screens/home_search.dart b/lib/src/screens/home_search.dart index 782b1322..00fe131c 100644 --- a/lib/src/screens/home_search.dart +++ b/lib/src/screens/home_search.dart @@ -56,20 +56,24 @@ class _SchedulesSearchState extends State { String search = ''; ApiStatus error = ApiStatus.ok; int flag = 0; + bool hasLastestFlag = false; bool isLoading = false; List places = []; Future _getPlaces() async { + if (globals.query != null) { + setState(() { + myController.text = globals.query!; + search = globals.query!; + globals.query = null; + }); + } + if (search == '') { return; } flag++; - - if (globals.query != null) { - myController.text = globals.query!; - search = globals.query!; - globals.query = null; - } + hasLastestFlag = false; setState(() { isLoading = true; @@ -79,7 +83,7 @@ class _SchedulesSearchState extends State { NavikaApi navikaApi = NavikaApi(); Map result = await navikaApi.getPlaces(search, globals.position, flag); - if (mounted) { + if (mounted && !hasLastestFlag) { setState(() { error = result['status']; }); @@ -88,6 +92,7 @@ class _SchedulesSearchState extends State { setState(() { places = result['value']?['places']; isLoading = false; + hasLastestFlag = true; }); } } @@ -118,7 +123,7 @@ class _SchedulesSearchState extends State { res.add( Padding( padding: const EdgeInsets.only(left: 20, bottom: 10), - child: Text('Vos favoris', + child: Text(AppLocalizations.of(context)!.your_favorites, style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, @@ -244,7 +249,7 @@ class _SchedulesSearchState extends State { controller: myController, focusNode: textFieldNode, decoration: InputDecoration( - hintText: AppLocalizations.of(context)!.search_location_on_map + hintText: AppLocalizations.of(context)!.home_search ), onChanged: (text) { setState(() { diff --git a/lib/src/screens/journeys_details.dart b/lib/src/screens/journeys_details.dart index 0d24fa22..a497e08f 100644 --- a/lib/src/screens/journeys_details.dart +++ b/lib/src/screens/journeys_details.dart @@ -7,12 +7,12 @@ import 'package:flutter/services.dart'; // 📦 Package imports: import 'package:floating_snackbar/floating_snackbar.dart'; -// import 'package:flutter_compass/flutter_compass.dart'; +import 'package:flutter_compass/flutter_compass.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:here_sdk/core.dart'; import 'package:here_sdk/mapview.dart'; -import 'package:geolocator/geolocator.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; // 🌎 Project imports: @@ -20,6 +20,8 @@ import 'package:navika/src/controller/here_map_controller.dart'; import 'package:navika/src/data/global.dart' as globals; import 'package:navika/src/icon.dart'; import 'package:navika/src/icons/navika_icons_icons.dart'; +import 'package:navika/src/routing/route_state.dart'; +import 'package:navika/src/screens/home.dart'; import 'package:navika/src/screens/navigator.dart'; import 'package:navika/src/style.dart'; import 'package:navika/src/utils.dart'; @@ -128,8 +130,12 @@ class _JourneysDetailsState extends State { PanelController panelController = PanelController(); GeoCoordinates camGeoCoords = GeoCoordinates(0, 0); - Position? location; + PositionState state = PositionState.unknown; + Position? position; + StreamSubscription? positionStream; + + CompassEvent? compassEvent; double compass = 0; bool isPanned = false; @@ -138,10 +144,11 @@ class _JourneysDetailsState extends State { final bool _allowNavi = allowNavi(globals.journey); late Timer _timer; - double panelButtonBottomOffsetClosed = 120; + double panelButtonBottomOffsetClosed = 110; double panelButtonBottomOffset = 120; double saveButtonRightOffset = 0; double _position = 0; + Map journey = globals.journey; Map getToCoords() { @@ -216,38 +223,97 @@ class _JourneysDetailsState extends State { _controller?.addMapPolylines(mapPolyline); } - // Future _getLocation(isResume) async { - // bool serviceEnabled; - // Position position; - - // bool? allowGps = await globals.hiveBox?.get('allowGps'); - // if (allowGps == false) { - // return; - // } - - // if (!globals.isSetLocation) { - // serviceEnabled = await location.serviceEnabled(); - // if (!serviceEnabled) { - // serviceEnabled = await location.requestService(); - // if (!serviceEnabled) { - // return; - // } - // } - // } - - // position = await location.getLocation(); - // camGeoCoords = GeoCoordinates(position.latitude ?? 0, position.longitude ?? 0); - - // FlutterCompass.events?.listen((CompassEvent compassEvent) { - // _updateCompass(compassEvent); - // }); - // if (!isResume) { - // _addLocationIndicator(position); - // } - // location.onLocationChanged.listen((Position currentLocation) { - // _updateLocationIndicator(currentLocation); - // }); - // } + Future _getLocation() async { + bool serviceEnabled; + LocationPermission permission; + LocationSettings locationSettings = const LocationSettings( + accuracy: LocationAccuracy.high, + ); + + bool askGps = await globals.hiveBox?.get('askGps') ?? false; + bool allowGps = await globals.hiveBox?.get('allowGps') ?? false; + if (!askGps) { + RouteStateScope.of(context).go('/position'); + state = PositionState.permissionDenied; + return; + } + if (!allowGps) { + state = PositionState.permissionDenied; + return; + } + + // Check if location services are enabled + serviceEnabled = await Geolocator.isLocationServiceEnabled(); + if (!serviceEnabled) { + state = PositionState.servicesDisabled; + return; + } + + // Check if app we have location permission + permission = await Geolocator.checkPermission(); + if (permission == LocationPermission.deniedForever || permission == LocationPermission.denied) { + RouteStateScope.of(context).go('/position'); + state = PositionState.permissionDenied; + return; + } + + // Check if we have a recent position + state = PositionState.acquiring; + + Position? lastKnownLocation = await Geolocator.getLastKnownPosition(); + if (lastKnownLocation != null) { + position = lastKnownLocation; + _addLocationIndicator(lastKnownLocation, false, false); + } else { + position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high); + if (position != null) { + _addLocationIndicator(position!, true, false); + } + } + state = PositionState.defined; + + if (position != null) { + camGeoCoords = GeoCoordinates(position!.latitude, position!.longitude); + } + + if (mounted) { + positionStream = Geolocator.getPositionStream(locationSettings: locationSettings).listen((Position? position) { + _updateLocationIndicator(position!); + }); + FlutterCompass.events?.listen((CompassEvent compassEvent) { + _updateCompass(compassEvent); + }); + } + } + + Icon getLocationIcon() { + IconData icon = NavikaIcons.localisationNull; + + switch (state) { + case PositionState.defined: + if (_isInBox) { + icon = NavikaIcons.localisation; + } else { + icon = NavikaIcons.localisationNull; + } + break; + case PositionState.acquiring: + icon = NavikaIcons.position_unknow; + break; + case PositionState.permissionDenied: + icon = NavikaIcons.position_unavailable; + break; + case PositionState.servicesDisabled: + icon = NavikaIcons.position_unavailable; + break; + case PositionState.unknown: + icon = NavikaIcons.position_unknow; + break; + } + + return Icon(icon, color: Theme.of(context).colorScheme.onSurface, size: 30); + } + @override Widget build(BuildContext context) => AnnotatedRegion( @@ -271,7 +337,7 @@ class _JourneysDetailsState extends State { ), snapPoint: 0.55, minHeight: 85, - maxHeight: availableHeight2(context), + maxHeight: availableHeightReduced(context), controller: panelController, onPanelSlide: (position) => onPanelSlide(position), header: RoutePannel( @@ -380,9 +446,7 @@ class _JourneysDetailsState extends State { opacity: getOpacity(_position), child: FloatingActionButton( backgroundColor: Theme.of(context).colorScheme.onSecondaryContainer, - child: _isInBox - ? Icon(NavikaIcons.localisation, color: Theme.of(context).colorScheme.onSurface, size: 30) - : Icon(NavikaIcons.localisationNull, color: Theme.of(context).colorScheme.onSurface, size: 30), + child: getLocationIcon(), onPressed: () { _zoomOn(); closePanel(); @@ -447,7 +511,7 @@ class _JourneysDetailsState extends State { } _controller = HereController(hereMapController); - // _getLocation(globals.isSetLocation); + _getLocation(); GeoCoordinates geoCoords; //double distanceToEarthInMeters = 100000; @@ -458,47 +522,36 @@ class _JourneysDetailsState extends State { MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters); hereMapController.camera.lookAtPointWithMeasure(geoCoords, mapMeasureZoom); - // _controller?.addLocationIndicator( - // globals.position, - // LocationIndicatorIndicatorStyle.pedestrian, - // globals.compass, - // false, - // false, - // ); - _createGeoJson(context, journey); }); } - void _addLocationIndicator(Position position) { - // _controller?.addLocationIndicator( - // position, - // LocationIndicatorIndicatorStyle.pedestrian, - // globals.compass, - // false); + void _addLocationIndicator(Position position, [isActive = true, zoomAuto = true]) { + if (mounted) { + _controller?.addLocationIndicator(position, LocationIndicatorIndicatorStyle.pedestrian, compass, isActive, zoomAuto); + } + } + + void _updateLocationIndicator(Position position) async { + _controller?.updateLocationIndicator(position, compass); } - // void _updateLocationIndicator(Position position) { - // _controller?.updateLocationIndicator(position, globals.compass); - // } - - // void _updateCompass(CompassEvent compassEvent) { - // var heading = compassEvent.heading ?? 0; - // if (mounted) { - // setState(() { - // compass = heading; - // }); - // } - // globals.compass = heading; - - // if (is3dMap) { - // if (!isPanned) { - // // si on a touché l'écran - // _controller?.zoomOnLocationIndicator(is3dMap); - // } - // } - // _controller?.updateLocationIndicator(globals.position, heading); - // } + void _updateCompass(CompassEvent compassEvent) { + var heading = compassEvent.heading ?? 0; + if (mounted) { + setState(() { + compass = heading; + }); + } + + if (is3dMap && !isPanned) { + // si on a touché l'écran + if (position != null) { + _controller?.zoomOnLocationIndicator(is3dMap, position!, compass); + } + } + _controller?.updateLocationIndicator(position, heading); + } void _zoomOn() { if (globals.position != null) { diff --git a/lib/src/screens/journeys_search.dart b/lib/src/screens/journeys_search.dart index 19925a0b..ce0100ac 100644 --- a/lib/src/screens/journeys_search.dart +++ b/lib/src/screens/journeys_search.dart @@ -34,6 +34,7 @@ class _JourneysSearchState extends State { String search = ''; ApiStatus error = ApiStatus.ok; int flag = 0; + bool hasLastestFlag = false; bool isLoading = false; List places = []; @@ -42,6 +43,7 @@ class _JourneysSearchState extends State { return; } flag++; + hasLastestFlag = false; setState(() { isLoading = true; @@ -50,7 +52,7 @@ class _JourneysSearchState extends State { NavikaApi navikaApi = NavikaApi(); Map result = await navikaApi.getPlaces(search, globals.position, flag); - if (mounted) { + if (mounted && !hasLastestFlag) { setState(() { error = result['status']; }); @@ -60,6 +62,7 @@ class _JourneysSearchState extends State { places = result['value']?['places']; } isLoading = false; + hasLastestFlag = true; }); } } @@ -68,7 +71,7 @@ class _JourneysSearchState extends State { void initState() { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { - FocusScope.of(context).requestFocus(textFieldNode); + FocusScope.of(context).requestFocus(textFieldNode); _getPlaces(); }); } @@ -84,37 +87,38 @@ class _JourneysSearchState extends State { if (places.isNotEmpty || search == '') { // Votre position - if (globals.route['from']['name'] != AppLocalizations.of(context)!.your_position && globals.route['to']['name'] != AppLocalizations.of(context)!.your_position && globals.position != null) { - res.add( - PlacesListButton( - isLoading: isLoading, - place: { - 'id': '${globals.position?.longitude};${globals.position?.latitude}', - 'name': AppLocalizations.of(context)!.your_position, - 'type': 'current_pos', - 'distance': 0, - 'town': '', - 'zip_code': '', - 'coord': const {}, - 'lines': const [], - 'modes': const [] - }, - onTap: () { - globals.route[widget.type]['id'] = '${globals.position?.longitude};${globals.position?.latitude}'; - globals.route[widget.type]['name'] = AppLocalizations.of(context)!.your_position; - RouteStateScope.of(context).go('/home/journeys'); - }, - ) - ); + if (globals.route['from']['name'] != AppLocalizations.of(context)!.your_position && + globals.route['to']['name'] != AppLocalizations.of(context)!.your_position && + globals.position != null) { + res.add(PlacesListButton( + isLoading: isLoading, + place: { + 'id': '${globals.position?.longitude};${globals.position?.latitude}', + 'name': AppLocalizations.of(context)!.your_position, + 'type': 'current_pos', + 'distance': 0, + 'town': '', + 'zip_code': '', + 'coord': const {}, + 'lines': const [], + 'modes': const [] + }, + onTap: () { + globals.route[widget.type]['id'] = '${globals.position?.longitude};${globals.position?.latitude}'; + globals.route[widget.type]['name'] = AppLocalizations.of(context)!.your_position; + RouteStateScope.of(context).go('/home/journeys'); + }, + )); } // Favoris List favs = globals.hiveBox.get('addressFavorites'); - if(search.isEmpty && favs.isNotEmpty){ + if (search.isEmpty && favs.isNotEmpty) { res.add( Padding( padding: const EdgeInsets.only(left: 20, bottom: 10), - child: Text('Vos favoris', + child: Text( + 'Vos favoris', style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, @@ -125,39 +129,38 @@ class _JourneysSearchState extends State { ), ); } - for(var fav in favs) { + for (var fav in favs) { if (globals.route['from']['id'] != fav['id'] && globals.route['to']['id'] != fav['id'] && search.isEmpty) { - res.add( - PlacesListButton( - isLoading: isLoading, - place: { - 'id': fav['id'], - 'name': fav['name'], - 'type': fav['alias'] == 'home' || fav['alias'] == 'work' ? fav['alias'] : 'favorite', - 'distance': 0, - 'town': '', - 'zip_code': '', - 'coord': const {}, - 'lines': const [], - 'modes': const [] - }, - onTap: () { - globals.route[widget.type]['id'] = fav['id']; - globals.route[widget.type]['name'] = fav['name']; - RouteStateScope.of(context).go('/home/journeys'); - }, - ) - ); + res.add(PlacesListButton( + isLoading: isLoading, + place: { + 'id': fav['id'], + 'name': fav['name'], + 'type': fav['alias'] == 'home' || fav['alias'] == 'work' ? fav['alias'] : 'favorite', + 'distance': 0, + 'town': '', + 'zip_code': '', + 'coord': const {}, + 'lines': const [], + 'modes': const [] + }, + onTap: () { + globals.route[widget.type]['id'] = fav['id']; + globals.route[widget.type]['name'] = fav['name']; + RouteStateScope.of(context).go('/home/journeys'); + }, + )); } } // Historique List history = globals.hiveBox.get('historyPlaces'); - if(search.isEmpty && history.isNotEmpty) { + if (search.isEmpty && history.isNotEmpty) { res.add( Padding( padding: const EdgeInsets.only(left: 20, bottom: 10), - child: Text(AppLocalizations.of(context)!.recent, + child: Text( + AppLocalizations.of(context)!.recent, style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, @@ -168,49 +171,39 @@ class _JourneysSearchState extends State { ), ); for (var place in history) { - res.add( - PlacesListButton( - isLoading: isLoading, - place: place, - onTap: () { - globals.route[widget.type]['id'] = place['id']; - globals.route[widget.type]['name'] = place['name']; - addToHistory(place); - RouteStateScope.of(context).go('/home/journeys'); - }, - ) - ); + res.add(PlacesListButton( + isLoading: isLoading, + place: place, + onTap: () { + globals.route[widget.type]['id'] = place['id']; + globals.route[widget.type]['name'] = place['name']; + addToHistory(place); + RouteStateScope.of(context).go('/home/journeys'); + }, + )); } } // Places if (places.isNotEmpty && error == ApiStatus.ok) { for (var place in places) { - res.add( - PlacesListButton( - isLoading: isLoading, - place: place, - onTap: () { - globals.route[widget.type]['id'] = place['id']; - globals.route[widget.type]['name'] = place['name']; - addToHistory(place); - RouteStateScope.of(context).go('/home/journeys'); - }, - ) - ); + res.add(PlacesListButton( + isLoading: isLoading, + place: place, + onTap: () { + globals.route[widget.type]['id'] = place['id']; + globals.route[widget.type]['name'] = place['name']; + addToHistory(place); + RouteStateScope.of(context).go('/home/journeys'); + }, + )); } } - - } else { if (places.isEmpty && isLoading == true) { - res.add( - const PlacesLoad() - ); + res.add(const PlacesLoad()); } else { - res.add( - const PlacesEmpty() - ); + res.add(const PlacesEmpty()); } } return res; @@ -223,9 +216,7 @@ class _JourneysSearchState extends State { controller: myController, focusNode: textFieldNode, decoration: InputDecoration( - hintText: widget.type == 'from' - ? AppLocalizations.of(context)!.where_are_we_departing_from - : AppLocalizations.of(context)!.where_are_we_going), + hintText: widget.type == 'from' ? AppLocalizations.of(context)!.where_are_we_departing_from : AppLocalizations.of(context)!.where_are_we_going), onChanged: (text) { setState(() { search = text; diff --git a/lib/src/screens/navigator.dart b/lib/src/screens/navigator.dart index 3071839d..c7959f27 100644 --- a/lib/src/screens/navigator.dart +++ b/lib/src/screens/navigator.dart @@ -71,6 +71,7 @@ class _NavikaAppNavigatorState extends State { Future initUniLinks(context) async { linkStream.listen((String? link) { + print(['info_lister', link]); if (link != null) { Uri uri = Uri.parse(link); if (uri.scheme == 'geo' && uri.queryParameters.containsKey('q')) { @@ -208,14 +209,17 @@ class _NavikaAppNavigatorState extends State { routeState.go('/home'); } if (pathTemplate == '/home/journeys/search/:type') { - routeState.go('/home/journeys'); + routeState.go(globals.path[globals.path.length - 2]); + globals.path = [...globals.path.slice(0, globals.path.length - 2)]; } if (pathTemplate == '/home/journeys/details') { - if (globals.path[globals.path.length - 2] == '/home/journeys') { - routeState.go('/home/journeys'); - } else { - routeState.go('/home/journeys/list'); - } + routeState.go(globals.path[globals.path.length - 2]); + globals.path = [...globals.path.slice(0, globals.path.length - 2)]; + // if (globals.path[globals.path.length - 2] == '/home/journeys') { + // routeState.go('/home/journeys'); + // } else { + // routeState.go('/home/journeys/list'); + // } } if (pathTemplate == '/home/journeys/list') { routeState.go('/home'); diff --git a/lib/src/screens/routes_search.dart b/lib/src/screens/routes_search.dart index 80f9d721..ac0bc977 100644 --- a/lib/src/screens/routes_search.dart +++ b/lib/src/screens/routes_search.dart @@ -35,11 +35,13 @@ class _RoutesSearchState extends State { String search = ''; ApiStatus error = ApiStatus.ok; int flag = 0; + bool hasLastestFlag = false; bool isLoading = false; List lines = []; Future _getLines() async { flag++; + hasLastestFlag = false; setState(() { isLoading = true; @@ -49,7 +51,7 @@ class _RoutesSearchState extends State { NavikaApi navikaApi = NavikaApi(); Map result = await navikaApi.getLines(search, flag); - if (mounted) { + if (mounted && !hasLastestFlag) { setState(() { error = result['status']; }); @@ -58,6 +60,7 @@ class _RoutesSearchState extends State { setState(() { lines = result['value']?['lines']; isLoading = false; + hasLastestFlag = true; }); } } diff --git a/lib/src/screens/schedules_search.dart b/lib/src/screens/schedules_search.dart index 2ba43cbf..4c578e95 100644 --- a/lib/src/screens/schedules_search.dart +++ b/lib/src/screens/schedules_search.dart @@ -30,11 +30,13 @@ class _SchedulesSearchState extends State { String search = ''; ApiStatus error = ApiStatus.ok; int flag = 0; + bool hasLastestFlag = false; bool isLoading = false; List places = []; Future _getStops() async { flag++; + hasLastestFlag = false; setState(() { isLoading = true; @@ -44,7 +46,7 @@ class _SchedulesSearchState extends State { NavikaApi navikaApi = NavikaApi(); Map result = await navikaApi.getStops(search, globals.position, flag); - if (mounted) { + if (mounted && !hasLastestFlag) { setState(() { error = result['status']; }); @@ -53,6 +55,7 @@ class _SchedulesSearchState extends State { setState(() { places = result['value']?['places']; isLoading = false; + hasLastestFlag = true; }); } } diff --git a/lib/src/utils.dart b/lib/src/utils.dart index a5302b4e..8b9d1db9 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -761,5 +761,4 @@ double degreesToRadians(double degrees) { double availableHeight(context) => MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom - kBottomNavigationBarHeight; - -double availableHeight2(context) => MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom; \ No newline at end of file +double availableHeightReduced(context) => MediaQuery.of(context).size.height - AppBar().preferredSize.height - MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.bottom + 20; \ No newline at end of file diff --git a/lib/src/widgets/address/head.dart b/lib/src/widgets/address/head.dart index ca7d0c13..11567810 100644 --- a/lib/src/widgets/address/head.dart +++ b/lib/src/widgets/address/head.dart @@ -27,9 +27,13 @@ Widget getDistanceWidget(double lat, double lon) { return Container(); } - int distance = calculateDistance(lat, lon, globals.position!.latitude!, globals.position!.longitude!).toInt(); + int distance = calculateDistance(lat, lon, globals.position!.latitude, globals.position!.longitude).toInt(); int duration = distance ~/ 1.3; + if (distance >= 1000 ) { + return Container(); + } + return Row( children: [ Row( @@ -64,6 +68,7 @@ class AddressHead extends StatefulWidget { final Function onDispose; final Function setPadding; final Function setData; + final Function refreshMap; final PanelController panelController; const AddressHead({ @@ -71,6 +76,7 @@ class AddressHead extends StatefulWidget { required this.onDispose, required this.setPadding, required this.setData, + required this.refreshMap, required this.panelController, super.key, }); @@ -126,6 +132,7 @@ class _AddressHeadState extends State with SingleTickerProviderStat // widget.setData(address); widget.panelController.animatePanelToSnapPoint(); + widget.refreshMap(address['place']['coord']['lat'], address['place']['coord']['lon']); if (globals.updateMap == false) { openMapPoint(address['place']['coord']['lat'], address['place']['coord']['lon'], true); } @@ -233,16 +240,20 @@ class _AddressHeadState extends State with SingleTickerProviderStat }, ), ), - Padding( - padding: const EdgeInsets.only(right: 5), - child: IconElevatedButton( - icon: NavikaIcons.star, - text: AppLocalizations.of(context)!.save, - onPressed: () { - initJourney(null, {'name': address['place']['name'], 'id': address['place']['id']}, context); - }, - ), - ), + //TODO Padding( + //TODO padding: const EdgeInsets.only(right: 5), + //TODO child: IconElevatedButton( + //TODO icon: NavikaIcons.star, + //TODO text: AppLocalizations.of(context)!.save, + //TODO style: ElevatedButton.styleFrom( + //TODO foregroundColor : Theme.of(context).colorScheme.onPrimaryContainer, + //TODO backgroundColor : Theme.of(context).colorScheme.primaryContainer + //TODO ), + //TODO onPressed: () { + //TODO initJourney(null, {'name': address['place']['name'], 'id': address['place']['id']}, context); + //TODO }, + //TODO ), + //TODO ), ], ), ], diff --git a/lib/src/widgets/bike/head.dart b/lib/src/widgets/bike/head.dart index 0ca47690..fbc53784 100644 --- a/lib/src/widgets/bike/head.dart +++ b/lib/src/widgets/bike/head.dart @@ -25,12 +25,14 @@ class BikeHead extends StatefulWidget { final String id; final Function setPadding; final Function setData; + final Function refreshMap; final PanelController panelController; const BikeHead({ required this.id, required this.setPadding, required this.setData, + required this.refreshMap, required this.panelController, super.key, }); @@ -84,6 +86,7 @@ class _BikeHeadState extends State with SingleTickerProviderStateMixin // widget.setData(bikeStation); widget.panelController.animatePanelToSnapPoint(); + widget.refreshMap(bikeStation['bike_station']['coord']['lat'], bikeStation['bike_station']['coord']['lon']); if (globals.updateMap == false) { openMapPoint(bikeStation['bike_station']['coord']['lat'], bikeStation['bike_station']['coord']['lon']); } diff --git a/lib/src/widgets/home/header.dart b/lib/src/widgets/home/header.dart index 444d1ac7..baa75e44 100644 --- a/lib/src/widgets/home/header.dart +++ b/lib/src/widgets/home/header.dart @@ -22,6 +22,7 @@ class HomeHeader extends StatelessWidget { final Function removePointMarker; final Function setPadding; final Function setData; + final Function refreshMap; final PanelController panelController; const HomeHeader({ @@ -32,6 +33,7 @@ class HomeHeader extends StatelessWidget { required this.removePointMarker, required this.setPadding, required this.setData, + required this.refreshMap, required this.panelController, super.key, }); @@ -70,7 +72,7 @@ class HomeHeader extends StatelessWidget { // initJourney(null, null, context); }, icon: NavikaIcons.search, - text: AppLocalizations.of(context)!.where_are_we_going, + text: AppLocalizations.of(context)!.home_search, borderRadius: BorderRadius.circular(15)), ), Container( @@ -85,6 +87,7 @@ class HomeHeader extends StatelessWidget { onDispose: removePointMarker, setPadding: setPadding, setData: setData, + refreshMap: refreshMap, panelController: panelController, ); } else if (type == 'bike') { @@ -92,6 +95,7 @@ class HomeHeader extends StatelessWidget { id: id!, setPadding: setPadding, setData: setData, + refreshMap: refreshMap, panelController: panelController, ); } else if (type == 'stops') { diff --git a/lib/src/widgets/home/pannel.dart b/lib/src/widgets/home/pannel.dart index 44dd8bc4..79c073a4 100644 --- a/lib/src/widgets/home/pannel.dart +++ b/lib/src/widgets/home/pannel.dart @@ -20,6 +20,7 @@ class HomePannel extends StatelessWidget { final double padding; final Function setPadding; final Function setData; + final Function refreshMap; const HomePannel({ required this.id, @@ -31,6 +32,7 @@ class HomePannel extends StatelessWidget { required this.padding, required this.setPadding, required this.setData, + required this.refreshMap, super.key, }); @@ -46,6 +48,7 @@ class HomePannel extends StatelessWidget { id: id!, padding: padding, setData: setData, + refreshMap: refreshMap, panelController: panelController, scrollController: scrollController, hideProgressBar: true, diff --git a/lib/src/widgets/places/listbutton.dart b/lib/src/widgets/places/listbutton.dart index 31503cd6..c8527ee6 100644 --- a/lib/src/widgets/places/listbutton.dart +++ b/lib/src/widgets/places/listbutton.dart @@ -1,6 +1,8 @@ // 🐦 Flutter imports: import 'package:flutter/material.dart'; +// 📦 Package imports: + // 🌎 Project imports: import 'package:navika/src/icons/navika_icons_icons.dart'; import 'package:navika/src/style.dart'; @@ -143,7 +145,7 @@ class PlacesListButton extends StatelessWidget { line: place['lines'][i], prevLine: i > 0 ? place['lines'][i - 1] : place['lines'][i], i: i, - brightness: Theme.of(context).colorScheme.brightness) + brightness: Theme.of(context).colorScheme.brightness,), ], ), ], diff --git a/lib/src/widgets/schedules/body.dart b/lib/src/widgets/schedules/body.dart index 32478ddb..e7a9ba5b 100644 --- a/lib/src/widgets/schedules/body.dart +++ b/lib/src/widgets/schedules/body.dart @@ -103,6 +103,7 @@ class SchedulesBody extends StatefulWidget { final PanelController? panelController; final double padding; final Function? setData; + final Function? refreshMap; final bool hideProgressBar; const SchedulesBody({ @@ -111,6 +112,7 @@ class SchedulesBody extends StatefulWidget { this.panelController, this.padding = 0, this.setData, + this.refreshMap, this.hideProgressBar = false, super.key, }); @@ -221,6 +223,9 @@ class _SchedulesBodyState extends State with SingleTickerProvider if (globals.updateMap == false) { openMapPoint(result['value']['place']['coord']['lat'], result['value']['place']['coord']['lon']); } + if (widget.refreshMap != null) { + widget.refreshMap!(result['value']['place']['coord']['lat'], result['value']['place']['coord']['lon']); + } globals.updateMap = false; } diff --git a/lib/src/widgets/schedules/header.dart b/lib/src/widgets/schedules/header.dart index 140583ee..d7723851 100644 --- a/lib/src/widgets/schedules/header.dart +++ b/lib/src/widgets/schedules/header.dart @@ -16,7 +16,6 @@ import 'package:navika/src/screens/schedules_details.dart'; import 'package:navika/src/style.dart'; import 'package:navika/src/widgets/address/head.dart'; import 'package:navika/src/widgets/bottom_sheets/add_favorite.dart'; -import 'package:navika/src/widgets/error_block.dart'; import 'package:navika/src/widgets/home/skelton.dart'; import 'package:navika/src/widgets/schedules/body.dart'; import 'package:navika/src/widgets/utils/icon_elevated.dart'; @@ -75,8 +74,16 @@ class _SchedulesPannelState extends State { ), ), if (widget.data != null && widget.data['status'] != null && widget.data['status'] != ApiStatus.ok) - ErrorBlock( - error: widget.data['status'], + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + IconButton( + icon: Icon(arrowBack), + tooltip: AppLocalizations.of(context)!.back, + color: accentColor(context), + onPressed: () => Navigator.pop(context), + ), + ], ) else if (widget.data == null || widget.data['value'] == null) const HomeHeaderSkelton() @@ -96,17 +103,32 @@ class _SchedulesPannelState extends State { onPressed: () => Navigator.pop(context), ), const SizedBox(width: 10), - Text( - widget.data['value']['place']['name'], - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w600, - fontFamily: fontFamily, - color: accentColor(context), - ), - maxLines: 1, - softWrap: false, - overflow: TextOverflow.fade, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.data['value']['place']['name'], + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.w600, + fontFamily: fontFamily, + color: accentColor(context), + ), + maxLines: 1, + softWrap: false, + overflow: TextOverflow.fade, + ), + Text( + widget.data['value']['place']['zip_code'] == '' + ? widget.data['value']['place']['town'] + : '${widget.data['value']['place']['zip_code']}, ${widget.data['value']['place']['town']}', + style: TextStyle( + fontSize: 16, + color: accentColor(context), + fontFamily: fontFamily, + ), + ), + ], ), ], ), @@ -114,6 +136,7 @@ class _SchedulesPannelState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + const SizedBox(height: 7), Padding( padding: const EdgeInsets.only(left: 15), child: getDistanceWidget(widget.data['value']['place']['coord']['lat'], widget.data['value']['place']['coord']['lon']), @@ -127,12 +150,16 @@ class _SchedulesPannelState extends State { children: [ Padding( padding: const EdgeInsets.only(left: 5), - child: IconElevatedButton( - icon: NavikaIcons.navi, - text: AppLocalizations.of(context)!.go, - onPressed: () { - initJourney(null, {'name': widget.data['value']['place']['name'], 'id': widget.data['value']['place']['id']}, context); - }, + child: SizedBox( + height: 40, + child: IconElevatedButton( + icon: NavikaIcons.navi, + text: AppLocalizations.of(context)!.go, + margin: const EdgeInsets.only(left: 9, bottom: 4, top: 4), + onPressed: () { + initJourney(null, {'name': widget.data['value']['place']['name'], 'id': widget.data['value']['place']['id']}, context); + }, + ), ), ), //TODO Padding( @@ -150,6 +177,10 @@ class _SchedulesPannelState extends State { child: IconElevatedButton( icon: isFavorite(widget.data['value']['place']['id']) ? NavikaIcons.favorites : NavikaIcons.addBookmark, text: AppLocalizations.of(context)!.add_to_favorites, + style: ElevatedButton.styleFrom( + foregroundColor : Theme.of(context).colorScheme.onPrimaryContainer, + backgroundColor : Theme.of(context).colorScheme.primaryContainer + ), onPressed: () { showModalBottomSheet( shape: const RoundedRectangleBorder( diff --git a/lib/src/widgets/utils/icon_elevated.dart b/lib/src/widgets/utils/icon_elevated.dart index a805ad43..545038ef 100644 --- a/lib/src/widgets/utils/icon_elevated.dart +++ b/lib/src/widgets/utils/icon_elevated.dart @@ -3,39 +3,45 @@ import 'package:flutter/material.dart'; class IconElevatedButton extends StatelessWidget { final IconData? icon; + final double? iconSize; final String text; + final double? textSize; final Function() onPressed; final ButtonStyle? style; + final EdgeInsets? margin; const IconElevatedButton({ this.icon, + this.iconSize, required this.text, + this.textSize, required this.onPressed, this.style, + this.margin, super.key, }); @override Widget build(BuildContext context) => ElevatedButton( - onPressed: onPressed, - style: style, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (icon != null) - Icon(icon, size: 25), - Container( - margin: icon == null - ? const EdgeInsets.only(bottom: 11, top: 11) - : const EdgeInsets.only(left:15, bottom: 11, top: 11), - child: Text(text, - style: const TextStyle( - fontSize: 16, + onPressed: onPressed, + style: style, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (icon != null) Icon(icon, size: iconSize ?? 25), + Container( + margin: margin ?? (icon == null + ? const EdgeInsets.only(bottom: 11, top: 11) + : const EdgeInsets.only(left: 15, bottom: 11, top: 11)), + child: Text( + text, + style: TextStyle( + fontSize: textSize ?? 16, + ), + textAlign: TextAlign.center, + ), ), - textAlign: TextAlign.center, - ), + ], ), - ], - ), - ); + ); } diff --git a/pubspec.lock b/pubspec.lock index 7587c53d..e36df11c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "554f148e71e9e016d9c04d4af6b103ca3f74a1ceed7d7307b70a0f41e991eb77" + sha256: "37a42d06068e2fe3deddb2da079a8c4d105f241225ba27b7122b37e9865fd8f7" url: "https://pub.dev" source: hosted - version: "1.3.26" + version: "1.3.35" analyzer: dependency: transitive description: @@ -37,18 +37,18 @@ packages: dependency: transitive description: name: archive - sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" + sha256: "6bd38d335f0954f5fad9c79e614604fbf03a0e5b975923dd001b6ea965ef5b4b" url: "https://pub.dev" source: hosted - version: "3.4.10" + version: "3.6.0" args: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -101,10 +101,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" + sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" url: "https://pub.dev" source: hosted - version: "2.4.8" + version: "2.4.9" build_runner_core: dependency: transitive description: @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: built_value - sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb url: "https://pub.dev" source: hosted - version: "8.9.1" + version: "8.9.2" characters: dependency: transitive description: @@ -221,10 +221,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.8" dart_style: dependency: transitive description: @@ -301,10 +301,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "67bf0d5fd78f12f51c6b54a72f6141314136a1a90e98b1b7c45e7fac883254ed" + sha256: "26de145bb9688a90962faec6f838247377b0b0d32cc0abecd9a4e43525fc856c" url: "https://pub.dev" source: hosted - version: "2.27.1" + version: "2.32.0" firebase_core_platform_interface: dependency: transitive description: @@ -317,34 +317,34 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "5377eaac3b9fe8aaf22638d87f92b62784f23572e132dfc029195e84d6cb37de" + sha256: "43d9e951ac52b87ae9cc38ecdcca1e8fa7b52a1dd26a96085ba41ce5108db8e9" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.17.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: "34fac43b70d5c41dc864eeb52417128da1f68b0a48604a0c56cd3190f0f609b8" + sha256: a1662cc95d9750a324ad9df349b873360af6f11414902021f130c68ec02267c4 url: "https://pub.dev" source: hosted - version: "14.7.20" + version: "14.9.4" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "1dcf7d0d6776396bb2e488c53b0e4cc671c45a65717a73d881e52190d23aca3c" + sha256: "87c4a922cb6f811cfb7a889bdbb3622702443c52a0271636cbc90d813ceac147" url: "https://pub.dev" source: hosted - version: "4.5.28" + version: "4.5.37" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: ceabccf24d15d03c89dfd6c7eaef11c58fbf00b9c76ebc94028408943b8d2bfd + sha256: "0d34dca01a7b103ed7f20138bffbb28eb0e61a677bf9e78a028a932e2c7322d5" url: "https://pub.dev" source: hosted - version: "3.7.0" + version: "3.8.7" fixnum: dependency: transitive description: @@ -371,7 +371,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "085b4c8cb42e485c1c26a38caaffa334fc50362a" + resolved-ref: "0dc2628ae5a22887fcb0f3072cd065652739226d" url: "https://github.com/hemanthrajv/flutter_compass.git" source: git version: "0.8.0" @@ -419,10 +419,10 @@ packages: dependency: transitive description: name: flutter_local_notifications_platform_interface - sha256: "7cf643d6d5022f3baed0be777b0662cce5919c0a7b86e700299f22dc4ae660ef" + sha256: "340abf67df238f7f0ef58f4a26d2a83e1ab74c77ab03cd2b2d5018ac64db30b7" url: "https://pub.dev" source: hosted - version: "7.0.0+1" + version: "7.1.0" flutter_localizations: dependency: "direct main" description: flutter @@ -432,18 +432,18 @@ packages: dependency: "direct main" description: name: flutter_markdown - sha256: cb44f7831b23a6bdd0f501718b0d2e8045cbc625a15f668af37ddb80314821db + sha256: "04c4722cc36ec5af38acc38ece70d22d3c2123c61305d555750a091517bbe504" url: "https://pub.dev" source: hosted - version: "0.6.21" + version: "0.6.23" flutter_native_splash: dependency: "direct dev" description: name: flutter_native_splash - sha256: "558f10070f03ee71f850a78f7136ab239a67636a294a44a06b6b7345178edb1e" + sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0 url: "https://pub.dev" source: hosted - version: "2.3.10" + version: "2.4.0" flutter_rounded_date_picker: dependency: "direct main" description: @@ -474,10 +474,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "4.0.0" geolocator: dependency: "direct main" description: @@ -609,10 +609,10 @@ packages: dependency: transitive description: name: image - sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e" + sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" url: "https://pub.dev" source: hosted - version: "4.1.7" + version: "4.2.0" import_sorter: dependency: "direct dev" description: @@ -657,10 +657,10 @@ packages: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.9.0" leak_tracker: dependency: transitive description: @@ -801,26 +801,26 @@ packages: dependency: "direct main" description: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.4" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: @@ -856,12 +856,11 @@ packages: pdfx: dependency: "direct main" description: - path: "packages/pdfx" - ref: "4be9de9ffed5398fd7d5f44bbb07dcd3d3f1711b" - resolved-ref: "4be9de9ffed5398fd7d5f44bbb07dcd3d3f1711b" - url: "https://github.com/ScerIO/packages.flutter" - source: git - version: "2.5.0" + name: pdfx + sha256: c0f70ab6691b7cde02c0c204763a1edb2689ce245ac34eb629c66273a6aa1caf + url: "https://pub.dev" + source: hosted + version: "2.6.0" petitparser: dependency: transitive description: @@ -902,14 +901,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" - url: "https://pub.dev" - source: hosted - version: "3.7.4" pool: dependency: transitive description: @@ -930,10 +921,10 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.3.0" quiver: dependency: "direct main" description: @@ -946,10 +937,10 @@ packages: dependency: "direct main" description: name: screenshot - sha256: "5488135006b34529bf3765a7b1900ca94ccafca300c573550a0474a7162ebf95" + sha256: d448f43130f49bc7eead1b267b3ea0291cb2450f037bb0a0ecce7aa4c65e2aee url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.5.0" scroll_to_index: dependency: "direct main" description: @@ -1095,10 +1086,10 @@ packages: dependency: transitive description: name: timezone - sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0" + sha256: a6ccda4a69a442098b602c44e61a1e2b4bf6f5516e875bbf0f427d5df14745d5 url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.9.3" timing: dependency: transitive description: @@ -1167,34 +1158,34 @@ packages: dependency: transitive description: name: universal_platform - sha256: d315be0f6641898b280ffa34e2ddb14f3d12b1a37882557869646e0cc363d0cc + sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec" url: "https://pub.dev" source: hosted - version: "1.0.0+1" + version: "1.1.0" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" + sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e" url: "https://pub.dev" source: hosted - version: "6.2.5" + version: "6.2.6" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 + sha256: "17cd5e205ea615e2c6ea7a77323a11712dffa0720a8a90540db57a01347f9ad9" url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.3.2" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5" + sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89" url: "https://pub.dev" source: hosted - version: "6.2.5" + version: "6.3.0" url_launcher_linux: dependency: transitive description: @@ -1207,10 +1198,10 @@ packages: dependency: transitive description: name: url_launcher_macos - sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.2.0" url_launcher_platform_interface: dependency: transitive description: @@ -1223,10 +1214,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d" + sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" url_launcher_windows: dependency: transitive description: @@ -1287,26 +1278,26 @@ packages: dependency: transitive description: name: web_socket_channel - sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2" + sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.5" win32: dependency: transitive description: name: win32 - sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480" + sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" url: "https://pub.dev" source: hosted - version: "5.3.0" + version: "5.5.0" win32_registry: dependency: transitive description: name: win32_registry - sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" + sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.3" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 10248fe6..03e3d86c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.5.0+50 environment: - sdk: '>=2.18.0 <3.0.0' + sdk: '>3.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -65,14 +65,15 @@ dependencies: uni_links: ^0.5.1 uuid: ^4.4.0 intl: any + geolocator: ^12.0.0 + pdfx: ^2.6.0 # See https://github.com/ScerIO/packages.flutter/issues/448 - # pdfx: ^2.4.0 - pdfx: - git: - url: 'https://github.com/ScerIO/packages.flutter' - ref: '4be9de9ffed5398fd7d5f44bbb07dcd3d3f1711b' - path: packages/pdfx + # pdfx: + # git: + # url: 'https://github.com/ScerIO/packages.flutter' + # ref: '4be9de9ffed5398fd7d5f44bbb07dcd3d3f1711b' + # path: packages/pdfx # flutter_compass: ^0.7.0 flutter_compass: @@ -83,14 +84,15 @@ dependencies: here_sdk: path: plugins/here_sdk - geolocator: ^12.0.0 - + dev_dependencies: hive_generator: ^1.1.3 build_runner: ^2.3.0 flutter_launcher_icons: "^0.13.1" flutter_native_splash: ^2.2.19 import_sorter: ^4.6.0 + flutter_lints: ^2.0.0 + # flutter_gen: any # $ flutter pub run flutter_launcher_icons # $ flutter pub run flutter_native_splash:create @@ -100,8 +102,6 @@ dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 - # The following section is specific to Flutter packages. flutter: generate: true