Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #931 - displaying the history in dialog instead of log print #983

Merged
merged 25 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
66a4f82
Merge pull request #20 from openfoodfacts/develop
monsieurtanuki Jan 3, 2022
a6ed5fe
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 3, 2022
f1eb63f
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 3, 2022
dd4338a
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 4, 2022
1811829
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 4, 2022
8b14423
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 4, 2022
52b8ae3
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 5, 2022
96bb3f1
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 6, 2022
7840c45
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 6, 2022
241785b
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 6, 2022
edd46be
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 7, 2022
7e6f576
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 8, 2022
32c1433
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 9, 2022
6cc8541
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 10, 2022
d680373
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 10, 2022
c0ea17d
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 13, 2022
b257696
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 13, 2022
2555a12
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 13, 2022
077a938
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 14, 2022
c264e7f
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 14, 2022
f568686
Merge branch 'openfoodfacts:develop' into develop
monsieurtanuki Jan 17, 2022
04e879c
feat: #931 - displaying the history in dialog instead of log print
monsieurtanuki Jan 18, 2022
eb8e5d1
feat: #931 - some desperate fixes
monsieurtanuki Jan 18, 2022
3117be7
feat: #931 - some desperate fixes
monsieurtanuki Jan 18, 2022
c4da83d
feat: #931 - pubspec tap dancing
monsieurtanuki Jan 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion packages/smooth_app/lib/pages/user_preferences_dev_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,42 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
await DaoProductList(localDatabase).export(
ProductList.history(),
);
debugPrint('exported history: $export', wrapWidth: 80);
final List<Widget> children = <Widget>[];
for (final String barcode in export.keys) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Instead of export can this be named something else, example: barcodeToProductMap to be more descriptive, just looking at export makes you have to go read the declaration to find out what it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually if it's named barcodeToProductMap it would look like something interesting. It is not; it's just a debug method.
How should we name methods when they're for debug purposes? debugExport?

final bool? exists = export[barcode] as bool?;
children.add(
ListTile(
leading: Icon(exists == null
? Icons.error
: exists
? Icons.check
: Icons.help_outline),
title: Text(barcode),
subtitle: Text(exists == null
? 'exception'
: exists
? 'product found'
: 'product NOT found'),
),
);
}
showDialog<void>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('export history'),
content: SizedBox(
height: 400,
width: 300,
child: ListView(children: children),
),
actions: <Widget>[
ElevatedButton(
child: Text(AppLocalizations.of(context)!.okay),
onPressed: () => Navigator.pop(context),
),
],
),
);
},
),
];
Expand Down
120 changes: 88 additions & 32 deletions packages/smooth_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "32.0.0"
version: "33.0.0"
after_layout:
dependency: transitive
description:
Expand All @@ -21,7 +21,7 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.1.0"
archive:
dependency: transitive
description:
Expand All @@ -42,7 +42,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -70,7 +70,7 @@ packages:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.1.3"
version: "8.1.4"
camera:
dependency: "direct main"
description:
Expand All @@ -84,7 +84,7 @@ packages:
name: camera_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.4"
camera_web:
dependency: transitive
description:
Expand All @@ -105,7 +105,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -190,6 +190,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
device_info_plus_linux:
dependency: transitive
description:
name: device_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
device_info_plus_macos:
dependency: transitive
description:
name: device_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0+1"
device_info_plus_web:
dependency: transitive
description:
name: device_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
device_info_plus_windows:
dependency: transitive
description:
name: device_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
device_preview:
dependency: "direct main"
description:
Expand Down Expand Up @@ -269,7 +311,7 @@ packages:
name: flutter_native_splash
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
version: "1.3.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down Expand Up @@ -356,7 +398,7 @@ packages:
name: fwfh_text_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
version: "2.7.2"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -412,7 +454,7 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
version: "3.1.1"
image_cropper:
dependency: "direct main"
description:
Expand All @@ -433,14 +475,14 @@ packages:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "2.1.5"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.4.3"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -503,7 +545,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
matomo:
dependency: "direct main"
description:
Expand Down Expand Up @@ -552,7 +594,7 @@ packages:
name: openfoodfacts
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
version: "1.11.1"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -650,28 +692,28 @@ packages:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "2.1.5"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.5"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.5"
pedantic:
dependency: transitive
description:
Expand All @@ -686,6 +728,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.4.0"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "8.3.0"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -790,28 +846,28 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
version: "2.0.12"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
version: "2.0.10"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.9"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.4"
shared_preferences_macos:
dependency: transitive
description:
Expand All @@ -832,14 +888,14 @@ packages:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.4"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -907,7 +963,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.3"
transparent_image:
dependency: transitive
description:
Expand Down Expand Up @@ -963,21 +1019,21 @@ packages:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
version: "6.0.14"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
version: "6.0.14"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
url_launcher_macos:
dependency: transitive
description:
Expand All @@ -998,7 +1054,7 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.6"
url_launcher_windows:
dependency: transitive
description:
Expand All @@ -1019,7 +1075,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
visibility_detector:
dependency: "direct main"
description:
Expand All @@ -1040,7 +1096,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.3"
version: "2.3.6"
wkt_parser:
dependency: transitive
description:
Expand Down Expand Up @@ -1070,5 +1126,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
dart: ">=2.15.1 <3.0.0"
flutter: ">=2.6.0-0"
Loading