Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

fix: redo state management with riverpod and models with freezed #22

Merged
merged 14 commits into from
Mar 9, 2024

Conversation

abhigyantrips
Copy link
Member

This PR rebuilds the state management utilized by the previous implementation, with flutter_riverpod and completes the past models using freezed_annotations, which handles pretty much all the JSON function creation and linting automatically. Some of the changes include:

  1. Shifting controllers completely to per-view directory, with their respective providers created with Riverpod.
  2. Shifting models completely to per-view directory, utilizing Freezed for functionality and ease of use.
  3. Adding custom_lint for both Riverpod and Freezed, with comments of the respective commands required to build them.
  4. Removing 'repositories' completely and handling them through the controllers themselves (could do a separate services/ directory, but don't think that is required as of now).
  5. [Extra] Change the GNav from google_nav_bar with the normal NavigationBar from Material 3, for the consistency and accessibility. Gonna add a backdrop filter to it for flair, still experimenting with that.

@abhigyantrips abhigyantrips added 🔨 goal: fix To fix bugs and other issues 💻 type: code For repository code related to the project labels Mar 9, 2024
@abhigyantrips
Copy link
Member Author

Also yeah this involuntarily closes #14 lol

@abhigyantrips abhigyantrips linked an issue Mar 9, 2024 that may be closed by this pull request
@abhigyantrips abhigyantrips self-assigned this Mar 9, 2024
@abhigyantrips
Copy link
Member Author

Was having an issue with the ContributorsController before, turns out the GitHub API returns the fields in snake_case while our properties are in camelCase. Thank the lords that JsonSerializable exists and all it required was a change in the fieldRename property.

The contributors' view is fixed, still need to finish up the current implementation of EventsView, but that might be a part of another PR as we need to completely redo the current model and fetching (since we're replacing Sanity with our own API).

Hence, merging changes for now. :)

@abhigyantrips abhigyantrips merged commit 904cdca into main Mar 9, 2024
@abhigyantrips
Copy link
Member Author

This is what the app looks like as of now.

Record_2024-03-09-13-35-18.mp4

@abhigyantrips abhigyantrips deleted the fix/state-management branch March 9, 2024 08:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 type: code For repository code related to the project 🔨 goal: fix To fix bugs and other issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(models): create models for frequently used objects
1 participant