{"id":16462389,"url":"https://github.com/syntaxlexx/learning-flutter-riverpod","last_synced_at":"2026-03-05T09:03:47.447Z","repository":{"id":90395208,"uuid":"541239766","full_name":"syntaxlexx/learning-flutter-riverpod","owner":"syntaxlexx","description":"Riverpod State Mgmt for Flutter. StateProviders, StateNotifierProviders, FutureProviders, StreamProviders, autodisposed and families, and everything in-between.","archived":false,"fork":false,"pushed_at":"2022-12-22T20:56:43.000Z","size":13910,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T05:39:37.226Z","etag":null,"topics":["android","flutter","flutter-architecture","flutter-provider","provider-state-management","riverpod","riverpod-authentication","state-management"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syntaxlexx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-25T16:42:04.000Z","updated_at":"2025-06-05T06:38:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ca3e534-a0b2-49d6-b297-d50317aca877","html_url":"https://github.com/syntaxlexx/learning-flutter-riverpod","commit_stats":null,"previous_names":["lexxyungcarter/learning-flutter-riverpod"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/syntaxlexx/learning-flutter-riverpod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Flearning-flutter-riverpod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Flearning-flutter-riverpod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Flearning-flutter-riverpod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Flearning-flutter-riverpod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntaxlexx","download_url":"https://codeload.github.com/syntaxlexx/learning-flutter-riverpod/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Flearning-flutter-riverpod/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flutter","flutter-architecture","flutter-provider","provider-state-management","riverpod","riverpod-authentication","state-management"],"created_at":"2024-10-11T11:11:09.121Z","updated_at":"2026-03-05T09:03:47.425Z","avatar_url":"https://github.com/syntaxlexx.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Riverpod Learning/Reference zone\n\nA Null-Safety flutter project acting as a learning/code reference zone\n\nBased on\n- Riverpod (v1/v2)\n- Page Transitions\n- Math Expressions\n- Flex Color Scheme\n\n![Screenshot 1](_files/screenshot-1.jpg)\n![Screenshot 3](_files/screenshot-3.jpg)\n![Screenshot 2](_files/screenshot-2.jpg)\n\n### Resources\n1. [App Structure by Code With Andrea](https://codewithandrea.com/articles/flutter-app-architecture-riverpod-introduction/)\n2. [Feature-first or layer-first?](https://codewithandrea.com/articles/flutter-project-structure/)\n3. [Riverpod Docs](https://riverpod.dev/docs/getting_started/)\n\n## Getting Started\n\nThis project is a starting point for a Flutter application.\n\nA few resources to get you started if this is your first Flutter project:\n\n- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)\n- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)\n\nFor help getting started with Flutter development, view the\n[online documentation](https://docs.flutter.dev/), which offers tutorials,\nsamples, guidance on mobile development, and a full API reference.\n\n\u003e NB: To view Google Ads, switch to the `googleads` branch as it does not work with the `web` version.\n\n#### Launcher Icons\n```bash\nflutter pub run flutter_launcher_icons:main\n```\n\n#### Updating Splash Image\nUsing the `flutter_native_splash` package\n\n```bash\nflutter pub run flutter_native_splash:create\n```\n\n\n## Architecture/Project Structure\nThe base sturcture is based on **Code With Andrea's** app structure. It offers a sweet spot between **feature-first** and **Layer first** approach, which -honestly- makes a lot more sense. \n\nHowever, after building several prototypes (small quick apps), the structure feels augmented towards a *Bloc-like* architecture, where it begins to feel like there are too many files \u0026 folders for even the simplest of tasks.\n\nThe latest architecture features a *somewhat better and more flexible* architecture, offering a sweet spot between **feature-first**, **layer-first**, and **Code with Andreas's** architectures.\n\n\u003eNB: Check the real folder structure contained in this project for a better visual understanding.\n\nChanges include:\n- Renamed `presentation` -\u003e `ui`: No need to name the `presentation` layer `presentation`. It's too lengthy and what we hate as devs is writing too much!\n- Renamed `controllers` -\u003e `providers`. We're dealing with providers after all, aren't we?\n- Renamed `services` -\u003e `repositories`. However, if you prefer naming yours services, well and good. The key point here is be **CONSISTENT** in your project. We will use **repositories** as it's the most popular convention.\n- **StateNotifier** states(classes) moved from `providers` files to individual `models` folder.\n- `enums` moved to `data`. For a **Clean architecture**, it would be better keeping all enums on their own and not in providers. It becomes easier to maintain the project in the long run.\n- Merged `application`, `domain`, `controllers/providers` -\u003e `data`. Any state has been separated from the `ui`. Any piece of state/logic has been moved out of the `presentation`/`ui` folder.\n- Any form `TextEditingController` be used inside a `StatefulHookConsumerWidget` via `useTextEditingController`. **Riverpod Hooks** combined with **Flutter Hooks** are a fantastic way for handling such use-cases. Same goes for animations, pageControllers, e.t.c. found in the flutter hooks package. **Form Validation** can be done via the `validators` package, or for more complex validation, the *providers* can handle that (StateNotifiers) - Or however you deem fit :man_shrugging:\n- Inside the `ui`, any **Screen** must be suffixed with `Screen` e.g. `OrdersScreen`. Any other widget should be viewed as a `partial/widget/fragment` to the main screen, and, therefore, can be re-used multiple times in the entire project - not just by the feature. Screens, on the other hand, **cannot** be re-used in other widgets.\n- **Flexibility**: \n    - If a `feature` only requires a screen and a provider, the folder structure can then be:\n        - ui \n        - providers\n    - If a `feature` requires a screen, a provider, and a state/model/stateNotifier class, the folder structure can then be: \n        - ui\n        - data\n            - providers\n            - models\n    - If a `feature` requires a screen, a provider, a state/model/stateNotifier class, and enums, the folder structure can then be: \n        - ui\n        - data\n            - providers\n            - models\n            - enums\n    - If a `feature` requires a screen, a provider, a state/model/stateNotifier class, enum, and repository, the folder structure can then be: \n        - ui\n        - data\n            - providers\n            - models\n            - enums\n            - repositories\n            - exceptions\n\nFor apps that have an **admin** and **user** dashboard, this architecture gets in line with the following architecture:\n- main.dart\n- src\n    - app_routes.dart\n    - common_widgets\n    - utils\n    - features\n        - onboarding\n        - splash\n        - home\n        - auth\n        - admin\n            - dashboard \n            - orders \n            - invoices\n            - reports\n        - user\n            - dashboard\n            - orders\n            - cart\n            - invoices\n\nand each fature can then follow the guidelines above. The `ui` and `data` can now be tested individually.\n\n\u003eNB: Check the real folder structure contained in this project for a better visual understanding.\n\n### Links\n- [StopWatch](https://medium.com/flutter-community/flutter-riverpod-tutorial-timer-app-186d04637775)\n- [Trivia](https://youtube.com/watch?v=H2uEIRNM7TE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxlexx%2Flearning-flutter-riverpod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntaxlexx%2Flearning-flutter-riverpod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxlexx%2Flearning-flutter-riverpod/lists"}