From a86f29f4e8ca5e27ebf00ee46daf011e322e3eca Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Fri, 29 Nov 2024 20:27:12 +0100 Subject: [PATCH 1/2] Upgrade off-dart --- packages/smooth_app/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smooth_app/pubspec.yaml b/packages/smooth_app/pubspec.yaml index a5256ab59f4..d77edb54198 100644 --- a/packages/smooth_app/pubspec.yaml +++ b/packages/smooth_app/pubspec.yaml @@ -99,7 +99,7 @@ dependencies: path: ../scanner/zxing - openfoodfacts: 3.17.1 + openfoodfacts: 3.18.0 # openfoodfacts: # path: ../../../openfoodfacts-dart From bf32c5f1f95e81bdda66bc5bf8901c8dd7637efe Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sat, 30 Nov 2024 09:06:12 +0100 Subject: [PATCH 2/2] Fix null issues --- packages/smooth_app/lib/database/dao_osm_location.dart | 5 +++-- packages/smooth_app/lib/pages/locations/osm_location.dart | 6 +++--- packages/smooth_app/lib/pages/prices/price_model.dart | 4 ++-- packages/smooth_app/pubspec.lock | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/smooth_app/lib/database/dao_osm_location.dart b/packages/smooth_app/lib/database/dao_osm_location.dart index a3f6ccae4ac..f9ba432881e 100644 --- a/packages/smooth_app/lib/database/dao_osm_location.dart +++ b/packages/smooth_app/lib/database/dao_osm_location.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:smooth_app/database/abstract_sql_dao.dart'; import 'package:smooth_app/database/local_database.dart'; @@ -95,7 +96,7 @@ class DaoOsmLocation extends AbstractSqlDao { localDatabase.database.delete( _table, where: '$_columnId = ? AND $_columnType = ?', - whereArgs: [osmLocation.osmId, osmLocation.osmType.offTag], + whereArgs: [osmLocation.osmId!, osmLocation.osmType!.offTag], ); /// Returns all the [OsmLocation]s, ordered by descending last access. @@ -121,7 +122,7 @@ class DaoOsmLocation extends AbstractSqlDao { _table, { _columnId: osmLocation.osmId, - _columnType: osmLocation.osmType.offTag, + _columnType: osmLocation.osmType!.offTag, _columnLongitude: osmLocation.longitude, _columnLatitude: osmLocation.latitude, _columnName: osmLocation.name, diff --git a/packages/smooth_app/lib/pages/locations/osm_location.dart b/packages/smooth_app/lib/pages/locations/osm_location.dart index d66733e76c9..23d97e500c2 100644 --- a/packages/smooth_app/lib/pages/locations/osm_location.dart +++ b/packages/smooth_app/lib/pages/locations/osm_location.dart @@ -32,8 +32,8 @@ class OsmLocation { osmKey = location.osmKey, osmValue = location.osmValue; - final int osmId; - final LocationOSMType osmType; + final int? osmId; + final LocationOSMType? osmType; final double longitude; final double latitude; final String? name; @@ -95,5 +95,5 @@ class OsmLocation { return result.toString(); } - String get primaryKey => '${osmType.offTag}$osmId'; + String get primaryKey => '${osmType!.offTag}$osmId'; } diff --git a/packages/smooth_app/lib/pages/prices/price_model.dart b/packages/smooth_app/lib/pages/prices/price_model.dart index c4193e077de..805dedf02dd 100644 --- a/packages/smooth_app/lib/pages/prices/price_model.dart +++ b/packages/smooth_app/lib/pages/prices/price_model.dart @@ -220,8 +220,8 @@ class PriceModel with ChangeNotifier { // proof display cropObject: cropParameters!, // per receipt - locationOSMId: location!.osmId, - locationOSMType: location!.osmType, + locationOSMId: location!.osmId!, + locationOSMType: location!.osmType!, date: date, proofType: proofType, currency: currency, diff --git a/packages/smooth_app/pubspec.lock b/packages/smooth_app/pubspec.lock index a361a63c91c..406ffb608bc 100644 --- a/packages/smooth_app/pubspec.lock +++ b/packages/smooth_app/pubspec.lock @@ -1076,10 +1076,10 @@ packages: dependency: "direct main" description: name: openfoodfacts - sha256: "0ad8ac186a09427d74567460bbcdb1a984afd2558a172afaab87825f0bfec026" + sha256: "2a2076e5190e4b573ce5326cd4981ebdefa33c57c0507ca0057c57c12b79c47a" url: "https://pub.dev" source: hosted - version: "3.17.1" + version: "3.18.0" openfoodfacts_flutter_lints: dependency: "direct dev" description: