From 6eef5a7dcf173eee75e0946dafe79d1673134836 Mon Sep 17 00:00:00 2001 From: Dmytro Turskyi Date: Sun, 11 Feb 2024 22:15:50 -0500 Subject: [PATCH] Add optional store scanner beep sound (#10) Signed-off-by: Dmytro Turskyi --- .github/workflows/flutter_ci.yml | 4 +- .vscode/settings.json | 16 ++++ README.md | 13 +-- android/app/src/main/AndroidManifest.xml | 12 +-- android/build.gradle | 13 ++- .../lib/src/gateways/settings_gateway.dart | 4 + .../get_sound_preference_use_case.dart | 10 +++ .../save_sound_preference_use_case.dart | 11 +++ components/core/use_cases/lib/use_cases.dart | 16 ++-- .../assets/audio/store_scanner_beep.mp3 | Bin 0 -> 25440 bytes .../lib/interface_adapters.dart | 1 + .../interface_adapters/lib/src/constants.dart | 2 + .../data_sources/local/local_data_source.dart | 4 + .../src/gateways/settings_gateway_impl.dart | 7 ++ .../src/ui/modules/home/home_presenter.dart | 2 +- .../lib/src/ui/modules/scan/scan_event.dart | 17 +++- .../src/ui/modules/scan/scan_presenter.dart | 51 ++++++++++- .../src/ui/modules/scan/scan_view_model.dart | 22 ++++- .../src/ui/modules/scan/view/scan_view.dart | 79 +++++++++++++----- components/interface_adapters/pubspec.yaml | 2 + ios/Podfile.lock | 19 +++++ .../local/local_data_source_impl.dart | 13 +++ lib/di/dependencies.dart | 25 ++++-- lib/di/injector.dart | 60 +++++++++++++ lib/localization_delelegate_getter.dart | 27 ++++++ lib/main.dart | 74 ++-------------- lib/res/enums/settings.dart | 3 +- lib/routes/router.dart | 26 ++++-- pubspec.lock | 16 ++++ pubspec.yaml | 4 +- test/dependencies_scope_test.dart | 2 +- test/dependencies_test.dart | 4 +- 32 files changed, 421 insertions(+), 138 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 components/core/use_cases/lib/src/use_cases/get_sound_preference_use_case.dart create mode 100644 components/core/use_cases/lib/src/use_cases/save_sound_preference_use_case.dart create mode 100644 components/interface_adapters/assets/audio/store_scanner_beep.mp3 create mode 100644 components/interface_adapters/lib/src/constants.dart create mode 100644 lib/di/injector.dart create mode 100644 lib/localization_delelegate_getter.dart diff --git a/.github/workflows/flutter_ci.yml b/.github/workflows/flutter_ci.yml index efc6222..032367b 100644 --- a/.github/workflows/flutter_ci.yml +++ b/.github/workflows/flutter_ci.yml @@ -1,8 +1,8 @@ name: Build & upload to Firebase App Distribution on: push: - branches: - - six + branches-ignore: + - master jobs: build_apk: diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c70d979 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "spellright.language": [ + "en" + ], + "spellright.documentTypes": [ + "markdown", + "latex", + "plaintext", + "Log" + ], + "spellright.parserByClass": { + "Log": { + "parser": "plain" + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 7fb69e5..386509c 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,13 @@ The app allows you to customize your preferences based on various criteria, such as human rights, environmental impact, animal well-being, and more. The app uses the data from various sources, such as -* [Open Food Facts](https://world.openfoodfacts.org); -* [Ukrainian national agency on corruption prevention | INTERNATIONAL SPONSORS OF WAR](https://sanctions.nazk.gov.ua/en/boycott/); -* [Yale chief executive leadership institute| List of Companies + +- [Open Food Facts](https://world.openfoodfacts.org); +- [Ukrainian national agency on corruption prevention | INTERNATIONAL SPONSORS OF WAR](https://sanctions.nazk.gov.ua/en/boycott/); +- [Yale chief executive leadership institute | List of Companies Leaving and Staying in Russia](https://www.yalerussianbusinessretreat.com/); -[U.S. bureau of counterterrorism | State Sponsors of Terrorism](https://www.state.gov/state-sponsors-of-terrorism/); -* [Global Forum Against Terrorism](https://www.gfatf.org/threats/countries-who-support-terrorism/). +- [U.S. bureau of counterterrorism | State Sponsors of Terrorism](https://www.state.gov/state-sponsors-of-terrorism/); +- [European Parliament](https://www.europarl.europa.eu/delegations/en/recognising-the-russian-federation-as-a-/product-details/20221124DPU34521). The app aims to help you shop with confidence and conscience. For more information, please visit the project website at https://ethical-scanner.turskyi.com. @@ -66,7 +67,7 @@ Ethical Scanner is an open source project and welcomes contributions from anyone If you want to contribute to Ethical Scanner, you can follow these steps: - Fork this repository and clone it to your local machine. -- Create a new branch for your feature or bugfix. +- Create a new branch for your feature or bug-fix. - Make your changes and commit them with a clear and descriptive message. - Push your branch to your forked repository and create a pull request to the main repository. - Wait for your pull request to be reviewed and merged. diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0aead8a..ee67c8f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,9 +1,9 @@ - + package="com.turskyi.ethical_scanner" + android:versionCode="7" + android:versionName="0.0.7"> + @@ -25,7 +25,7 @@ android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:windowSoftInputMode="adjustResize" - tools:ignore="UnusedAttribute"> + tools:ignore="Instantiatable,UnusedAttribute">