diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..751d325 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Every request must be reviewed and accepted by: + +* @Gambley1 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..df73e56 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,14 @@ +# These are supported funding model platforms + +# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: EmilZulufov +open_collective: # Replace with a single Open Collective username +ko_fi: emilzulufov +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# polar: # Replace with a single Polar username +buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..3fbb6d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'fix: ' +labels: bug +assignees: '' + +--- + +**Description** + +A clear and concise description of what the bug is. + +**Steps To Reproduce** + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected Behavior** + +A clear and concise description of what you expected to happen. + +**Screenshots** + +If applicable, add screenshots to help explain your problem. + +**Additional Context** + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/build-system.md b/.github/ISSUE_TEMPLATE/build-system.md new file mode 100644 index 0000000..c9d9b70 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/build-system.md @@ -0,0 +1,16 @@ +--- +name: Build System +about: Changes that affect the build system or external dependencies +title: 'build: ' +labels: build +assignees: '' + +--- + +**Description** + +Describe what changes need to be done to the build system and why. + +**Requirements** + +- [ ] The build system is passing diff --git a/.github/ISSUE_TEMPLATE/chore.md b/.github/ISSUE_TEMPLATE/chore.md new file mode 100644 index 0000000..1c095b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/chore.md @@ -0,0 +1,16 @@ +--- +name: Chore +about: Other changes that don't modify src or test files +title: 'chore: ' +labels: chore +assignees: '' + +--- + +**Description** + +Clearly describe what change is needed and why. If this changes code then please use another issue type. + +**Requirements** + +- [ ] No functional changes to the code diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/continuous-integration.md b/.github/ISSUE_TEMPLATE/continuous-integration.md new file mode 100644 index 0000000..9288800 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/continuous-integration.md @@ -0,0 +1,16 @@ +--- +name: Continuous Integration +about: Changes to the CI configuration files and scripts +title: 'ci: ' +labels: ci +assignees: '' + +--- + +**Description** + +Describe what changes need to be done to the ci/cd system and why. + +**Requirements** + +- [ ] The ci system is passing diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000..6a498b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,16 @@ +--- +name: Documentation +about: Improve the documentation so all collaborators have a common understanding +title: 'docs: ' +labels: documentation +assignees: '' + +--- + +**Description** + +Clearly describe what documentation you are looking to add or improve. + +**Requirements** + +- [ ] Requirements go here diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..2820661 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: A new feature to be added to the project +title: 'feat: ' +labels: enhancement, feature +assignees: '' + +--- + +**Description** + +Clearly describe what you are looking to add. The more context the better. + +**Requirements** + +- [ ] Checklist of requirements to be fulfilled + +**Additional Context** + +Add any other context or screenshots about the feature request go here. diff --git a/.github/ISSUE_TEMPLATE/performance-update.md b/.github/ISSUE_TEMPLATE/performance-update.md new file mode 100644 index 0000000..8697cf7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/performance-update.md @@ -0,0 +1,16 @@ +--- +name: Performance Update +about: A code change that improves performance +title: 'perf: ' +labels: performance +assignees: '' + +--- + +**Description** + +Clearly describe what code needs to be changed and what the performance impact is going to be. Bonus point's if you can tie this directly to user experience. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/.github/ISSUE_TEMPLATE/refactor.md b/.github/ISSUE_TEMPLATE/refactor.md new file mode 100644 index 0000000..319ec16 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/refactor.md @@ -0,0 +1,16 @@ +--- +name: Refactor +about: A code change that neither fixes a bug nor adds a feature +title: 'refactor: ' +labels: refactor +assignees: '' + +--- + +**Description** + +Clearly describe what needs to be refactored and why. Please provide links to related issues (bugs or upcoming features) in order to help prioritize. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/.github/ISSUE_TEMPLATE/revert-commit.md b/.github/ISSUE_TEMPLATE/revert-commit.md new file mode 100644 index 0000000..8fa1640 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/revert-commit.md @@ -0,0 +1,18 @@ +--- +name: Revert Commit +about: Reverts a previous commit +title: 'revert: ' +labels: revert +assignees: '' + +--- + +**Description** + +Provide a link to a PR/Commit that you are looking to revert and why. + +**Requirements** + +- [ ] Change has been reverted +- [ ] No change in test coverage has happened +- [ ] A new ticket is created for any follow on work that needs to happen diff --git a/.github/ISSUE_TEMPLATE/style-changes.md b/.github/ISSUE_TEMPLATE/style-changes.md new file mode 100644 index 0000000..db34cbd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/style-changes.md @@ -0,0 +1,17 @@ +--- +name: Style Changes +about: Changes that do not affect the meaning of the code (white space, formatting, + missing semi-colons, etc) +title: 'style: ' +labels: style +assignees: '' + +--- + +**Description** + +Clearly describe what you are looking to change and why. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/.github/ISSUE_TEMPLATE/test.md b/.github/ISSUE_TEMPLATE/test.md new file mode 100644 index 0000000..93f074b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/test.md @@ -0,0 +1,16 @@ +--- +name: Test +about: Adding missing tests or correcting existing tests +title: 'test: ' +labels: test +assignees: '' + +--- + +**Description** + +List out the tests that need to be added or changed. Please also include any information as to why this was not covered in the past. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6b9372e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ + + +## Description + + + +## Type of Change + + + +- [ ] ✨ New feature (non-breaking change which adds functionality) +- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) +- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) +- [ ] 🧹 Code refactor +- [ ] ✅ Build configuration change +- [ ] 📝 Documentation +- [ ] 🗑️ Chore diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..c390ca5 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,99 @@ +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/app_ui" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/authentication_client/authentication_client" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/authentication_client/supabase_authentication_client" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/authentication_client/token_storage" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/chats_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/database_client" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/env" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/storage/storage" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/storage/secure_storage" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/storage/persistent_storage" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/firebase_remote_config_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/insta_blocks" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/instagram_blocks_ui" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/posts_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/powersync_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/search_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/shared" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/stories_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/notifications_client/notifications_client" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/notifications_client/firebase_notifications_client" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/notifications_repository" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/packages/user_repository" + schedule: + interval: "daily" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..d247405 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,17 @@ +name: ci + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: noop + run: echo 'noop' \ No newline at end of file diff --git a/.github/workflows/spell_checker.yaml b/.github/workflows/spell_checker.yaml new file mode 100644 index 0000000..cafd1a5 --- /dev/null +++ b/.github/workflows/spell_checker.yaml @@ -0,0 +1,19 @@ +name: spell_checker + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: zwaldowski/cspell-action@v1 + with: + paths: "**/*.{md,dart}" + config: .vscode/cspell.json + exclude: ".gitignore" diff --git a/.github/workflows/yandex_food_delivery_clone.yaml b/.github/workflows/yandex_food_delivery_clone.yaml new file mode 100644 index 0000000..60217dc --- /dev/null +++ b/.github/workflows/yandex_food_delivery_clone.yaml @@ -0,0 +1,62 @@ +name: yandex_food_delivery_clone + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + schedule: + - cron: "0 0 * * *" + pull_request: + paths: + - "lib/**" + - "test/**" + - "packages/**" + - "pubspec.yaml" + - ".github/workflows/yandex_food_delivery_clone.yaml" + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + channel: [stable] + + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2.16.0 + with: + channel: ${{matrix.channel}} + flutter-version: 3.22.0 + cache: false + + - name: Install Dependencies + run: | + flutter pub global activate very_good_cli + very_good packages get --recursive + + - name: Format + run: dart format --set-exit-if-changed lib test + + - name: Analyze + run: flutter analyze lib test + + - name: Verify Generated Files Committed + run: flutter test ./test/ensure_build_test.dart --run-skipped + + - name: Run tests + run: very_good test -x presubmit-only --coverage --test-randomize-ordering-seed random + + - name: Check for existing and non-empty coverage file + id: test_coverage_file + run: if [ -s "/coverage/lcov.info" ]; then echo "result=true" >> $GITHUB_OUTPUT ; else echo "result=false" >> $GITHUB_OUTPUT; fi + + - name: Very Good Coverage + if: steps.test_coverage_file.outputs.result == 'true' + uses: VeryGoodOpenSource/very_good_coverage@v3 + with: + path: "/coverage/lcov.info" diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 0000000..719342d --- /dev/null +++ b/.vscode/cspell.json @@ -0,0 +1,210 @@ +{ + "version": "0.2", + "enabled": true, + "language": "en", + "words": [ + "undismissable", + "abcdefghijklmnopqrstuvwxyz", + "ana", + "apiaryio", + "appicon", + "archs", + "env", + "insta", + "powersync", + "db", + "isDev", + "dev", + "gambley1", + "picker", + "assetcatalog", + "autocorrect", + "autoreleasing", + "baseflow", + "bitcode", + "bselwe", + "codemagic", + "codeowners", + "commandline", + "contador", + "crashlytics", + "cret", + "cupertino", + "Cybersecurity", + "dartanalyzer", + "dartfmt", + "deremer", + "deserializes", + "Dierberger", + "droppable", + "endtemplate", + "firebaserc", + "firestore", + "fluttercommunity", + "fluttergen", + "formz", + "futura", + "gainsboro", + "gapless", + "genhtml", + "gitkeep", + "googleapis", + "GPLAY", + "Grush", + "grygezt", + "Hollister", + "Hypatia", + "infoplist", + "intelli", + "intellij", + "iphoneos", + "iphonesimulator", + "jorgecoca", + "keychain", + "lbird", + "lcov", + "lerp", + "libc", + "lightbridge", + "localizable", + "loopback", + "ltrb", + "mailchimp", + "microtask", + "Microtasks", + "mjohnson", + "mjordan", + "mkdir", + "mockingjay", + "mocktail", + "Morant", + "mostrado", + "msgsend", + "multiline", + "negatable", + "nonnull", + "Noto", + "objc", + "onesignal", + "onone", + "página", + "passcode", + "passw", + "pbxproj", + "plist", + "plists", + "PNGs", + "precompiled", + "presubmit", + "pubspec", + "pubviz", + "Qubit", + "r'Encrypted", + "r'flutter", + "r'Serving", + "RGBO", + "routable", + "runpath", + "rxdart", + "scrollable", + "sdkroot", + "serializable", + "shollister", + "signup", + "Signup", + "Sonifications", + "Stepien", + "sublist", + "templating", + "textfield", + "texto", + "trdlzja", + "unawaited", + "unfocus", + "unfocuses", + "uppercased", + "uuid", + "vgstart", + "vsync", + "wholemodule", + "wifi", + "xcassets", + "xcbuild", + "xcconfig", + "xcode", + "Xcode", + "xcodeproj", + "xcscheme", + "xcschemes", + "xcshareddata", + "xcworkspace", + "xxlg", + "xxxlg", + "xxxs", + "xxxxs", + "debouncer", + "Tappable", + "supabase", + "emmiting", + "emmit", + "fullname", + "enteractions", + "inview", + "Swipeable", + "swipeable", + "unregister", + "emojies", + "LTWH", + "fullscreen", + "Snackbars", + "Controll", + "ARGB", + "Draggable", + "Shar", + "Searc", + "autofocus", + "Behaviour", + "unfollow", + "pallete", + "Scrollbar", + "pausable", + "autovalidate", + "flutterquickstart", + "unfollower", + "Jsons", + "reciever", + "oktoast", + "gridview", + "overscroll", + "precache", + "Octo", + "Cond", + "zulufov", + "blurhash", + "splitted", + "reclip", + "sqlite", + "upsert", + "retryable", + "Postgrest", + "Postgres", + "goptions", + "Typer", + "screenutil", + "Fluttertoast", + "bluefireteam", + "timeago", + "cameraswitch", + "appbar", + "prefetch", + "giffy", + "giphy", + "ccon", + "nodoc", + "ChildLayouter", + "Paginated", + "blazingly", + "Patreon" + ], + "ignorePaths": [".github/workflows/**"] +} diff --git a/lib/src/models/restaurant_details.dart b/lib/src/models/restaurant_details.dart index 4053b75..c44e268 100644 --- a/lib/src/models/restaurant_details.dart +++ b/lib/src/models/restaurant_details.dart @@ -257,8 +257,8 @@ class Periods { factory Periods.fromJson(Map json) { return Periods( - close: Close.fromJson(json['close'] as Map), - open: Open.fromJson(json['open'] as Map), + close: Close.fromJson(json['close'] as Map), + open: Open.fromJson(json['open'] as Map), ); } Close close; diff --git a/lib/src/services/repositories/local_storage/local_storage_repository.dart b/lib/src/services/repositories/local_storage/local_storage_repository.dart index 05460fa..7293fb6 100644 --- a/lib/src/services/repositories/local_storage/local_storage_repository.dart +++ b/lib/src/services/repositories/local_storage/local_storage_repository.dart @@ -6,8 +6,8 @@ import 'package:papa_burger/src/config/config.dart'; import 'package:papa_burger/src/models/models.dart'; import 'package:papa_burger/src/services/repositories/local_storage/local_storage.dart'; -/// [LocalStorageRepository] class, is made to maintain all the logic with -/// Local Storage with [Hive]. [Hive] helps to storage the data localy +/// [LocalStorageRepository] class, is made to maintain all the logic with +/// Local Storage with [Hive]. [Hive] helps to storage the data localy /// on the mobile devices in orders to user them offline and/or reuse data /// without fetching for it once or more times @immutable @@ -139,7 +139,7 @@ class LocalStorageRepository extends BaseLocalStorageRepository { ); } - /// Add global palce id of restaurant to cart, that helps to determine from + /// Add global palce id of restaurant to cart, that helps to determine from /// which restaurant item was added to prevent adding from the same restaurant @override void addPlaceId(String placeId) { @@ -151,7 +151,7 @@ class LocalStorageRepository extends BaseLocalStorageRepository { } /// After removing all items from cart, manualy removing all excisting ids - /// from storage and setting new value of 0, that means that no there is no + /// from storage and setting new value of 0, that means that no there is no /// items in the cart and any item from any restauraurant can be added. @override void setRestIdTo0() { diff --git a/lib/src/services/storage/local_storage.dart b/lib/src/services/storage/local_storage.dart index e986338..b124c1b 100644 --- a/lib/src/services/storage/local_storage.dart +++ b/lib/src/services/storage/local_storage.dart @@ -11,8 +11,8 @@ import 'package:shared_preferences/shared_preferences.dart' class LocalStorage { factory LocalStorage() => _instance; - LocalStorage._(); - + LocalStorage._(); + static final _instance = LocalStorage._(); late final SharedPreferences _prefs; diff --git a/lib/src/views/pages/cart/state/cart_state.dart b/lib/src/views/pages/cart/state/cart_state.dart index 3211b7f..e3e5242 100644 --- a/lib/src/views/pages/cart/state/cart_state.dart +++ b/lib/src/views/pages/cart/state/cart_state.dart @@ -19,6 +19,6 @@ class CartStateEmpty extends CartState { class CartStateWithItems extends CartState { const CartStateWithItems(this.cart); - + final Cart cart; } diff --git a/lib/src/views/pages/main/components/drawer/views/addresses/addresses.dart b/lib/src/views/pages/main/components/drawer/views/addresses/addresses.dart index e69de29..8b13789 100644 --- a/lib/src/views/pages/main/components/drawer/views/addresses/addresses.dart +++ b/lib/src/views/pages/main/components/drawer/views/addresses/addresses.dart @@ -0,0 +1 @@ + diff --git a/lib/src/views/pages/notification/state/notification_state.dart b/lib/src/views/pages/notification/state/notification_state.dart index 64e9d99..14d9457 100644 --- a/lib/src/views/pages/notification/state/notification_state.dart +++ b/lib/src/views/pages/notification/state/notification_state.dart @@ -1,7 +1,7 @@ // ignore_for_file: public_member_api_docs, sort_constructors_first part of 'notification_bloc.dart'; -enum ConnectionStatus { connected, disconnected} +enum ConnectionStatus { connected, disconnected } class NotificationState extends Equatable { const NotificationState._({