Sports Changelog
2025/07/31 clubs-05 – rudsonalves
Separate athlete and manager club getters and refine view logic
This commit refactors the club user case and view model to clearly distinguish between athlete and manager clubs. It updates the clubs view to consume these new getters directly, replacing the generic selection method and inlining role-based branching. These changes enhance clarity and maintainability by aligning property names and UI logic with user roles.
Modified Files
- lib/domain/use_cases/club_user_case.dart
- Renamed
myClubsgetter toathleteClubsfor clarity. - Added
managerClubsgetter filtering clubs bymanagerUid == user.uid.
- Renamed
- lib/ui/view/home/clubs/clubs_view.dart
- Removed the
_selectClubs()helper and its switch. - Introduced inline role-based logic under
ClubsViewEnum.myClubs:- If
UserRole.athlete, useviewModel.athleteClubs; return child widget when empty. - Otherwise, use
viewModel.managerClubs; return child widget when empty.
- If
- Adjusted
ClubsViewEnum.nearbycase to inlineviewModel.nearbyClubswith empty-list fallback.
- Removed the
- lib/ui/view/home/clubs/clubs_view_model.dart
- Renamed
myClubsgetter toathleteClubs. - Added
managerClubsgetter mapping to the use case.
- Renamed
Conclusions
All club retrieval and rendering logic now cleanly supports both athlete and manager roles. The system remains fully functional.
2025/07/31 clubs-04 – rudsonalves
Refactor club logic to use UserModel and add specialized list widgets
This commit replaces raw userId strings with a UserModel across repositories, use cases, services, and routing. It streamlines initialization and fetch flows, strengthens error handling, and updates the database service API to use uids. Additionally, it enhances the UI by introducing specialized list view widgets for athletes, managers, and nearby clubs, and refactors the clubs view to switch between these based on user role.
Modified Files
- lib/data/repositories/clubs/club_repository.dart
- Replaced
_userId: String?with_user: UserModel?, updating theinitialize,fetch,fetchAll, andlogoutsignatures and logic. - Updated
myClubs, delete checks, and_loadAllRemoteto referenceuser.uidand respectuser.role. - Refactored
initializeto callfetchAlland handleSuccess/Failurevia aswitchstatement. - Renamed parameters from
idtouidinfetchand bulk-fetch methods; added caching on successful fetch. - Added null-check guard in
_loadAllRemoteand improved logging on failures.
- Replaced
- lib/data/repositories/clubs/i_club_repository.dart
- Imported
UserModeland changedinitializeto accept aUserModelinstead ofuserId. - Updated
fetchsignature to useuidand adjusted documentation.
- Imported
- lib/data/services/database/i_database_service.dart
- Renamed
idsparameters and documentation touidsinfetchByIds.
- Renamed
- lib/data/services/database/supabase_database_service.dart
- Updated
fetchByIdsimplementation to useuidsand.inFilter('id', uids).
- Updated
- lib/domain/use_cases/club_manager_user_case.dart
- Imported
UserModeland changed constructor to acceptuser: UserModelinstead ofuserId. - Updated
_addressRepository.initializeand_clubRepository.initializecalls to passuser.uidoruser. - Removed redundant
userId.isEmptyvalidation.
- Imported
- lib/domain/use_cases/club_user_case.dart
- Imported
UserModeland replaceduserId/rolefields with a singleuser: UserModel. - Updated getters (
otherClubs) and initialization calls to useuser.uidanduser.role. - Introduced
_myClubsUidsand_nearbyClubsUidslists for tracking and fetching favorites and nearby clubs.
- Imported
- lib/routing/router.dart
- Standardized imports to absolute paths.
- Changed route view model initializations to pass
user: context.read<IUserRepository>().user!instead of separateuidandrole.
- lib/ui/core/ui/texts/parse_rich_text.dart
- Expanded the regex to capture newline characters and adjusted
TextSpanlogic to render line breaks correctly.
- Expanded the regex to capture newline characters and adjusted
- lib/ui/view/club_manager/club_editor/club_editor_view_model.dart
- Fixed import path for
ClubManagerUserCase. - Updated
userIdgetter to return_clubUserCase.user.uid.
- Fixed import path for
- lib/ui/view/home/clubs/clubs_view.dart
- Added imports for
parseRichTextand the new widget files. - Renamed
_selectedFavto_selectedPageand listener callbacks to_onLoadNearbyClubs. - Merged listenables (
fetchNearbyClubsandload) in theListenableBuilder. - Replaced manual list building with a
switchon_selectedPage, renderingAthleteListView,ManagerListView, orNearbyListViewbased on role and selection. - Updated FAB visibility logic to reference
_selectedPage.
- Added imports for
- lib/ui/view/home/clubs/clubs_view_model.dart
- Imported
enums_declarationsandAffiliate. - Added
userRole,myClubs, andaffiliateOfgetters. - Renamed
clubDistanceOfto acceptclubUid.
- Imported
- test/data/repositories/clubs/remote_club_repository_test.dart
- Changed
late String userIdtolate UserModel user. - Updated setup to assign
user = UserModel(...)and callrepoClubs.initialize(user). - Adjusted
admin.deleteUserand club creation to useuser.uid.
- Changed
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Mirrored changes from club tests: replaced
userIdwithUserModel userand initialization calls.
- Mirrored changes from club tests: replaced
- test/domain/use_cases/address_club_user_case_test.dart
- Changed
userIdtoUserModel user, updated initialization, use case constructor, and cleanup calls to useuser.uid.
- Changed
New Files
- lib/ui/view/home/clubs/widgets/athlete_list_view.dart
- Introduces
AthleteListViewto display clubs for athletes, showing status and sport viaparseRichText.
- Introduces
- lib/ui/view/home/clubs/widgets/manager_list_view.dart
- Adds
ManagerListViewfor managers to browse their clubs with formatted descriptions.
- Adds
- lib/ui/view/home/clubs/widgets/nearby_list_view.dart
- Implements
NearbyListViewto list nearby clubs with distance metrics and formatted details.
- Implements
Conclusions
All changes complete and the club features now fully leverage UserModel for clearer logic, with dedicated list view widgets integrated.
2025/07/31 clubs-03 – rudsonalves
Refactor club repos, functions caching, enums, and integrate affiliate support
This commit renames and restructures various club repository methods and interfaces, updates the functions repository caching logic to use a new SearchedLocation DTO, and integrates affiliate support across domain and UI layers. It also standardizes enum names for club views, adjusts import paths, removes obsolete DTOs, and aligns naming consistency throughout the app.
Modified Files
- lib/data/repositories/clubs/club_repository.dart
- Reordered
package:loggingimport for consistency. - Renamed
allClubsgetter toclubs. - Changed
clubFromCacheById(String id)toclubUid(String uid)and updated related_cacheKey. - Renamed
fetchByIdstofetchByUids.
- Reordered
- lib/data/repositories/clubs/i_club_repository.dart
- Renamed
allClubstoclubs. - Added
Club? clubUid(String uid);signature. - Removed deprecated
clubFromCacheById. - Renamed
fetchByIdstofetchByUids.
- Renamed
- lib/data/repositories/functions/functions_repository.dart
- Replaced
LastSearchedimport and type usage withSearchedLocation. - Added
_lastRadiusInMetersfield to track radius. - Updated caching logic to leverage
isWithinand radius comparisons. - Adjusted logging import position.
- Replaced
- lib/domain/dto/last_search.dart
- Deleted obsolete
LastSearchedDTO.
- Deleted obsolete
- lib/domain/enums/enums_declarations.dart
- Renamed
FavClubsPageEnumtoClubsViewEnumand updated labels.
- Renamed
- lib/domain/use_cases/club_user_case.dart
- Imported
IAffiliateRepository, enums, and affiliate model. - Added
roleandaffiliateRepositoryparameters to constructor. - Renamed getters and methods from
allClubs/fetchByIds/clubFromCacheByIdto useclubs/fetchByUids/clubUid. - Integrated affiliate initialization and conditional club fetching.
- Imported
- lib/routing/router.dart
- Updated import from
clubs_viewmodel.darttoclubs_view_model.dart. - Passed
roleandaffiliateRepositoryintoClubUserCase.
- Updated import from
- lib/ui/view/home/clubs/club_details/club_details_view.dart
- Adjusted import path for
app_snack_bar.dartto use relative path.
- Adjusted import path for
- lib/ui/view/home/clubs/clubs_view.dart
- Updated import to
clubs_view_model.dart. - Renamed state variables and enums:
FavClubsPageEnum→ClubsViewEnum,distance→_distance. - Refactored method names and widget references accordingly.
- Updated import to
- lib/ui/view/home/clubs/clubs_view_model.dart
- Renamed
allClubsgetter toclubs.
- Renamed
- lib/ui/view/home/clubs/widgets/selection_fav_clubs.dart
- Renamed
SelectionFavClubstoSelectionClubsView. - Replaced all
FavClubsPageEnumreferences withClubsViewEnum.
- Renamed
New Files
- lib/domain/dto/search_location.dart
- Introduces
SearchedLocationDTO with Haversine formula for distance checks.
- Introduces
Conclusions
All updates are complete and the system remains functional with consistent naming and improved caching and affiliate logic.
2025/07/31 clubs-02 – rudsonalves
Rename and restructure club manager views and use cases
This commit refactors the club management feature by unifying naming conventions, consolidating use case classes, and updating routing and view logic. View files under the club_manager directory have been renamed and their import paths adjusted. The deprecated ClubManagerUserCase has been removed in favor of a generalized ClubUserCase and a new FavClubUserCase in main_club_user_case.dart. Enum labels and router configurations have been updated to reflect these changes.
Modified Files
- lib/ui/view/club_manager/clubs_view.dart → club_manager_view.dart
- Renamed
clubs_view.darttoclub_manager_view.dartto clarify its purpose.
- Renamed
- lib/ui/view/club_manager/clubs_view_model.dart → club_manager_view_model.dart
- Renamed
clubs_view_model.darttoclub_manager_view_model.dart. - Updated import from
/domain/use_cases/club_user_case.dartto/domain/use_cases/club_manager_user_case.dart.
- Renamed
- lib/domain/enums/enums_declarations.dart
- Renamed
FavClubsPageEnum.favoritestoFavClubsPageEnum.selectedto better describe the “selected” tab.
- Renamed
- lib/domain/use_cases/club_manager_user_case.dart
- Deleted obsolete
ClubManagerUserCase, consolidating its logic intoClubUserCase.
- Deleted obsolete
- lib/domain/use_cases/club_user_case.dart
- Added imports for geocoding, storage, scheduling, and coordinate models.
- Replaced
IFunctionsRepositorydependency withIStorageRepository,IScheduleRepository, andIGeocodingRepository. - Refactored methods for loading, fetching, adding, updating, and deleting clubs to include schedule handling and logo processing.
- Introduced
_processLogohelper for uploading and deleting club logos.
- lib/routing/router.dart
- Updated imports: replaced
club_user_case.dartwithmain_club_user_case.dartandclub_manager_user_case.dartwithclub_user_case.dart. - Adjusted route builders to use
FavClubUserCasefor favorite clubs andClubUserCasefor manager views.
- Updated imports: replaced
- lib/ui/view/club_manager/club_editor/club_editor_view_model.dart
- Switched view model dependency from
ClubManagerUserCasetoClubUserCase.
- Switched view model dependency from
- lib/ui/view/club_manager/club_manager_view_model.dart
- Switched view model dependency from
ClubManagerUserCasetoClubUserCase.
- Switched view model dependency from
- lib/ui/view/home/clubs/clubs_view.dart
- Updated conditional checks and switch cases: replaced
FavClubsPageEnum.favoriteswithFavClubsPageEnum.selected.
- Updated conditional checks and switch cases: replaced
- lib/ui/view/home/clubs/clubs_viewmodel.dart
- Updated import to
/domain/use_cases/main_club_user_case.dart. - Changed constructor parameter from
ClubUserCasetoFavClubUserCase.
- Updated import to
- lib/ui/view/home/clubs/widgets/selection_fav_clubs.dart
- Updated UI mapping to select
FavClubsPageEnum.selectedinstead offavorites.
- Updated UI mapping to select
- test/domain/use_cases/address_club_user_case_test.dart
- Updated test setup: replaced instantiation of
ClubManagerUserCasewithClubUserCase.
- Updated test setup: replaced instantiation of
New Files
- lib/domain/use_cases/main_club_user_case.dart
- Introduces
FavClubUserCaseto handle favorite and nearby club logic, including methods for loading all clubs, fetching individual clubs, and retrieving nearby clubs viaIFunctionsRepository.
- Introduces
Conclusions
All components have been renamed and refactored; the application compiles and runs with the updated domain and view logic.
2025/07/31 clubs-01 – rudsonalves
Refactor repository imports, rename ClubsView, and add notification services
This commit refactors import statements in the club repository and router to use absolute paths. It renames the main clubs view and its viewmodel for improved clarity. It also introduces new services and interfaces for authentication and notifications, including Firebase-specific implementations and helpers.
Modified Files
- lib/data/repositories/clubs/club_repository.dart
- Changed relative imports for
i_database_service.dartandi_cache_service.dartto absolute paths (/data/services/...).
- Changed relative imports for
- lib/routing/router.dart
- Updated imports: replaced
main_clubs_view.dartwithclubs_view.dartandmain_clubs_viewmodel.dartwithclubs_viewmodel.dart.
- Updated imports: replaced
- lib/ui/view/home/clubs/main_clubs_view.dart → lib/ui/view/home/clubs/clubs_view.dart
- Renamed file and updated class name to
ClubsView. - Removed unused
Dimensimport and localcolorSchemevariable. - Reformatted constructor parameters with trailing commas for readability.
- Wrapped
ListView.builderinExpandedto ensure proper layout. - Replaced
OverflowBarwithPositionedwidgets for floating action buttons.
- Renamed file and updated class name to
- lib/ui/view/home/clubs/main_clubs_viewmodel.dart → lib/ui/view/home/clubs/clubs_viewmodel.dart
- Renamed file from
main_clubs_viewmodel.darttoclubs_viewmodel.dartwithout content changes.
- Renamed file from
New Files
- lib/data/services/auth_service/auth_service.dart: Implements the authentication service interface for user login and registration.
- lib/data/services/firebase_notification/firebase_notification_service.dart: Provides a service to send and receive Firebase push notifications.
- lib/data/services/firebase_notification/i_firebase_notification_service.dart: Defines the contract for Firebase notification operations.
- lib/data/services/firebase_notification/sports_notification_helper.dart: Contains helper functions for formatting and scheduling sports-related notifications.
- lib/data/services/notification/i_notification_service.dart: Declares a generic interface for notification services.
- lib/data/services/notification/notification_service.dart: Implements the generic notification service, delegating to underlying providers.
Conclusions
All changes are complete and the system is fully functional.
2025/07/31 renaming-03 – rudsonalves
Rename MainClubsView and MainClubsViewModel to ClubsView and ClubsViewModel
This commit refactors the main clubs feature by renaming the MainClubsView widget and its corresponding view model to ClubsView and ClubsViewModel. All import paths, route definitions, and class references have been updated to reflect the new directory structure under ui/view/home/clubs and maintain consistency across the codebase.
Modified Files
- lib/routing/router.dart
- Updated import statements for club details, events, main clubs, and profile views to use relative paths under
ui/view/home/clubs. - Renamed the routed widget and view model from
MainClubsView/MainClubsViewModeltoClubsView/ClubsViewModelin thefavClubsroute builder.
- Updated import statements for club details, events, main clubs, and profile views to use relative paths under
- lib/ui/view/home/clubs/main_clubs_view.dart
- Renamed
MainClubsViewclass toClubsView, including constructor and state class (_MainClubsViewState→_ClubsViewState). - Updated the
viewModeltype fromMainClubsViewModeltoClubsViewModel.
- Renamed
- lib/ui/view/home/clubs/main_clubs_viewmodel.dart
- Renamed
MainClubsViewModelclass toClubsViewModel. - Updated the constructor name to match the
ClubsViewModelclass.
- Renamed
Conclusions
Refactoring complete and the club listing feature remains fully functional.
2025/07/31 renaming-02 – rudsonalves
Remove FavClubs repository and restructure club management architecture
This commit removes the deprecated favorite‐clubs repository and interface, consolidates favorite‐club logic into a unified main‐club use case, and reorganizes routing, providers, and UI components under a cohesive club management structure.
Modified Files
- lib/config/providers/provide_repositories.dart
- Removed imports for
fav_clubs_repository.dartandi_fav_clubs_repository.dart - Deleted
Provider<IFavClubsRepository>registration
- Removed imports for
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart (deleted)
- Deleted entire
FavClubsRepositoryimplementation
- Deleted entire
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart (deleted)
- Removed
IFavClubsRepositoryinterface
- Removed
- lib/domain/use_cases/fav_club_user_case.dart → lib/domain/use_cases/main_club_user_case.dart
- Renamed file and moved to
main_club_user_case.dart - Renamed class from
FavClubUserCasetoFavClubUserCasein new context - Removed constructor dependency on
IFavClubsRepositoryand all favorite-clubs logic - Adjusted imports and logging initialization
- Renamed file and moved to
- lib/routing/router.dart
- Updated import paths to use
/home/clubs/and/club_manager/directories - Replaced
FavClubsView/FavClubsViewModelwithMainClubsView/MainClubsViewModel - Removed affiliate sub-route and
IFavClubsRepositoryreferences - Updated routes for club editor, club members, and club manager views
- Updated import paths to use
- lib/ui/view/home/events_view/events_view.dart → lib/ui/view/home/events/events_view.dart
- Moved events view into
home/eventsdirectory
- Moved events view into
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart → lib/ui/view/home/clubs/club_details/club_details_view.dart
- Relocated
club_details_view.dartinto newhome/clubs/club_detailspath - Updated all widget imports to relative paths in the new directory
- Relocated
- lib/ui/view/home/fav_clubs/club_details/club_details_view_model.dart → lib/ui/view/home/clubs/club_details/club_details_view_model.dart
- Moved view model file into
home/clubs/club_details
- Moved view model file into
- lib/ui/view/home/fav_clubs/club_details/widgets/club_header.dart → lib/ui/view/home/clubs/club_details/widgets/club_header.dart
- Updated file path to match new directory
- lib/ui/view/home/fav_clubs/club_details/widgets/description_row.dart → lib/ui/view/home/clubs/club_details/widgets/description_row.dart
- lib/ui/view/home/fav_clubs/club_details/widgets/location_row.dart → lib/ui/view/home/clubs/club_details/widgets/location_row.dart
- lib/ui/view/home/fav_clubs/club_details/widgets/monthly_fee_row.dart → lib/ui/view/home/clubs/club_details/widgets/monthly_fee_row.dart
- lib/ui/view/home/fav_clubs/club_details/widgets/reorderable_pos_list.dart → lib/ui/view/home/clubs/club_details/widgets/reorderable_pos_list.dart
- lib/ui/view/home/fav_clubs/club_details/widgets/schedule_row.dart → lib/ui/view/home/clubs/club_details/widgets/schedule_row.dart
- lib/ui/view/home/fav_clubs/club_details/widgets/show_positions_dialog.dart → lib/ui/view/home/clubs/club_details/widgets/show_positions_dialog.dart
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart → lib/ui/view/home/clubs/main_clubs_view.dart
- Renamed class
FavClubsViewtoMainClubsView - Updated constructor signature and state class name
- Renamed class
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart → lib/ui/view/home/clubs/main_clubs_viewmodel.dart
- Renamed view model class to
MainClubsViewModel - Updated import for
main_club_user_case.dart
- Renamed view model class to
- lib/ui/view/home/fav_clubs/widgets/select_distance.dart → lib/ui/view/home/clubs/widgets/select_distance.dart
- lib/ui/view/home/fav_clubs/widgets/selection_fav_clubs.dart → lib/ui/view/home/clubs/widgets/selection_fav_clubs.dart
- lib/ui/view/home/fav_clubs/club_details/affiliate/affiliate_view.dart (deleted)
- Removed affiliate UI for club details
- lib/ui/view/home/fav_clubs/club_details/affiliate/affiliate_view_model.dart (deleted)
- Deleted empty
AffiliateViewModel
- Deleted empty
- lib/ui/view/home/profile_view/profile_view.dart → lib/ui/view/home/profile/profile_view.dart
- Moved profile view into
home/profiledirectory
- Moved profile view into
- lib/ui/view/clubs/register_club/register_club_view.dart → lib/ui/view/club_manager/club_editor/club_editor_view.dart
- Renamed view to
ClubEditorViewand updated state class - Updated import and type of view model
- Renamed view to
- lib/ui/view/clubs/register_club/register_club_view_model.dart → lib/ui/view/club_manager/club_editor/club_editor_view_model.dart
- Renamed view model to
ClubEditorViewModel
- Renamed view model to
- lib/ui/view/clubs/register_club/widgets/dismissible_club_card.dart → lib/ui/view/club_manager/club_editor/widgets/dismissible_club_card.dart
- lib/ui/view/clubs/register_club/widgets/schedule_page.dart → lib/ui/view/club_manager/club_editor/widgets/schedule_page.dart
- lib/ui/view/clubs/manager_club/manager_club_view.dart → lib/ui/view/club_manager/club_members/club_members_view.dart
- Renamed view to
ClubMembersViewand moved toclub_members
- Renamed view to
- lib/ui/view/clubs/manager_club/manager_club_view_model.dart (deleted)
- Removed obsolete view model
- lib/ui/view/clubs/clubs_view.dart → lib/ui/view/club_manager/clubs_view.dart
- Renamed view to
ClubManagerView
- Renamed view to
- lib/ui/view/clubs/clubs_view_model.dart → lib/ui/view/club_manager/clubs_view_model.dart
- Renamed view model to
ClubManagerViewModel
- Renamed view model to
New Files
- lib/ui/view/club_manager/club_members/club_members_view_model.dart
- Added placeholder
ClubMembersViewModelfor managing club member UI logic
- Added placeholder
Conclusions
All legacy favorite‐clubs code has been removed and the club management feature set has been fully reorganized under a clearer, modular structure.
2025/07/30 notifications-02 – rudsonalves
Change affiliate position to positions array and wire notification service
This commit refactors the affiliate data model to support multiple positions by replacing the single position field with a positions array. It updates repository interfaces, DTOs, model mapping, tests, and SQL migrations accordingly. Additionally, it integrates the FirebaseNotificationService into the dependency graph, adjusts core service providers, and updates UI and routing to handle affiliate requests. The changes ensure end-to-end functionality for multi-position affiliates and notification workflows.
Modified Files
- android/build.gradle.kts
- Downgrade
com.google.gms.google-servicesplugin from version4.4.3to4.3.15.
- Downgrade
- docs/images/diagrama de classes Sports.drawio
- Adjust diagram dimensions (
dx,dy) and remove obsolete edge offsets, updating point coordinates.
- Adjust diagram dimensions (
- lib/config/dependencies.dart
- Import and initialize
FirebaseNotificationServiceand inject intoprovideCoreServices.
- Import and initialize
- lib/config/providers/provide_core_services.dart
- Update
provideCoreServicessignature to receiveIFirebaseNotificationServiceand use the passednotificationServiceinstance.
- Update
- lib/data/repositories/affiliate/affiliate_repository.dart
- Rename getter
affiliatetoaffiliates.
- Rename getter
- lib/data/repositories/affiliate/common/affiliate_key.dart
- Validate cache key prefix against
Tables.affiliates.nameinstead of raw string.
- Validate cache key prefix against
- lib/data/repositories/affiliate/i_affiliate_repository.dart
- Rename interface getter
affiliatetoaffiliates.
- Rename interface getter
- lib/data/services/database/database_service.dart
- Add logging before insert operations and change
.insert(...).single()to.maybeSingle().
- Add logging before insert operations and change
- lib/domain/dto/affiliate_dto.dart
- Update import paths for enums and add new
AffiliateCreateDtoclass.
- Update import paths for enums and add new
- lib/domain/enums/enums_sports_positions.dart
- Implement
enumNamegetter and staticbyNamemethods for all position enums.
- Implement
- lib/domain/models/affiliate.dart
- Replace
positionwithList<SportPosition> positions; update constructor type checks, mapping functions (_convertPositionsToStrings,_convertStringsToPositions), JSON serialization, addfromDtoconstructor, and adjustcopyWith.
- Replace
- lib/domain/use_cases/club_user_case.dart
- Add import for
package:logging/logging.dart.
- Add import for
- lib/routing/router.dart
- Inject
ClubAffiliationUseCaseinto the affiliate view route and importINotificationRepository.
- Inject
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- Add listener for
createAffiliateRequest, replace direct repository calls with command execution, update UI button toFilledButton.icon, handle request state with_createAffiliateRequestand_onCreateAffiliateRequestmethods, and importAppSnackBar.
- Add listener for
- lib/ui/view/home/fav_clubs/club_details/club_details_view_model.dart
- Inject
ClubAffiliationUseCase, remove directIAffiliateRepositorydependency, and addcreateAffiliateRequestcommand.
- Inject
- lib/ui/view/home/home_view.dart
- Clean up imports, remove debug
ICacheServicecode, and reorganize import order.
- Clean up imports, remove debug
- test/data/repositories/affiliate/affiliate_repository_test.dart
- Update tests to expect
positions(List) instead ofposition.
- Update tests to expect
New Files
- lib/domain/use_cases/club_affiliated_user_case.dart
- Use case for handling affiliate requests and sending notifications via
INotificationRepository.
- Use case for handling affiliate requests and sending notifications via
- supabase/migrations/20250730171817_change_position_to_positions_array.sql
- Migration script to convert
positioncolumn topositionstext array, defaulting to empty, and drop the old column.
- Migration script to convert
Conclusions
All changes are complete, and the system supports multi-position affiliates with integrated notification services.
2025/07/30 notifications-01 – rudsonalves
Add Firebase Cloud Messaging support and FlutterFire setup
This commit configures FlutterFire in the Android settings and initializes Firebase in the main application. It integrates Firebase Cloud Messaging (FCM) by registering the notification service and repository providers, updating authentication readiness, and adding necessary migrations and configuration files.
Modified Files
- android/settings.gradle.kts
- Added
com.google.gms.google-servicesplugin for FlutterFire configuration within the pluginManagement block.
- Added
- pubspec.yaml
- Added
firebase_core: ^4.0.0as a direct dependency.
- Added
- lib/config/providers/provide_core_services.dart
- Imported
IFirebaseNotificationServiceandFirebaseNotificationService. - Registered
Provider<IFirebaseNotificationService>with disposal logic.
- Imported
- lib/config/providers/provide_repositories.dart
- Imported
INotificationRepositoryandNotificationRepository. - Registered
Provider<INotificationRepository>in the repository provider list.
- Imported
- lib/data/services/auth_service/auth_service.dart
- Added
@overrideannotation to theisReadygetter inAuthService.
- Added
- lib/main.dart
- Imported
firebase_options.dartand calledFirebase.initializeAppwithDefaultFirebaseOptionsin a new_firebaseInitializationmethod. - Updated
mainto await Firebase initialization before auth setup.
- Imported
New Files
- docs/firebase_notifications.md: Documentation detailing FCM integration steps, service and repository architecture, database migration, and usage examples.
- firebase.json: FlutterFire CLI configuration mapping for Android, iOS, and web Firebase options.
- lib/data/repositories/notification/i_notification_repository.dart: Interface defining notification repository contract for sending and subscribing to notifications.
- lib/data/repositories/notification/notification_repository.dart: Implementation of
INotificationRepositoryusing theIFirebaseNotificationServicefor message dispatch. - lib/data/services/firebase_notification/i_firebase_notification_service.dart: Interface specifying FCM service methods for initialization, token management, messaging, and topic subscriptions.
- lib/data/services/firebase_notification/firebase_notification_service.dart: Concrete implementation of
IFirebaseNotificationServicewithFirebaseMessaging, background handler, token refresh, and Supabase integration for token storage. - lib/firebase_options.dart: Generated
FirebaseOptionsfor each supported platform by the FlutterFire CLI. - supabase/migrations/20250730120000_create_user_fcm_tokens_table.sql: SQL migration to create
user_fcm_tokenstable with RLS policies and indices for FCM token storage.
Conclusions
The Firebase notification framework and FlutterFire setup are now fully integrated and the system is functional.
2025/07/30 notifications-00 – rudsonalves
Integrate Firebase services, update Android configs, and add architecture docs
This commit integrates Firebase configuration and dependencies into the Android build, refines project namespace and plugin versions, removes outdated assets, and introduces comprehensive MVVM architecture documentation.
Modified Files
- android/app/build.gradle.kts
- Imported
org.gradle.api.tasks.compile.JavaCompileand suppressed obsolete option warnings. - Replaced
kotlin-androidplugin withorg.jetbrains.kotlin.android. - Applied
com.google.gms.google-servicesplugin. - Added Firebase BoM, Analytics, and Cloud Messaging dependencies.
- Updated
namespaceandapplicationIdtobr.dev.rralves.sports. - Set
minSdkexplicitly to 23. - Moved
keyAliasandkeyPasswordassignments under thereleasesigning config.
- Imported
- android/app/src/main/kotlin/br/dev/rralves/sports/sports/MainActivity.kt
- Renamed folder and package declaration from
br.dev.rralves.sports.sportstobr.dev.rralves.sports.
- Renamed folder and package declaration from
- android/build.gradle.kts
- Added
com.google.gms.google-servicesplugin declaration (version 4.4.3) in the root plugins block.
- Added
- android/settings.gradle.kts
- Updated Kotlin Android plugin version to
2.2.0.
- Updated Kotlin Android plugin version to
- docs/Pendeicias.md → docs/Pendencias.md
- Renamed file to correct spelling of “Pendencias”.
- docs/images/MVVM.svg
- Removed outdated MVVM diagram SVG.
New Files
- docs/Architecture.md Introduces detailed MVVM architecture documentation, covering data, domain, and UI layers, project file structure, and tooling choices.
Assets and Test Data
- android/app/google-services.json Added Firebase Android configuration file for project
sports-6cb1f, including API key and OAuth settings.
Conclusions
All changes are applied and the project configuration is updated and fully functional.
2025/07/29 affiliate-07 – rudsonalves
Enable selectable and reorderable positions in club details
This commit introduces interactive position selection and ordering in the club details view, refactors import organization, and updates asynchronous initialization. Users can now open a dialog to choose positions, reorder their selections via drag-and-drop, and confirm affiliation with a dedicated action button.
Modified Files
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- Added imports for
AppFontsStyle,BigButton,ReorderablePosList, andShowPositionsDialog - Replaced static checkbox list with a
TextButtonthat opens the positions dialog - Integrated
ReorderablePosListwidget to display selected positions - Added
BigButtonfor the “Affiliar” action with custom styling and icon - Changed
_initializetoFuture<void>and added a 1-second delay before invoking the view model - Popped the dialog before clearing and repopulating
_positionsin the club load callback - Implemented
Future<void> _showPositionsDialog()to handle dialog presentation, result processing, and state update
- Added imports for
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- Reorganized and corrected imports to use the project’s routing path and grouped Flutter/GoRouter/Icons imports
- Updated
_loadNearbyClubssignature toFuture<void>for consistency with asynchronous operations
New Files
- lib/ui/view/home/fav_clubs/club_details/widgets/reorderable_pos_list.dart
- Stateful widget displaying a dismissible, drag-and-drop list of
SportPositionitems - Uses
ReorderableListView.builderwithDismissiblecards and a custom background for removal
- Stateful widget displaying a dismissible, drag-and-drop list of
- lib/ui/view/home/fav_clubs/club_details/widgets/show_positions_dialog.dart
- Presents an alert dialog listing all available positions
- Allows multi-select via tap, highlights selected items, and returns the new selection on confirmation
Conclusions
The position selection and reordering workflow is now fully implemented, providing a seamless UI for users to choose and order their preferred sports positions.
2025/07/29 affiliate-06 – rudsonalves
Refactor AuthService initialization and unify club location handling
This commit introduces a comprehensive refactor in how the AuthService is initialized and injected, replacing static initialization with dependency injection and ensuring it is ready before app launch. It also unifies the access to club data through a new view clubs_with_location, removing the need for dynamic select clause transformations in the database layer.
Modified Files
- lib/config/dependencies.dart
- Updated the
dependencies()function to acceptAuthServiceas a parameter and pass it down toprovideCoreServices.
- Updated the
- lib/config/providers/provide_core_services.dart
- Replaced inline instantiation of
AuthServicewith injected instance. - Updated logger and DI creation functions for consistency.
- Replaced inline instantiation of
- lib/data/repositories/auth/auth_repository.dart
- Renamed internal stream subscription variable for clarity.
- Renamed methods
loginandlogouttosignInandsignOut.
- lib/data/repositories/auth/dev_auth_repository.dart
- Renamed mock methods
loginandlogouttosignInandsignOut.
- Renamed mock methods
- lib/data/repositories/auth/i_auth_repository.dart
- Renamed abstract methods
loginandlogouttosignInandsignOut.
- Renamed abstract methods
- lib/data/repositories/clubs/club_repository.dart
- Replaced all references to
Tables.clubswithTables.clubsWithLocation. - Adjusted logging and caching keys accordingly.
- Replaced all references to
- lib/data/repositories/common/server_names.dart
- Introduced new enum value
clubsWithLocationreplacingclubs.
- Introduced new enum value
- lib/data/services/auth_service/auth_service.dart
- Refactored Supabase initialization to be explicit in
main.dart. - Improved logging and added
isReadyproperty to check initialization state. - Added better error handling to
fetchUser.
- Refactored Supabase initialization to be explicit in
- lib/data/services/auth_service/i_auth_service.dart
- Declared
isReadyin theIAuthServiceinterface.
- Declared
- lib/data/services/database/database_service.dart
- Removed dynamic SQL manipulation of
locationfields anddefSelect. - Simplified all
select()queries.
- Removed dynamic SQL manipulation of
- lib/domain/models/club.dart
- Updated location mapping from
locationtolocation_text.
- Updated location mapping from
- lib/domain/use_cases/account_management_user_case.dart
- Updated method calls from
login/logouttosignIn/signOut.
- Updated method calls from
- lib/main.dart
- Fully refactored to initialize Supabase before creating
AuthService. - Injects
AuthServiceinto dependencies. - Wrapped initialization in a try-catch with fallback UI on failure.
- Fully refactored to initialize Supabase before creating
- test/data/repositories/address/remote_address_repository_test.dart
- test/data/repositories/affiliate/affiliate_repository_test.dart
- test/data/repositories/auth/remote_auth_repository_test.dart
- test/data/repositories/clubs/remote_club_repository_test.dart
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- test/data/repositories/storage/remote_storage_repository_test.dart
- test/data/services/remote_storage_service_test.dart
- test/data/services/supabase_auth_service_test.dart
- test/domain/use_cases/address_club_user_case_test.dart
- All test files updated to initialize Supabase explicitly and construct
AuthServicemanually after client creation. - Renamed usage of
login/logouttosignIn/signOut.
- All test files updated to initialize Supabase explicitly and construct
New Files
- lib/utils/auth_debug.dart
- New utility class
AuthDebugto assist in debuggingAuthServicestate, including log outputs and a visual widget for UI inspection.
- New utility class
- supabase/migrations/20250729173734_clubs_with_location_view.sql
- Migration script to create the
clubs_with_locationview, addinglocation_textviaST_AsText(location)for easier app mapping.
- Migration script to create the
Conclusions
The authentication service lifecycle is now correctly controlled via DI, and club data access is unified through a consistent view. The codebase is cleaner, more robust, and easier to test.
2025/07/29 affiliate-05 – rudsonalves
Refactor: Replace table and column strings with enhanced enums
This commit refactors the codebase to improve maintainability and type safety by replacing raw string literals representing table names and column keys with enhanced enums. It also renames the user_info.dart file to user_model.dart and adjusts imports accordingly.
Modified Files
- lib/data/repositories/address/address_repository.dart
- Updated cache and DB access to use
Tables.addresses.nameandAddressesTableColumns.userId.name. - Adjusted import order for consistency and correctness.
- Updated cache and DB access to use
- lib/data/repositories/affiliate/affiliate_repository.dart
- Replaced direct string keys with
AffiliatesTableColumnsenum.nameaccess.
- Replaced direct string keys with
- lib/data/repositories/affiliate/common/affiliate_key.dart
- Updated
toMapto use enum.nameproperties for keys.
- Updated
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Replaced all raw strings with
Tables.billingInfo.name.
- Replaced all raw strings with
- lib/data/repositories/clubs/club_repository.dart
- Updated cache and DB access using
Tables.clubs.nameandClubsTableColumns.managerId.name.
- Updated cache and DB access using
- lib/data/repositories/common/server_names.dart
- Refactored all table and column definitions to use Dart enhanced enums with
namefields. - Added optional metadata such as
haveLocationtoTables.
- Refactored all table and column definitions to use Dart enhanced enums with
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Replaced string literals with appropriate enum
.namevalues for table and column names.
- Replaced string literals with appropriate enum
- lib/data/repositories/schedule/schedule_repository.dart
- Updated table and column usage to use enums with
.name.
- Updated table and column usage to use enums with
- lib/data/repositories/user/i_user_repository.dart
- Changed import from
user_info.darttouser_model.dart.
- Changed import from
- lib/data/repositories/user/user_repository.dart
- Replaced references to
Tables.userswithTables.users.name. - Adjusted import from
user_info.darttouser_model.dart.
- Replaced references to
- lib/data/services/database/database_service.dart
- Updated all methods to accept
Tablesenum instead of string. - Handled conditional SQL selection (
defSelect) based onhaveLocationmetadata. - Enhanced logging with table name inclusion using
.name.
- Updated all methods to accept
- lib/data/services/database/i_database_service.dart
- Refactored all method signatures to use
Tablesenum instead of raw strings.
- Refactored all method signatures to use
- lib/domain/models/address.dart
- Fixed
copyWithmethod: renameduserIdparameter touserUidto avoid shadowing.
- Fixed
- lib/domain/models/user_info.dart → lib/domain/models/user_model.dart
- File renamed with no content changes.
- lib/domain/use_cases/account_management_user_case.dart
- Updated bucket usage to
Buckets.<value>.name. - Adjusted import from
user_info.darttouser_model.dart.
- Updated bucket usage to
- lib/domain/use_cases/address_user_user_case.dart
- Removed commented delay line for cleanliness.
- lib/domain/use_cases/club_user_case.dart
- Applied
.nameto bucket values fromBucketsenum.
- Applied
- lib/ui/core/ui/drawer/main_drawer.dart
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- lib/ui/view/home/home_view_model.dart
- lib/ui/view/splash/splash_view_model.dart
- lib/ui/view/user_register/user_resister_view.dart
- lib/ui/view/user_register/user_resister_view_model.dart
- Updated all imports from
user_info.darttouser_model.dart.
- Updated all imports from
- test/data/repositories/address/remote_address_repository_test.dart
- test/data/repositories/clubs/remote_club_repository_test.dart
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- test/data/repositories/storage/remote_storage_repository_test.dart
- test/data/repositories/user/remote_user_repository_test.dart
- test/domain/use_cases/address_club_user_case_test.dart
- Updated usage of table names and user model imports to align with the enum and filename changes.
Renamed Files
- lib/domain/models/user_info.dart → lib/domain/models/user_model.dart
- Reflects new naming convention aligned with model content.
Conclusions
All references to table and column identifiers now use enum-based values, enhancing readability and reducing potential for typos. This refactor also aligns file naming with domain model conventions. The system remains functional and more robust against future schema changes.
2025/07/29 affiliate-04 – rudsonalves
Refactor result handling and streamline repository providers
This commit replaces fold-based result handling with exhaustive switch–case constructs across repositories, use cases, and UI views to improve clarity and consistency. It standardizes all imports to absolute paths and updates the provider configuration to include the new IAffiliateRepository. Additionally, the command and result utility classes have been cleaned up by removing obsolete methods and documentation comments.
Modified Files
- lib/config/providers/provide_repositories.dart
- Reordered import statements, moving
providerpackage imports below domain and service imports. - Added imports for
I AffiliateRepositoryandAffiliateRepository. - Registered
Provider<IAffiliateRepository>withAffiliateRepositoryin the repository providers list.
- Reordered import statements, moving
- lib/data/repositories/auth/auth_repository.dart
- Changed
CacheServiceimport to absolute path (/data/services/cache_database/cache_service.dart). - Replaced
result.fold()with aswitchonSuccess/Failurefor theloginmethod.
- Changed
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Refactored fold-based logging into
switchonSuccess/Failure, addedbreakstatements. - Enhanced log messages to indicate successful initialization explicitly.
- Refactored fold-based logging into
- lib/domain/use_cases/account_management_user_case.dart
- Simplified
logout,login,signUp,add,update, and avatar methods by replacingfold()calls withswitchstatements or conditional checks. - Improved error handling flow and unified log message formatting.
- Simplified
- lib/domain/use_cases/theme_user_case.dart
- Replaced fold-based logic in theme loading and toggling with
switchonSuccess/Failure. - Clarified log messages and removed redundant error parameters.
- Replaced fold-based logic in theme loading and toggling with
- lib/routing/router.dart
- Normalized import paths to absolute style for affiliate repository and view models.
- Adjusted parameter ordering for
ClubDetailsViewto match constructor signature.
- lib/ui/view/address/address_register/address_register_view.dart
- Imported
package:sports/utils/result.dart. - Converted
result.fold()callbacks into aswitchfor navigation and error handling.
- Imported
- lib/ui/view/billinginfo/billinginfo_view.dart
- Added import for
package:sports/utils/result.dart. - Introduced listener and handler for the
fetchAddresscommand, extracting_onFetchAddressmethod. - Refactored save and load callbacks from
fold()toswitch, updating snack bars and navigation logic.
- Added import for
- lib/ui/view/billinginfo/billinginfo_view_model.dart
- Updated imports to absolute paths.
- Changed
fetchAddressfrom a rawFuturefunction to aCommand1instance and adjusted initialization accordingly.
- lib/ui/view/clubs/clubs_view_model.dart
- Swapped
fold()patterns for early-return checks onisFailure, logging warnings and consolidating success logs.
- Swapped
- lib/ui/view/clubs/register_club/register_club_view.dart
- Imported
package:sports/utils/result.dart. - Replaced
result.fold()withswitchstatements to handle form submission outcomes.
- Imported
- lib/ui/view/clubs/register_club/register_club_view_model.dart
- Refactored load, fetchClub, addClub, updateClub, and deleteClub methods: replaced
fold()withswitch, enhanced log messages with contextual data.
- Refactored load, fetchClub, addClub, updateClub, and deleteClub methods: replaced
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- Standardized imports to absolute paths and added missing enum imports.
- Introduced
_positions,_isAffiliated, form key, and dynamic position selection UI. - Removed deprecated
_navBacknavigation and implemented_onInitializelistener for data loading.
- lib/ui/view/home/fav_clubs/club_details/club_details_view_model.dart
- Adjusted imports to absolute paths.
- lib/ui/view/home/home_view.dart
- Imported
package:sports/utils/result.dart. - Converted logout
fold()logic into aswitch, showing an error snack on failure.
- Imported
- lib/ui/view/sign_in/sign_in_view.dart
- Normalized imports to absolute style.
- Refactored sign-in result handling from
fold()toswitch.
- lib/ui/view/sign_up/sign_up_view.dart
- Standardized imports and replaced fold-based sign-up flow with
switchhandling.
- Standardized imports and replaced fold-based sign-up flow with
- lib/ui/view/splash/splash_view.dart
- Added import of
package:sports/utils/result.dart. - Transformed
fold()navigation logic into aswitchfor fetchUser outcomes.
- Added import of
- lib/ui/view/splash/splash_view_model.dart
- Updated fetchUser logic from
fold()toswitch, improved log statements.
- Updated fetchUser logic from
- lib/ui/view/user_register/user_resister_view.dart
- Imported
package:sports/utils/result.dart. - Switched from fold-based to
switchhandling for registration results.
- Imported
- lib/utils/commands.dart
- Removed obsolete
clearResultmethod and associated documentation comments. - Cleaned up
Commandclass comments to focus on core execution functionality.
- Removed obsolete
- lib/utils/result.dart
- Removed the
fold()method and related documentation blocks to simplify theResultAPI.
- Removed the
Conclusions
All changes are complete and the system remains fully functional.
2025/07/25 affiliate-03 – rudsonalves
Refactor User and Club Models and Services for UID Consistency
This commit introduces a significant refactor to unify and standardize the naming convention across all domain models and services by replacing all instances of id with uid. This change improves clarity and alignment with authentication identifiers (UIDs), especially when integrating with external providers like Supabase.
Additionally, service provider modules were consolidated and renamed to reduce fragmentation, and UI routing and rendering logic for affiliate operations were moved and restructured for better maintainability.
Modified Files
- .vscode/settings.json
- Changed default TypeScript formatter.
- Added file associations and open command for
.drawiofiles. - Set default file language to plaintext.
- Makefile
- Replaced deprecated
npx supabasecalls with nativesupabaseCLI commands.
- Replaced deprecated
- docs/images/diagrama de classes Sports.drawio
- Updated Draw.io version metadata and layout properties for consistency.
- lib/config/dependencies.dart
- Removed
provide_others_services.dartandprovide_geo_services.dart. - Added new consolidated
provide_utils_services.dart.
- Removed
- lib/config/providers/provide_core_services.dart
- Added
disposecallback forAuthService.
- Added
- lib/config/providers/provide_others_services.dart
- Deleted: functionality merged into
provide_utils_services.dart.
- Deleted: functionality merged into
- lib/config/providers/provide_geo_services.dart → provide_utils_services.dart
- Renamed and merged with others services.
- Now also provides
IFunctionsServiceandIViaCepService.
- lib/data/repositories/address/address_repository.dart
- Replaced all usage of
idwithuid.
- Replaced all usage of
- lib/data/repositories/address/i_address_repository.dart
- Updated documentation to reflect
uidusage.
- Updated documentation to reflect
- lib/data/repositories/affiliate/affiliate_repository.dart
- Refactored
clubIdandathleteIdtoclubUidandathleteUid. - Modified
initialize()andfetchClub()to support multiple club UIDs. - Adjusted caching keys and logic.
- Refactored
- lib/data/repositories/affiliate/i_affiliate_repository.dart
- Updated method signatures and documentation to reflect UID usage and new DTO.
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Switched to use
uidandaddressUid.
- Switched to use
- lib/data/repositories/clubs/club_repository.dart
- Refactored
managerId,id, andaddressIdtomanagerUid,uid, andaddressUid.
- Refactored
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Aligned
userIdandclubIdtouserUidandclubUid.
- Aligned
- lib/data/repositories/schedule/schedule_repository.dart
- Switched to use
clubUidanduid.
- Switched to use
- lib/data/repositories/user/i_user_repository.dart
- Replaced all references to
UserInfowithUserModel.
- Replaced all references to
- lib/data/repositories/user/user_repository.dart
- Renamed model from
UserInfotoUserModel. - Updated all cache and database access logic.
- Renamed model from
- lib/data/services/auth_service/auth_service.dart
- Added missing
dispose()method to clean up resources properly.
- Added missing
- lib/data/services/commom/functions.dart → functions.dart.legated
- File renamed for legacy tagging.
- lib/data/services/database/database_service.dart
- Simplified location conversion using
ST_AsText. - Removed
wkbToWktcalls and legacy code paths. - Introduced
defSelectconstant with proper location handling.
- Simplified location conversion using
- lib/domain/dto/affiliate_dto.dart
- New File: Defines
AffiliateInitDtoto support affiliate initialization.
- New File: Defines
- lib/domain/models/
- All models (
address.dart,affiliate.dart,billinginfo.dart,club.dart,fav_club.dart,operating_day.dart,user_info.dart) updated:- Renamed
idtouid,userIdtouserUid, etc. - Adjusted all
copyWith(),toMap(), andfromMap()accordingly.
- Renamed
- All models (
- lib/domain/use_cases/account_management_user_case.dart
- Updated methods to use
UserModeland new copyWith logic.
- Updated methods to use
- lib/domain/use_cases/club_user_case.dart
- Updated references to
uidfor club and address models.
- Updated references to
- lib/domain/use_cases/fav_club_user_case.dart
- Replaced
managerIdwithmanagerUid.
- Replaced
- lib/routing/router.dart
- Added sub-route for
Routes.affiliatewithinclubDetailsroute. - Injected
ClubDetailsViewModelanduserintoClubDetailsView.
- Added sub-route for
- lib/routing/routes.dart
- Converted static
Routesclass to enhanced enum-based routing.
- Converted static
- UI files under
lib/ui/- Applied changes to use
uidacross all interactions (address, billing, clubs, etc). - Replaced old affiliate view files with new modular version:
affiliate_view.dart,affiliate_view_model.dart(new location).
- Introduced reusable UI widgets for club detail:
ClubHeader,LocationRow,DescriptionRow,ScheduleRow,MonthlyFeeRow.
- Applied changes to use
New Files
- lib/domain/dto/affiliate_dto.dart
- DTO for affiliate repository initialization.
- lib/ui/view/home/fav_clubs/club_details/affiliate/
affiliate_view.dart: New modular view for affiliate operation.affiliate_view_model.dart: New stub ViewModel for future logic.
- lib/ui/view/home/fav_clubs/club_details/widgets/
- Modular UI widgets to display club information cleanly and independently.
- lib/domain/models/user_info.dart
- Renamed core model to
UserModel, replacing previousUserInfo.
- Renamed core model to
Assets and Test Data
- docs/images/diagrama de classes Sports.drawio
- Updated layout and editor version metadata.
Conclusions
The changes consolidate the UID usage across all layers, reduce fragmentation of service providers, and modularize UI components for better scalability. The system remains fully functional and is better prepared for future expansions.
2025/07/22 affiliate-02 – rudsonalves
Refactor dependency injection and form field components
This commit introduces multiple structural improvements, including the replacement of the composition_root.dart file with a more modular and maintainable dependencies.dart. Additionally, new UI components were introduced for enum-based form fields. Several documentation files were also relocated to the appropriate docs/ directory for consistency and organization.
Modified Files
- lib/config/dependencies.dart
- Replaced manual provider registration with modular
provide_*functions. - Renamed method from
createDependenciestodependenciesfor clarity and consistency.
- Replaced manual provider registration with modular
- lib/main.dart
- Replaced import of
composition_root.dartwithdependencies.dart. - Updated provider initialization to use new
dependencies()method.
- Replaced import of
- lib/ui/view/address/address_register/address_register_view.dart
- Minor UI adjustments: added spacing between form fields for better layout.
- lib/ui/view/address/address_register/address_register_view_model.dart
- Fixed relative import to absolute import of
address_user_user_case.dart.
- Fixed relative import to absolute import of
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- Fixed typo in app bar title: “Detailhes” → “Detalhes”.
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- Added sport label to the club’s subtitle information.
- lib/utils/result.dart
- Reorganized getter and constructor order for clarity and consistency.
- docs/Pendeicias.md
- docs/Roteiro.md
- docs/Sport Club.md
- Moved markdown documentation files from
doc/todocs/directory.
- Moved markdown documentation files from
- docs/images/ (multiple files)
- Moved image and diagram assets from
doc/images/todocs/images/.
- Moved image and diagram assets from
New Files
- lib/ui/core/ui/form_fields/enum_form_field.dart
- Introduced a reusable
EnumFormFieldwidget for selecting enum values using toggle buttons.
- Introduced a reusable
- lib/ui/core/ui/form_fields/widgets/toggle_buttons_text.dart
- Supporting widget for rendering styled text with an optional check icon inside toggle buttons.
- lib/ui/view/home/fav_clubs/affiliate/affiliate_view.dart
- Created new view to allow users to affiliate to a club using the
EnumFormField.
- Created new view to allow users to affiliate to a club using the
- lib/ui/view/home/fav_clubs/affiliate/affiliate_view_model.dart
- New ViewModel with a placeholder
Command1for affiliate logic using aResultwrapper.
- New ViewModel with a placeholder
Deleted Files
- lib/config/composition_root.dart
- Removed legacy dependency injection setup in favor of the modular
dependencies.dart.
- Removed legacy dependency injection setup in favor of the modular
Conclusions
These changes improve code organization, enhance UI components with reusable enum form fields, and streamline dependency injection using a modular approach. The project structure is now more maintainable and consistent.
2025/06/23 affiliate-01 – by rudsonalves
Introduce dependency composition and affiliate feature implementation
This commit centralizes dependency injection by adding a composition root and modular provider files, standardizes the Supabase client variable, and fully implements the affiliate feature. It includes schema migrations for the affiliates table, refactors repository and model code to use the new table name, corrects enum and date‐mapping keys, adds default timestamp constructors, and provides comprehensive unit tests. An updated users table migration and a database schema image asset complete the changes.
Modified Files
- lib/config/dependencies.dart
- Renamed
supabaseClientetosupabaseClientfor consistency. - Replaced
createDependencies()call with newcompositionRoot().
- Renamed
- lib/data/repositories/affiliate/affiliate_repository.dart
- Updated table references from
Tables.affiliatetoTables.affiliates. - Imported
common/affiliate_key.dartand removed localAffiliateKeyclass.
- Updated table references from
- lib/data/repositories/common/server_names.dart
- Renamed constant
Tables.affiliatetoTables.affiliates.
- Renamed constant
- lib/domain/enums/enums_sports.dart
- Corrected enum value
rebokedtorevokedinAffiliationStatus.
- Corrected enum value
- lib/domain/models/affiliate.dart
- Changed JSON mapping keys from
created_attojoined_atfor join date. - Updated
fromMapandtoMapmethods to use the newjoined_atfield.
- Changed JSON mapping keys from
- lib/domain/models/club.dart
- Made
createdAtandupdatedAtoptional and initialize toDateTime.now()if null.
- Made
- lib/main.dart
- Switched import from
/config/dependencies.dartto/config/composition_root.dart. - Initialized providers via
compositionRoot()instead ofcreateDependencies().
- Switched import from
- supabase/migrations/20250417191646_create_users_table.sql
- Reformatted the
role_enumtype definition to list values on separate lines.
- Reformatted the
New Files
- doc/images/database.png Diagram illustrating the updated database schema, including the
affiliatestable. - lib/config/composition_root.dart Aggregates all provider modules into a single composition root for DI.
- lib/config/providers/provide_core_services.dart Defines providers for cache, auth, database, storage services, and theme use case.
- lib/config/providers/provide_auth_services.dart Registers
IAuthRepositoryprovider wired withIAuthServiceand cache. - lib/config/providers/provide_geo_services.dart Registers geolocation and geocoding service providers.
- lib/config/providers/provide_others_services.dart Registers
IViaCepServiceandIFunctionsServiceproviders. - lib/config/providers/provide_others_repositories.dart Registers
IViaCepRepository,IFunctionsRepository, andIGeocodingRepository. - lib/config/providers/provide_repositories.dart Registers core repositories: storage, user, address, billing info, club, schedule, and favorites.
- lib/data/repositories/affiliate/common/affiliate_key.dart Extracted
AffiliateKeyclass for cache-key mapping and key parsing. - supabase/migrations/20250613125110_create_affiliate_table.sql New migration to create the
affiliatestable with RLS policies and indexes. - test/data/repositories/affiliate/affiliate_repository_test.dart Unit tests covering CRUD operations, caching behavior, and policy enforcement for
AffiliateRepository.
Assets and Test Data
- Image asset
doc/images/database.pngadded to illustrate schema.
- Test data
- New test file under
test/data/repositories/affiliate/affiliate_repository_test.dartcontaining full setup and CRUD tests.
- New test file under
Conclusion
All changes are now complete and the system remains fully functional.
2025/06/13 affiliate – by rudsonalves
Add AffiliateRepository, Composite-Key DB Methods, and UI Enhancements
This commit introduces a full-featured AffiliateRepository for managing athlete–club associations with composite-key CRUD operations, updates the database service to support composite-key queries and register/update/delete methods, fixes address cache key generation, and refines the Club Details and Favorites UI (including padding and distance display). It also enables SMS, TEL, and CustomTabs queries on Android and iOS.
Modified Files
- android/app/src/main/AndroidManifest.xml
- added
<queries>entries forsms,tel, andandroid.support.customtabs.action.CustomTabsService
- added
- ios/Runner/Info.plist
- declared
LSApplicationQueriesSchemesforsmsandtel
- declared
- lib/data/repositories/address/address_repository.dart
- replaced manual key string with
_cacheKey(addressId)for consistent cache lookups
- replaced manual key string with
- lib/domain/use_cases/fav_club_user_case.dart
- renamed
_nearbyClubIdsto_clubDisList(List<ClubDistance>) and exposed getters - cleared and populated
_clubDisListinfetchNearbyClubsinstead of raw IDs
- renamed
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- added symmetric horizontal padding from
Dimens - ensured layout consistency with updated spacing constants
- added symmetric horizontal padding from
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- calculated and displayed distance (km) under each club’s description
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
- imported
ClubDistanceDTO - exposed
clubDisListandclubDistanceOf(String)helper
- imported
- lib/domain/models/affiliate.dart
- added
toJsonStringandfromJsonStringfor JSON serialization
- added
- lib/data/services/database/database_service.dart
- implemented
fetchByCompositeKey,addRegister,updateRegister, anddeleteRegister
- implemented
- lib/data/services/database/i_database_service.dart
- declared new composite-key and register/update/delete methods in the interface
- lib/data/repositories/common/server_names.dart
- added
Tables.affiliateandAffiliatesTableColumnsconstants
- added
New Files
- lib/data/repositories/affiliate/affiliate_repository.dart repository implementing
IAffiliateRepositorywith local cache and Supabase composite-key CRUD - lib/data/repositories/affiliate/i_affiliate_repository.dart interface defining affiliate operations and initialization
Conclusion
Affiliate management and composite-key support are now in place, and the UI layouts have been polished for a consistent user experience.
2025/06/12 branch club_section-02
Add URL Schemes, Enhance Club Details UI, and Display Distances in Favorites
This commit enables SMS, telephone, and custom tab queries on Android and iOS, integrates url_launcher for opening club addresses in maps, refactors the Club Details view into a stateful widget with improved layout and actions, and augments the Favorites screen to show distance for each club. It also exposes club-distance data in the ViewModel and adds the url_launcher dependency.
Modified Files
- android/app/src/main/AndroidManifest.xml
- added
<queries>entries forsms,tel, andandroid.support.customtabs.action.CustomTabsService
- added
- ios/Runner/Info.plist
- added
LSApplicationQueriesSchemesarray containingsmsandtel
- added
- lib/domain/use_cases/fav_club_user_case.dart
- replaced
_nearbyClubIdslist with_clubDisListofClubDistance - exposed
clubDisListandnearbyClubsIdsgetters - updated
nearbyClubsto usenearbyClubsIds - cleared
_clubDisListat start offetchNearbyClubs - populated
_clubDisListwith distances from repository
- replaced
- lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
- converted to
StatefulWidgetto support actions - imported
url_launcherand added_openBrowsermethod for map links - redesigned layout: show sport, address row with location icon button, schedule list, monthly fee, and actionable “Close” and “Associate” buttons
- applied consistent padding and typography from
AppFontsStyleandDimens
- converted to
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- imported GoRouter for navigation
- calculated distance in kilometers using
viewModel.clubDistanceOf - appended distance text under each club’s description
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
- imported
ClubDistanceDTO - exposed
clubDisListandclubDistanceOf(String)helper
- imported
- pubspec.yaml
- added
url_launcher: ^6.3.1under dependencies
- added
- pubspec.lock
- marked
url_launcheras a direct main dependency
- marked
Conclusion
All platforms now support SMS, phone, and in-app browser queries, club address links open in maps, and the UI presents club distances clearly in the favorites list.
2025/06/12 branch club_section-01
Standardize Service Imports and Extend ClubRepository with Bulk Fetch
This commit reorganizes import paths for consistency, replacing service folder references to use the new data/services/... structure. It also enhances ClubRepository by introducing a fetchByIds method for bulk retrieval and caching of clubs by ID.
Modified Files
- lib/config/dependencies.dart
- updated import paths for database, storage, cache, and viacep services to reflect relocated service directories
- lib/data/repositories/address/address_repository.dart
- adjusted cache and database service imports to
../../services/...
- adjusted cache and database service imports to
- lib/data/repositories/auth/auth_repository.dart
- fixed cache service import path
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- corrected database and cache service import paths
- lib/data/repositories/clubs/club_repository.dart
- changed service imports to the new
../../services/...layout - added
fetchByIds(List<String> ids)to load and cache multiple clubs from remote database - renamed internal
cacheClubListto_cacheClubListand made it private
- changed service imports to the new
- lib/data/repositories/clubs/i_club_repository.dart
- removed
cacheClubListfrom interface - declared
Future<Result<void>> fetchByIds(List<String> ids)in interface
- removed
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- updated service import paths
- lib/data/repositories/functions/functions_repository.dart
- replaced inline
LastSearchedDTO with import of/domain/dto/last_search.dartand/domain/dto/club_distance.dart - changed
fetchNearbyClubsto returnClubDistancelist and updated caching logic accordingly
- replaced inline
- lib/data/repositories/functions/i_functions_repository.dart
- updated return type to
Result<List<ClubDistance>>and clarified method docs
- updated return type to
- lib/data/repositories/geocoding/geocoding_repository.dart
- adjusted cache service import path
- lib/data/repositories/schedule/schedule_repository.dart
- updated database and cache service import paths
- lib/data/repositories/storage/storage_repository.dart
- fixed storage service import path
- lib/data/repositories/user/user_repository.dart
- corrected database and cache service import paths
- lib/data/repositories/viacep/viacep_repository.dart
- updated viacep service import path
- lib/data/services/cache_database/cache_service.dart
- moved
cache_serviceand updated import to locali_cache_service.dart
- moved
- lib/data/services/cache_database/i_cache_service.dart
- path unchanged, now under
cache_database
- path unchanged, now under
- lib/data/services/database/database_service.dart
- renamed and relocated file, updated
i_database_service.dartimport - implemented
fetchByIds<T>method that queries byid in [...], converts WKB to WKT, and maps results
- renamed and relocated file, updated
- lib/data/services/database/i_database_service.dart
- declared
Future<Result<List<T>>> fetchByIds<T>(...)in interface
- declared
- lib/data/services/functions/functions_service.dart
- adjusted imports, replaced manual WKB mapping with
ClubDistance.fromMapfor function results
- adjusted imports, replaced manual WKB mapping with
- lib/data/services/functions/i_functions_service.dart
- updated return type to
Result<List<ClubDistance>>forfetchNearbyClubs
- updated return type to
- lib/data/services/storage/storage_service.dart
- relocated and updated import for
i_storage_service.dart
- relocated and updated import for
- lib/data/services/viacep/i_viacep_service.dart
- moved interface file under
viacepdirectory
- moved interface file under
- lib/data/services/viacep/viacep_service.dart
- relocated service implementation and updated import
New Files
- lib/domain/dto/club_distance.dart Data-transfer object representing a club ID and its distance in meters
- lib/domain/dto/last_search.dart DTO capturing the last searched location and radius for caching
- test/ All repository and service tests updated import paths; no new test files added
Conclusion
Import paths are now consistent and ClubRepository supports efficient bulk fetching and caching of clubs by ID. All services and interfaces have been updated accordingly.
2025/06/11 version: 0.22.05+80
Refactor Club Caching, Location Services, and Favorite Clubs Workflows
This commit enhances club data caching, streamlines geolocation handling, and refactors the favorite clubs feature. It replaces string-based schedules with JSON serialization, introduces CoordLocation for coordinates, adds in-memory caching for nearby searches, and updates the UI to leverage the new view model methods.
Modified Files
- lib/data/repositories/clubs/club_repository.dart
- removed deprecated schedule handling and
_saveLocalin favor of_cacheClub - introduced
clubFromCacheByIdandcacheClubListmethods for direct cache access - replaced local cache updates to use
_cacheClubconsistently in add/update flows - simplified cache deserialization to drop
Schedule.fromString
- removed deprecated schedule handling and
- lib/data/repositories/clubs/i_club_repository.dart
- added
cacheClubListandclubFromCacheByIdto the interface
- added
- lib/data/repositories/functions/functions_repository.dart
- created
LastSearchedvalue type to track last location/radius - cached recent search results and short-circuited identical requests
- created
- lib/data/services/functions/functions_service.dart
- switched to accept
CoordLocationinstead of raw latitude/longitude - fixed column naming for location WKB-to-WKT conversion
- switched to accept
- lib/data/services/functions/i_functions_service.dart
- updated method signature to require
CoordLocation
- updated method signature to require
- lib/data/services/geolocator/geolocator_service.dart
- changed
currentPositionto returnCoordLocationinstead ofPosition
- changed
- lib/data/services/geolocator/i_geolocator_service.dart
- updated interface to reflect
CoordLocationreturn type
- updated interface to reflect
- lib/domain/models/club.dart
- removed
scheduleStringfield and legacy parsing logic - adjusted
toMap/fromMapto use JSON-serialized schedule
- removed
- lib/domain/models/coord_location.dart
- added model for geographic coordinates with
copyWith
- added model for geographic coordinates with
- lib/domain/models/schedule.dart
- eliminated
fromStringfactory and obsolete code - retained
toJson/fromJsonfor schedule serialization
- eliminated
- lib/domain/use_cases/fav_club_user_case.dart
- dropped schedule repository dependency and related calls
- added
_nearbyClubIdstracking andnearbyClubsgetter - invoked
cacheClubListand populated_nearbyClubIdsafter fetch
- lib/routing/router.dart
- removed unused
scheduleRepositoryinjection
- removed unused
- lib/ui/view/clubs/register_club/register_club_view.dart
- removed obsolete
scheduleStringassignment when registering a club
- removed obsolete
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- bound view to new
nearbyClubsand fetch listeners via_viewModel - replaced manual list rendering with
ListenableBuilderand empty-state message - factored out distance selection logic into
_favClubsNearbymethod
- bound view to new
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
- exposed
nearbyClubsgetter from user case
- exposed
- test/domain/models/club_test.dart
- updated test to include Thursday in
Scheduleand verify JSON round-trip
- updated test to include Thursday in
- test/domain/models/schedule_test.dart
- commented out obsolete
fromStringtests
- commented out obsolete
New Files
- lib/ui/view/home/fav_clubs/widgets/select_distance.dart dialog widget to choose maximum search distance for nearby clubs
- supabase/migrations/20250611203353_update_clubs_table3.sql renames
schedule_stringcolumn toscheduleinpublic.clubs - supabase/migrations/20250611204108_update_clubs_function_update.sql rebuilds
get_clubs_within_radiusfunction to returnscheduleand distance
Conclusion
All changes have been implemented successfully and the app’s club management and favorite feature are now fully optimized.
2025/06/11 version: 0.22.05+80
Rename UI pages to view directory and update router imports
This commit reorganizes all UI page implementations under the lib/ui/view/ hierarchy and updates the routing configuration accordingly. It ensures that imports in router.dart point to the new view paths and keeps the doc/images/Estudo de Interface para o App.excalidraw asset in sync with those changes.
Modified Files
- doc/images/Estudo de Interface para o App.excalidraw
- Updated the Excalidraw asset indices to reflect the renamed view components in the favorites and club management UI.
- lib/routing/router.dart
- Changed all imports from
lib/ui/pages/...tolib/ui/view/...forFavClubsViewModel, club pages, registration, sign-in/up, splash, address, billinginfo, and home views. - Updated builder closures to instantiate
*Viewclasses instead of the old*Pagewidgets.
- Changed all imports from
Conclusion
All page components now reside under ui/view, and the router is aligned with these paths—navigation should work seamlessly with the reorganized structure.
2025/06/11 version: 0.22.05+80
Replace FavClubsPage with FavClubsView in HomeView
This commit updates the HomeView to use the new FavClubsView component instead of the deprecated FavClubsPage. The changes streamline the navigation logic and align the home screen implementation with the latest component naming conventions.
Modified Files
- lib/ui/view/home/home_view.dart
- added import for the new
fav_clubs_view.dart - removed import of the obsolete
fav_clubs_page.dart - updated the
childrenlist to instantiateFavClubsViewwith the existing viewModel, replacingFavClubsPage
- added import for the new
Conclusion
All updates are complete and the HomeView now correctly utilizes the FavClubsView component.
2025/06/10 version: 0.22.05+79
Add schedule_string support, simplify caching, and implement favorites UI selector
This commit extends the clubs model and database with a schedule_string field for human-readable schedules, removes the now-redundant local cache in ScheduleRepository, and enhances the “Favorites” page with a segmented control to switch between My Clubs, Nearby, and Selected lists. It also adds parsing logic to reconstruct schedules from strings, updates the club repository to merge cached JSON with Schedule.fromString, and includes a migration and unit test for the new schedule_string column and parsing.
Modified Files
- doc/images/Estudo de Interface para o App.excalidraw
- Updated the Excalidraw asset to reflect new UI segments for favorites.
- lib/data/repositories/clubs/club_repository.dart
- Imported
Scheduleand, when loading from cache, used each club’sscheduleStringto rebuild itsScheduleviaSchedule.fromString.
- Imported
- lib/data/repositories/schedule/schedule_repository.dart
- Removed all local-device caching logic (
_loadLocal,_loadRemote,_saveCache) and now always returnsResult.voidSuccessfrominitialize.
- Removed all local-device caching logic (
- lib/domain/enums/enums_declarations.dart
- Added
FavClubsPageEnumwith labels formyClubs,nearby, andselected.
- Added
- lib/domain/models/club.dart
- Added nullable
scheduleStringproperty; updated constructors,toMap, andfromMapto serialize/deserializeschedule_stringand fallback toSchedule.fromStringwhen needed.
- Added nullable
- lib/domain/models/operating_day.dart
- Introduced
OperatingDay.fromHHMMRange(weekday, range)to parse a"08:00 às 18:00"string into anOperatingDay.
- Introduced
- lib/domain/models/schedule.dart
- Added
Schedule.fromString(str)factory to parse a comma-separated“Day: HH:MM às HH:MM”string into aScheduleobject.
- Added
- lib/domain/use_cases/club_user_case.dart
- Modified
fetchClubWithScheduleflow: only fetches schedule from repository ifclub.schedule == null, then merges it viacopyWith.
- Modified
- lib/ui/pages/clubs/register_club/register_club_page.dart
- Assigned
_scheduleController.texttoscheduleStringwhen constructing a newClub.
- Assigned
- lib/ui/pages/home/fav_clubs/fav_clubs_page.dart
- Replaced static text with a
SelectionFavClubswidget and conditional buttons for eachFavClubsPageEnummode; togglesshowBaseButtonand invokes the appropriate command.
- Replaced static text with a
New Files
- lib/ui/pages/home/fav_clubs/widgets/selection_fav_clubs.dart Implements a
SegmentedButtoncontrol bound toFavClubsPageEnumand notifies the parent when the user switches tabs. - supabase/migrations/20250610180909_update_clubs_table2.sql Adds
schedule_string TEXTtopublic.clubsif it doesn’t exist. - test/domain/models/schedule_test.dart New unit test verifying that
Schedule.toString()andSchedule.fromString()round-trip correctly for multiple days and time ranges.
Conclusion
Schedules can now be stored and reconstructed from text, and the Favorites page offers a clean segmented interface. The migration and tests ensure backward compatibility and correct parsing for existing data.
2025/06/10 version: 0.22.05+78
Use currentPosition, extract WKB→WKT converter, and correct coordinate parsing
This commit switches geolocation calls to currentPosition, extracts the WKB-to-WKT conversion into a shared utility, updates database and functions services to use the new converter, fixes CoordLocation parsing order, adds logging for nearby-club counts, and includes a round-trip WKT unit test.
Modified Files
- lib/data/repositories/functions/functions_repository.dart
- Changed geolocation lookup from
lastKnownPosition()tocurrentPosition()for more reliable coordinates.
- Changed geolocation lookup from
- lib/data/services/database_service/database_service.dart
- Imported the new
wkbToWktfunction fromcommom/functions.dart. - Replaced the in-class
_wkbToWktimplementation with calls towkbToWkt.
- Imported the new
- lib/data/services/functions/functions_service.dart
- Imported
wkbToWktandClubsTableColumns.locationfor consistent column referencing. - Transformed each club’s WKB location via
wkbToWktbefore mapping toClub.
- Imported
- lib/domain/models/coord_location.dart
- Swapped the order in
toPointStringandfromPointStringso that longitude is X and latitude is Y, matching WKT conventions.
- Swapped the order in
- lib/domain/use_cases/fav_club_user_case.dart
- Added a warning log reporting how many nearby clubs were found within the given radius.
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Updated import path for
CoordLocationto use the absolute URI.
- Updated import path for
New Files
- lib/data/services/commom/functions.dart Implements
wkbToWkt(String), converting PostGIS WKB hex to aPOINT(x y)WKT with endian, SRID, and type checks. - test/domain/models/coord_location_test.dart Unit test verifying that
CoordLocation.toPointString()andfromPointString()round-trip correctly with latitude and longitude.
Conclusion
Shared utility extraction and coordinate corrections are complete, geolocation now uses fresh readings, and the new unit test ensures correct WKT handling.
2025/06/10 version: 0.22.05+77
Add geocoding feature, address string support, and wire new dependencies
This commit integrates a full geocoding workflow—service, repository, and UI wiring—so the app can resolve addresses to coordinates and cache results. It also adds an addressString field to Club, updates the Android manifest for permissions, and adjusts dependency injection, use cases, view models, routing, and tests to support the new functionality.
Modified Files
- android/app/src/main/AndroidManifest.xml Declared
ACCESS_FINE_LOCATIONandACCESS_COARSE_LOCATIONpermissions for foreground geolocation. - lib/config/dependencies.dart Registered new providers for geolocator adapter/service, geocoding service/repository, and functions service/repository.
- lib/data/repositories/functions/functions_repository.dart Switched constructor to named parameters and injected
IGeolocatorServiceinterface instead of concrete class. - lib/data/services/geolocator/adapter/geolocator_adapter.dart Fixed import path for
i_geolocator_adapter.dart. - lib/domain/models/address.dart Enhanced
fullAddressgetter to includecomplementconditionally. - lib/domain/models/club.dart Added nullable
addressStringproperty; updated constructors,toMap, andfromMapto handleaddress_string; replaced oldLocationwithCoordLocation. - lib/domain/models/coord_location.dart Renamed from
location.dart; updated class name, factory constructors, JSON methods, and equality toCoordLocation. - lib/domain/use_cases/club_user_case.dart Injected
IGeocodingRepository, addedgetCoordinatesFromAddressmethod, and wired it into club creation/update flows. - lib/domain/use_cases/fav_club_user_case.dart Injected
IFunctionsRepositoryand exposedfetchNearbyClubsto user case. - lib/routing/router.dart Passed new
geocodingRepositoryandfunctionsRepositoryinto view models for relevant routes. - lib/ui/pages/clubs/clubs_view_model.dart Renamed internal field to
_clubUserCaseand updated all method calls accordingly. - lib/ui/pages/clubs/register_club/register_club_page.dart Changed
_onSavePressedto async, setaddressStringand placeholderCoordLocationinitially. - lib/ui/pages/clubs/register_club/register_club_view_model.dart Renamed to use
_clubUserCase; added_updateCoordLocationhelper to fetch and set geocoded coordinates before add/update. - lib/ui/pages/home/fav_clubs/fav_clubs_page.dart Hooked the “add” button to call
fetchNearbyClubs.execute(10.0). - lib/ui/pages/home/fav_clubs/fav_clubs_viewmodel.dart Added
fetchNearbyClubscommand bound to the new user case method. - lib/ui/pages/home/home_page.dart Cleaned imports; removed unused cache service import.
- pubspec.yaml & pubspec.lock Added
geocoding:^4.0.0andcrypto:^3.0.6; updated lockfile entries accordingly.
New Files
- lib/data/repositories/geocoding/geocoding_repository.dart Implements
IGeocodingRepositorywith MD5-based keying, two-layer cache (in-memory LRU capped at 20 and persistent), and fallback toIGeocodingService. - lib/data/repositories/geocoding/i_geocoding_repository.dart Defines the geocoding repository interface.
- lib/data/services/geocoding/geocoding_service.dart Uses the
geocodingpackage to resolve addresses intoCoordLocation. - lib/data/services/geocoding/i_geocoding_service.dart Interface for high-level geocoding operations.
- supabase/migrations/20250609163759_update_clubs_table.sql Migration to
ADD COLUMN IF NOT EXISTS address_string TEXTinpublic.clubs.
Conclusion
All components for address geocoding and caching are in place, the Club model now stores both raw address strings and coordinates, and the system is fully wired end-to-end and ready for testing.
2025/06/06 version: 0.22.05+75
Add release signing and refactor repositories and UI components
This commit introduces the release signing configuration by loading keystore properties in the Android Gradle script and applies targeted refactoring across multiple repository and UI classes. Repository methods for loading data have been renamed and optimized, logger naming has been corrected, and UI components have been updated to use consistent parameter names and improved menu labels.
Modified Files
- android/app/build.gradle.kts
- Imported
java.util.Propertiesandjava.io.FileInputStreamto load keystore properties fromkey.properties. - Created a
keystorePropertiesFileand initialized aPropertiesinstance to readkeyAlias,keyPassword,storeFile, andstorePassword. - Added a
signingConfigsblock for “release” build that references values from the loadedProperties. - Defined
debugandreleasebuildTypes, assigning the appropriate signing configurations and enabling code minification and resource shrinking in the release build.
- Imported
- lib/data/repositories/address/address_repository.dart
- Renamed
_fetchAllFromLocalto_loadAllLocaland updated logic to always clear_addressesbefore loading. - Adjusted cache key handling: replaced retrieval of IDs with
getKeysStartsWith, stripping the prefix when mapping entries. - Renamed
_fetchAllFromDatabaseto_loadAllDatabaseand updated the call site ininitialize. - Moved
_cacheKeyhelper above_userIddeclaration for consistent ordering and removed redundant blank line.
- Renamed
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Corrected logger instantiation from
Logger('RemoteProfileRepository')toLogger('BillingInfoRepository'). - Enhanced
initializeto callfetch(userId), then log success or warning depending onResultoutcome, while still returning theResult.
- Corrected logger instantiation from
- lib/data/repositories/clubs/club_repository.dart
- Moved the
_cacheKeyhelper into the class body below the getters section. - Refactored
_loadAllLocalto always clear_clubsbefore loading. - Replaced use of
idswithkeysfromgetKeysStartsWith, and strip the prefix when mapping entries. - Updated return value of
_loadAllLocaltoresultSuccessinstead of constructing a newResult.success(null).
- Moved the
- lib/ui/core/ui/drawer/main_drawer.dart
- Imported
enums_declarations.dartto referenceUserRole. - Renamed parameter
persontouserfor consistency withUserInfousage. - Updated
MainDrawerHeaderinstantiation to passuserinstead ofperson. - Changed menu item labels: “Endereços” to “Gerenciamento de Endereços” and “Perfil” to “Dados Financeiros”.
- Wrapped the “manager”-only menu item with
if (isLoggedIn && user?.role == UserRole.manager)to restrict visibility.
- Imported
- lib/ui/pages/address/address_page.dart
- Corrected import path for
show_simple_message.dartto use absolute URI (/ui/core/ui/messages/show_simple_message.dart). - Introduced a local
List<Address> addressesfield and assigned_viewModel.addressesto it before building theListView.
- Corrected import path for
- lib/ui/pages/home/home_page.dart
- Updated
MainDrawerinstantiation: replacedperson: _viewModel.userInfowithuser: _viewModel.userInfoto match renamed parameter.
- Updated
Conclusion
All changes are complete and the application should build and run successfully.
2025/06/06 version: 0.22.05+74
Normalize import paths, fix enum typo, adjust UI padding, and add FavClubsPage
This commit standardizes all import statements to use absolute (leading‐slash) paths, corrects the beachVolleybal enum to beachVolleyball, updates mapping logic in enums_sports_positions.dart and Affiliate to match, wraps the HomePage body in a padding using Dimens, adds a listener for update in UserResisterPage, and introduces a new FavClubsPage under lib/ui/pages/home/fav_clubs. The pubspec version is bumped to 0.22.05+74.
Modified Files
- lib/config/dependencies.dart
- Reordered and normalized imports with leading‐slash paths instead of
package:sports/.... - Removed redundant blank line before
package:supabase_flutter/supabase_flutter.dart.
- Reordered and normalized imports with leading‐slash paths instead of
- lib/data/repositories/auth/i_auth_repository.dart
- Changed
import 'package:sports/data/services/auth_service/i_auth_service.dart';toimport '/data/services/auth_service/i_auth_service.dart';.
- Changed
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
- Changed
import 'package:sports/utils/result.dart';toimport '/utils/result.dart';.
- Changed
- lib/data/repositories/viacep/i_viacep_repository.dart
- Changed
import 'package:sports/domain/models/viacep_address.dart';andimport 'package:sports/utils/result.dart';to leading‐slash imports.
- Changed
- lib/data/services/auth_service/auth_service.dart
- Normalized
i_auth_service.dartimport toimport '/data/services/auth_service/i_auth_service.dart';.
- Normalized
- lib/data/services/cache_database_service/i_cache_service.dart
- Changed
import 'package:sports/utils/result.dart';toimport '/utils/result.dart';.
- Changed
- lib/data/services/database_service/i_database_service.dart
- Changed
import 'package:sports/utils/result.dart';toimport '/utils/result.dart';.
- Changed
- lib/data/services/storage_service/i_storage_service.dart
- Changed
import 'package:sports/utils/result.dart';toimport '/utils/result.dart';.
- Changed
- lib/domain/enums/enums_sports.dart
- Renamed enum value
beachVolleybaltobeachVolleyball.
- Renamed enum value
- lib/domain/enums/enums_sports_positions.dart
- Updated the
Sports.beachVoltagebalkey toSports.beachVolleyballso position mapping matches the corrected enum.
- Updated the
- lib/domain/models/affiliate.dart
- Adjusted the type‐mismatch check from
(sport == Sports.beachVolleybal ...)to(sport == Sports.beachVolleyball ...).
- Adjusted the type‐mismatch check from
- lib/domain/models/fav_club.dart
- Changed import of
date_time_extensions.darttoimport '/utils/extensions/date_time_extensions.dart';.
- Changed import of
- lib/domain/models/user_info.dart
- Normalized
enums_sports.dartimport toimport '/domain/enums/enums_sports.dart';. - Removed an extra blank line between imports.
- Normalized
- lib/routing/app_extra_codec.dart
- Reordered imports: moved
import '/domain/models/address.dart';beforeenums_declarations.dart, using leading‐slash paths.
- Reordered imports: moved
- lib/routing/router.dart
- Normalized all imports to leading‐slash style (e.g.
/data/repositories/...and/ui/pages/...).
- Normalized all imports to leading‐slash style (e.g.
- lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
- Changed
package:imports toimport '/domain/models/club.dart';andimport '/ui/core/ui/...';using leading‐slash.
- Changed
- lib/ui/pages/home/home_page.dart
- Added
import '/ui/core/theme/dimens.dart';. - Wrapped the
IndexedStackinPadding(padding: EdgeInsets.all(dimens.paddingScreenAll), ...). - Normalized
FavClubsPageimport toimport 'fav_clubs/fav_clubs_page.dart';.
- Added
- lib/ui/pages/sign_in/sign_in_page.dart
- Changed import of
botton_sheet_message.darttoimport '/ui/core/ui/messages/botton_sheet_message.dart';.
- Changed import of
- lib/ui/pages/sign_in/sign_in_view_model.dart
- Changed
import 'package:sports/utils/result.dart';toimport '/utils/result.dart';.
- Changed
- lib/ui/pages/user_register/user_resister_page.dart
- Added
_viewModel.update.addListener(_onSaved);ininitState(). - Removed the corresponding listener in
dispose():_viewModel.update.removeListener(_onSaved);.
- Added
New Files
- lib/ui/pages/home/fav_clubs/fav_clubs_page.dart A new StatefulWidget
FavClubsPagewith aFavClubsViewmodelparameter. It builds a simpleListViewofallClubswithCard/ListTile, displaying each club’sname,description, andlogo.
Deleted Files
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart Moved/renamed into
lib/ui/pages/home/fav_clubs/fav_clubs_page.dart. - lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart Renamed to
lib/ui/pages/home/fav_clubs/fav_clubs_viewmodel.dart. - lib/ui/pages/clubs/manage_club/manage_club_view_model.dart Removed because it was replaced by
manager_club/manager_club_view_model.dartin an earlier commit.
Conclusion
All import statements now follow a consistent leading‐slash convention, the “beachVolleybal” enum typo has been corrected across the codebase, HomePage layout is padded via Dimens, the user registration form adds an update listener, and the new FavClubsPage has been introduced under a cleaner folder structure. The pubspec version is bumped to 0.22.05+74.
2025/06/05 version: 0.22.04+73
Add “favorite clubs” feature and refactor UI components
This commit implements the “favorite clubs” functionality end-to-end. It registers the FavClubsRepository with dependency injection, updates data models and table columns, and adds a Supabase migration to create the fav_clubs table with RLS policies. The use-case and view-model layers are updated to load, fetch, and add favorite clubs. Routing and UI have been refactored to include a new Favorite Clubs page and to rename the “Manage Club” screen to “Manager Club.” Minor tweaks to existing repository caching and mapping logic were also applied.
Modified Files
- lib/config/dependencies.dart
- Imported
i_fav_clubs_repository.dartandfav_clubs_repository.dart. - Registered
Provider<IFavClubsRepository>so thatFavClubsRepositoryis injected withICacheServiceandIDatabaseService.
- Imported
- lib/data/repositories/clubs/club_repository.dart
- Replaced local variable name
cwithclubin themyClubsgetter for clarity.
- Replaced local variable name
- lib/data/repositories/common/server_names.dart
- Added a new
FavClubsTableColumnsclass with constants foruser_id,club_id, andcreated_at.
- Added a new
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Changed constructor parameters to use interfaces (
ICacheServiceandIDatabaseService) instead of concrete service types. - Updated
deleteandfetchAllquery conditions to use the newFavClubsTableColumns.clubIdandFavClubsTableColumns.userIdconstants. - No change to overall logic; still adds/removes favorite-club rows and updates local cache.
- Changed constructor parameters to use interfaces (
- lib/domain/models/fav_club.dart
- Added a new
createdAtfield (defaulting toDateTime.now()) and updatedcopyWith. - Changed the
toMapmethod to emit snake_case keys (user_id,club_id,created_at). - Updated
fromMapto read from those snake_case keys and parsecreated_atviaDateTimeExtensions.fromMap.
- Added a new
- lib/domain/use_cases/account_management_user_case.dart
- Adjusted import paths to use leading-slash style (
/data/repositories/...) consistently with the project.
- Adjusted import paths to use leading-slash style (
- lib/domain/use_cases/fav_club_user_case.dart
- Removed the old
clubsListgetter and replaced it with two new getters:allClubs(all clubs) andotherClubs(clubs not managed by the current user). - In
load, first fetch all favorite-club IDs fromIFavClubsRepository. Then for each ID, callfetchClub(clubId)to load club details and schedule. - In
fetchClub, after retrieving theCluband itsSchedule, callIFavClubsRepository.add(clubId)to insert into the favorites table. Errors bubble up as needed.
- Removed the old
- lib/routing/router.dart
- Imported
i_fav_clubs_repository.dart,fav_club_user_case.dart, andfavorite_clubs_viewmodel.dart. - Renamed the route for managing a club:
ManageClubPage→ManagerClubPageand updated its view-model import. - In the home route, added a
FavClubsViewmodelto theHomePageconstructor under a newfavClubsViewModelparameter. - Renamed the “Manage Club” page component folder to
manager_cluband updated references.
- Imported
- lib/ui/pages/clubs/manage_club/manage_club_page.dart → lib/ui/pages/clubs/manager_club/manager_club_page.dart
- Renamed file and class from
ManageClubPagetoManagerClubPage. - Updated constructor signature and
createState()return type accordingly. - Adjusted state class from
_ManageClubPageStateto_ManagerClubPageState.
- Renamed file and class from
- lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
- Deleted (renamed functionality moved to
manager_club/manager_club_view_model.dart).
- Deleted (renamed functionality moved to
- lib/ui/pages/clubs/manager_club/manager_club_view_model.dart
- New empty
ManagerClubViewModelclass to pair with the renamed “Manager” page.
- New empty
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
- Renamed widget class from
ClubsPagetoFavClubsPage. - Added a
FavClubsViewmodel viewModelconstructor parameter and updatedcreateState()to_FavClubsPageState.
- Renamed widget class from
- lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
- Renamed from
FavoriteClubsViewmodeltoFavClubsViewmodel. - Injected
FavClubUserCaseand wiredCommand0<void> loadandCommand1<Club?, String> fetchClub. - Exposed getters
allClubsandotherClubsfrom the use case.
- Renamed from
- lib/ui/pages/home/home_page.dart
- Added a new
FavClubsViewmodel favClubsViewModelparameter toHomePage. - Replaced the previous
ClubsPagetab (at index 1) withFavClubsPage(viewModel: widget.favClubsViewModel).
- Added a new
- lib/utils/extensions/date_time_extensions.dart
- Added two methods: •
String toMap()to produce a UTC ISO8601 string. •static DateTime fromMap(String map)to parse that ISO string back to local time.
- Added two methods: •
New Files
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart Defines the
IFavClubsRepositoryinterface with: •Set<String> get favClubIds(cached favorite IDs) •Future<Result<void>> initialize(String userId)•Future<Result<void>> add(String clubId)•Future<Result<void>> delete(String clubId)•Future<Result<void>> fetchAll() - lib/data/repositories/viacep/i_viacep_repository.dart Declares
IViaCepRepositorywith: •List<ViaCepAddress> get ceps(cached addresses) •Future<Result<ViaCepAddress>> getLocationByCEP(String cep) - lib/data/repositories/viacep/viacep_repository.dart Implements
IViaCepRepository, caching CEP lookups in memory and callingIViaCepServicewhen a CEP is not already in_cepCache. - lib/data/services/viacep_service/i_viacep_service.dart Defines
IViaCepService, with a single method: •Future<Result<ViaCepAddress>> getLocationByCEP(String cep) - lib/ui/pages/clubs/manager_club/manager_club_view_model.dart Provides a placeholder
ManagerClubViewModelclass to pair with the renamed page. - supabase/migrations/20250605170147_create_fav_clubs.sql SQL migration to create the
fav_clubstable with columns: •user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE•club_id UUID NOT NULL REFERENCES clubs(id) ON DELETE CASCADE•created_at TIMESTAMPTZ DEFAULT NOW()Primary key:(user_id, club_id). Row-Level Security policies to allow each logged-in user to insert, select, and delete only their own rows.
Conclusion
Favorite-clubs support has been fully integrated—from database schema to UI—along with a rename of the Manage Club feature to “Manager Club.” All new interfaces and classes have been registered in DI, and existing code was adjusted to use the new types. The app is ready for users to mark and view their favorite clubs.
2025/06/04 version: 0.22.04+72
Add ViaCep repository and service interface, integrate into DI and use case
This commit introduces a new IViaCepService interface and IViaCepRepository abstraction, along with a concrete ViaCepService update and ViaCepRepository implementation for CEP lookup and caching. Dependency injection is updated to register these new types, and the AddressUserCase and routing are adjusted to retrieve location data through the repository rather than the service directly. The pubspec version is also bumped.
Modified Files
- lib/config/dependencies.dart
- Imported
i_viacep_service.dart,viacep_service.dart,i_viacep_repository.dart, andviacep_repository.dart. - Changed provider registration from
Provider<ViaCepService>toProvider<IViaCepService>. - Added
Provider<IViaCepRepository>binding that createsViaCepRepositoryusingIViaCepService.
- Imported
- lib/data/services/viacep_service/viacep_service.dart
- Updated class signature to
ViaCepService implements IViaCepService. - Added
@overrideannotation ongetLocationByCEPmethod to satisfy interface contract. - No change in internal logic—still performs HTTP lookup and parsing.
- Updated class signature to
- lib/domain/use_cases/address_user_user_case.dart
- Changed constructor to depend on
IViaCepRepositoryinstead ofViaCepService. - Updated
getLocationByCEPto call_viaCepRepository.getLocationByCEP(cep).
- Changed constructor to depend on
- lib/domain/use_cases/fav_club_user_case.dart
- Adjusted import paths to use leading slash style (
/data/repositories/...) consistently with project conventions.
- Adjusted import paths to use leading slash style (
- lib/routing/router.dart
- Imported
i_viacep_repository.dartso routing can access the repository. - Changed address route builders to call
context.read<IViaCepRepository>()rather thanViaCepService.
- Imported
- pubspec.yaml
- Bumped version from
0.22.04+71to0.22.04+72.
- Bumped version from
New Files
- lib/data/repositories/viacep/i_viacep_repository.dart Defines
IViaCepRepositoryinterface with:List<ViaCepAddress> get cepsto expose cached addresses.Future<Result<ViaCepAddress>> getLocationByCEP(String cep)method that fetches or caches CEP lookup.
- lib/data/repositories/viacep/viacep_repository.dart Implements
IViaCepRepository:- Injects
IViaCepServiceto perform actual HTTP calls. - Caches results in a
Map<String, ViaCepAddress> _cepCache. - Returns cached result if available; otherwise calls the service, caches, and returns.
- Injects
- lib/data/services/viacep_service/i_viacep_service.dart Defines
IViaCepServiceinterface with:Future<Result<ViaCepAddress>> getLocationByCEP(String cep)abstract method.
Conclusion
The ViaCep lookup is now fully abstracted behind an interface and repository layer, registered in DI, and consumed by the address use case—ensuring better separation of concerns and easier future mocking or replacement.
2025/06/04 version: 0.22.04+71
Rename repository implementations and interfaces for clearer naming
Renamed repository files and classes to adopt a consistent naming convention: interfaces now use an i_ prefix and begin with I, while concrete implementations have dropped the Remote prefix. Updated all import paths and provider registrations to reference the new names. No functional logic was altered—only filenames, class names, and import statements were updated to reduce verbosity and improve expressiveness.
Modified Files
- lib/config/dependencies.dart
- Updated import paths to reference
i_*_repository.dartinterface files instead ofremote_*or concrete class names. - Changed provider bindings to use
I*Repositorytypes and new implementation class names without “Remote”.
- Updated import paths to reference
- lib/data/repositories/address/remote_address_repository.dart → lib/data/repositories/address/address_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteAddressRepositorytoAddressRepository. - Updated imports and
implementsclause to useIAddressRepository.
- Removed
- lib/data/repositories/address/address_repository.dart
- (Previously
remote_address_repository.dart) Implementation unchanged other than renaming.
- (Previously
- lib/data/repositories/address/i_address_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IAddressRepository.
- New interface file (added
- lib/data/repositories/auth/remote_auth_repository.dart → lib/data/repositories/auth/auth_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteAuthRepositorytoAuthRepository. - Updated imports and
implementsto useIAuthRepository.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Changed
implements RemoteAuthRepositorytoimplements IAuthRepository.
- Changed
- lib/data/repositories/auth/i_auth_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IAuthRepository.
- New interface file (added
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart → lib/data/repositories/billinginfo/billinginfo_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteBillingInfoRepositorytoBillingInfoRepository. - Updated imports and
implementsto useIBillingInfoRepository.
- Removed
- lib/data/repositories/billinginfo/i_billinginfo_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IBillingInfoRepository.
- New interface file (added
- lib/data/repositories/clubs/remote_club_repository.dart → lib/data/repositories/clubs/club_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteClubRepositorytoClubRepository. - Updated imports and
implementsto useIClubRepository.
- Removed
- lib/data/repositories/clubs/i_club_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IClubRepository.
- New interface file (added
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart → lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteFavClubsRepositorytoFavClubsRepository. - Updated imports and
implementsto useIFavClubsRepository.
- Removed
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IFavClubsRepository.
- New interface file (added
- lib/data/repositories/schedule/remote_schedule_repository.dart → lib/data/repositories/schedule/schedule_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteScheduleRepositorytoScheduleRepository. - Updated imports and
implementsto useIScheduleRepository.
- Removed
- lib/data/repositories/schedule/i_schedule_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IScheduleRepository.
- New interface file (added
- lib/data/repositories/storage/remote_storage_repository.dart → lib/data/repositories/storage/storage_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteStorageRepositorytoStorageRepository. - Updated imports and
implementsto useIStorageRepository.
- Removed
- lib/data/repositories/storage/i_storage_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IStorageRepository.
- New interface file (added
- lib/data/repositories/user/remote_user_repository.dart → lib/data/repositories/user/user_repository.dart
- Removed
remote_prefix from filename. - Renamed class from
RemoteUserRepositorytoUserRepository. - Updated imports and
implementsto useIUserRepository.
- Removed
- lib/data/repositories/user/i_user_repository.dart
- New interface file (added
i_prefix). - Interface renamed to
IUserRepository.
- New interface file (added
- lib/domain/use_cases/account_management_user_case.dart
- Changed constructor types from concrete classes (
AuthRepository,UserRepository,StorageRepository) to interfaces (IAuthRepository,IUserRepository,IStorageRepository).
- Changed constructor types from concrete classes (
- lib/domain/use_cases/address_user_user_case.dart
- Changed constructor parameter from
AddressRepositorytoIAddressRepository.
- Changed constructor parameter from
- lib/domain/use_cases/billinginfo_user_case.dart
- Changed constructor parameters from
AddressRepositoryandBillingInfoRepositorytoIAddressRepositoryandIBillingInfoRepository.
- Changed constructor parameters from
- lib/domain/use_cases/club_user_case.dart
- Changed constructor parameters from concrete repositories to their interface types (
IAddressRepository,IClubRepository,IStorageRepository,IScheduleRepository).
- Changed constructor parameters from concrete repositories to their interface types (
- lib/domain/use_cases/fav_club_user_case.dart
- Changed constructor parameters from concrete repositories to their interface types (
IAddressRepository,IFavClubsRepository,IClubRepository,IScheduleRepository).
- Changed constructor parameters from concrete repositories to their interface types (
- lib/routing/router.dart
- Updated all
context.read<…>()calls: replaced concrete repository types (e.g.AuthRepository,UserRepository, etc.) with interface types (IAuthRepository,IUserRepository, etc.). - Adjusted use-case instantiations to pass interfaces instead of concrete classes.
- Updated all
- lib/ui/pages/splash/splash_view_model.dart
- Updated constructor’s dependency from
AuthRepositorytoIAuthRepository.
- Updated constructor’s dependency from
- test/data/repositories/address/remote_address_repository_test.dart
- Changed import from
remote_address_repository.darttoaddress_repository.dart. - Updated test instantiation from
RemoteAddressRepositorytoAddressRepository.
- Changed import from
- test/data/repositories/auth/remote_auth_repository_test.dart
- Changed import from
remote_auth_repository.darttoauth_repository.dart. - Updated test instantiation from
RemoteAuthRepositorytoAuthRepository.
- Changed import from
- test/data/repositories/clubs/remote_club_repository_test.dart
- Changed imports:
- From
remote_address_repository.darttoaddress_repository.dart - From
remote_club_repository.darttoclub_repository.dart - From
remote_user_repository.darttouser_repository.dart
- From
- Updated instantiations accordingly:
RemoteClubRepository→ClubRepository,RemoteUserRepository→UserRepository,RemoteAddressRepository→AddressRepository.
- Changed imports:
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Changed imports:
- From
remote_address_repository.dart→address_repository.dart - From
remote_club_repository.dart→club_repository.dart - From
remote_schedule_repository.dart→schedule_repository.dart - From
remote_user_repository.dart→user_repository.dart
- From
- Updated instantiations:
RemoteScheduleRepository→ScheduleRepository,RemoteClubRepository→ClubRepository, etc.
- Changed imports:
- test/data/repositories/storage/remote_storage_repository_test.dart
- Changed import from
remote_storage_repository.darttostorage_repository.dart. - Updated test instantiation from
RemoteStorageRepositorytoStorageRepository.
- Changed import from
- test/data/repositories/user/remote_user_repository_test.dart
- Changed import from
remote_user_repository.darttouser_repository.dart. - Updated test instantiation from
RemoteUserRepositorytoUserRepository.
- Changed import from
- test/domain/use_cases/address_club_user_case_test.dart
- Updated imports:
remote_address_repository.dart→address_repository.dartremote_club_repository.dart→club_repository.dartremote_schedule_repository.dart→schedule_repository.dartremote_storage_repository.dart→storage_repository.dartremote_user_repository.dart→user_repository.dart
- Adjusted instantiations to use new implementation names without
Remote.
- Updated imports:
Conclusion
All repository classes and their interface names have been updated for improved clarity: interfaces start with I and use an i_ prefix in filenames, and concrete implementations no longer include the “Remote” prefix. All import paths, provider registrations, and tests have been updated accordingly.
2025/06/04 version: 0.22.04+70
Refactor favorite clubs feature and storage service to use interfaces; rename and reorganize use cases
This commit introduces a new IStorageService interface for storage operations and refactors the favorite clubs feature to follow a more consistent naming and interface-based approach. Key changes include renaming and restructuring several domain use case files, updating dependency wiring in dependencies.dart, and modifying repository and view model classes to use the newly introduced IStorageService and updated use case types. Tests have been updated accordingly.
Modified Files
- doc/Estudo de Interface para o App.excalidraw
- Adjusted internal JSON metadata (e.g.,
"versionNonce") to reflect the latest export version.
- Adjusted internal JSON metadata (e.g.,
- doc/diagrama de classes Sports.drawio
- Updated
<diagram>metadata to reflect the current draw.io version and internal JSON changes.
- Updated
- lib/config/dependencies.dart
- Added import for
IStorageServiceand adjusted import paths to use absolute references (/data/services/...) for consistency. - Changed
Provider<StorageService>toProvider<IStorageService>so that theRemoteStorageRepositoryis constructed from the interface. - Updated
Provider<StorageRepository>to read fromIStorageServiceinstead of the concreteStorageService.
- Added import for
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Renamed the getter from
favClubstofavClubIdsto better reflect that it holds a set of IDs. - Expanded interface with
initialize,add,delete, andfetchAllmethods, adding detailed documentation for each. - Removed the old “get-only” interface and replaced it with a fully documented CRUD-like API for favorite clubs.
- Renamed the getter from
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
- Updated the internal set from
_favClubsto_favClubIdsto match the renamed getter. - Changed repository constructor to import from absolute paths.
- Modified
add,delete, andfetchAllmethods to operate on_favClubIdsinstead of the old field, adding guard clauses to return early if the ID is already present/absent. - Refactored local cache updates in
_updateLocalCacheto useTables.favClubsand the new_favClubIdslist.
- Updated the internal set from
- lib/data/repositories/storage/remote_storage_repository.dart
- Changed the constructor parameter from the concrete
StorageServiceto the interfaceIStorageService. - Updated import to use
i_storage_service.dartso that all storage operations go through the interface.
- Changed the constructor parameter from the concrete
- lib/data/services/storage_service/remote_storage_service.dart → lib/data/services/storage_service/storage_service.dart
- Renamed
RemoteStorageServicetoStorageServiceand moved understorage_service/. - Added
implements IStorageServiceand annotated all methods (createBucket,deleteBucket,add,update,delete) with@override. - Removed redundant documentation comments from method bodies; the interface now holds the official API doc.
- Updated import paths to be absolute (e.g.,
/data/services/storage_service/i_storage_service.dart).
- Renamed
- lib/domain/use_cases/address_billinginfo_user_case.dart → lib/domain/use_cases/billinginfo_user_case.dart
- Renamed class from
AddressBillingInfoUserCasetoBillingInfoUserCaseand updated constructor accordingly. - Changed file name and import references in
router.dartandbillinginfo_view_model.dartto useBillingInfoUserCase.
- Renamed class from
- lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/club_user_case.dart
- Renamed class from
AddressClubUserCasetoClubUserCaseand updated constructor and method calls. - Changed file name and updated all import references (in
router.dart,clubs_view_model.dart, andregister_club_view_model.dart) to use the newClubUserCase.
- Renamed class from
- lib/domain/use_cases/theme_user_case.dart
- Adjusted import path to use absolute reference (
../../../data/services/...) to maintain consistency with other use case files.
- Adjusted import path to use absolute reference (
- lib/main_app.dart
- Updated import for
ThemeUserCasefrom a relative path todomain/use_cases/theme_user_case.dart.
- Updated import for
- lib/routing/router.dart
- Updated all imports of use cases to reflect their renamed paths (
club_user_case.dartandbillinginfo_user_case.dart). - Adjusted the construction of view models to use
ClubUserCaseandBillingInfoUserCaseinstead of the old classes.
- Updated all imports of use cases to reflect their renamed paths (
- lib/ui/pages/billinginfo/billinginfo_view_model.dart
- Changed injection from
AddressBillingInfoUserCasetoBillingInfoUserCaseand updated the import accordingly.
- Changed injection from
- lib/ui/pages/clubs/clubs_view_model.dart
- Replaced
AddressClubUserCasewithClubUserCasein both the constructor and the import statement.
- Replaced
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Updated import and constructor parameter from
AddressClubUserCasetoClubUserCase.
- Updated import and constructor parameter from
- lib/ui/pages/home/home_view_model.dart
- Adjusted import path for
ThemeUserCaseto use a relative path underdomain/use_cases.
- Adjusted import path for
- test/data/repositories/storage/remote_storage_repository_test.dart
- Updated import from
remote_storage_service.darttostorage_service.dartso the test uses the newStorageService. - Ensured
RemoteStorageRepositoryis constructed withStorageServicethrough theIStorageServiceinterface.
- Updated import from
- test/data/services/remote_storage_service_test.dart
- Changed import of
remote_storage_service.darttostorage_service.dartso tests reference the renamed class.
- Changed import of
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import from
address_club_user_case.darttoclub_user_case.dart. - Changed the instantiation from
AddressClubUserCasetoClubUserCase. - Updated import for
StorageServiceinstead ofremote_storage_service.dart.
- Updated import from
New Files
- lib/data/services/storage_service/i_storage_service.dart Defines the
IStorageServiceinterface with methods for creating/deleting buckets and uploading, updating, or deleting files. Each method returns aResult<T>to indicate success or failure, and method signatures (e.g.,createBucket,add,update,delete) include parameter documentation for error handling. - lib/domain/use_cases/fav_club_user_case.dart Introduces the
FavClubUserCaseclass, which orchestrates the favorite clubs flow by:- Initializing address, club, schedule, and favorite-clubs repositories for the given
userId. - Fetching all favorite clubs into local cache.
- Providing methods (
load,fetchClub) to load favorite clubs and fetch a single club with its schedule. - Uses
Loggerto emit fine-grained logs.
- Initializing address, club, schedule, and favorite-clubs repositories for the given
Conclusion
The favorite clubs feature and storage service are now fully interface-driven, use cases have been renamed for clarity, and dependency wiring in both production code and tests has been updated. All changes have been incorporated successfully, and the application compiles and runs as expected.
2025/06/03 version: 0.22.04+69
Refactor dependency injections to use interfaces and reorganize service implementations
This commit introduces major refactoring of service layers and dependency wiring by replacing concrete service types with abstract interfaces. Key changes include renaming and relocating service classes, updating repository constructors to depend on interfaces (IAuthService, ICacheService, IDatabaseService), and adjusting all import paths accordingly. Tests have also been updated to reflect these interface-based injections.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted
mxGraphModelattributes (dx,dy) to reflect updated drawing dimensions.
- Adjusted
- lib/config/dependencies.dart
- Switched
Provider<CacheDatabaseService>toProvider<ICacheService>and createdCacheServiceimplementation. - Changed
Provider<AuthService>toProvider<IAuthService>. - Updated
Provider<DatabaseService>toProvider<IDatabaseService>. - Updated constructor parameters for all repositories to read from interfaces instead of concrete services.
- Fixed import paths for all relocated services (
auth_service,cache_database_service,database_service,storage_service,viacep_service).
- Switched
- lib/data/repositories/address/remote_address_repository.dart
- Replaced
CacheDatabaseServiceandDatabaseServicefields withICacheServiceandIDatabaseService. - Updated constructor to accept interface types.
- Replaced
- lib/data/repositories/auth/auth_repository.dart
- Imported
IAuthServiceinstead ofAuthService.
- Imported
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated
_authServicetype toIAuthService. - Adjusted getter to return
IAuthService.
- Updated
- lib/data/repositories/auth/remote_auth_repository.dart
- Changed
_authServicetoIAuthServiceand_cacheServicetoCacheService?. - Updated constructor signature to accept
IAuthServiceandCacheService.
- Changed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Changed
CacheDatabaseServiceandDatabaseServicefields toICacheServiceandIDatabaseService. - Updated constructor accordingly.
- Changed
- lib/data/repositories/clubs/club_repository.dart
- Renamed
clubListgetter toallClubsand addedmyClubsgetter. - Added new abstract methods:
initialize,logout,fetchAll,fetch(id),add,update,deletewith detailed documentation in the interface.
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Changed
_cacheServiceand_databaseServicefields toICacheServiceandIDatabaseService. - Added implementation of
myClubsandallClubsgetters. - Updated
deletelogic to check ownership before deleting from database.
- Changed
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
- Switched
CacheDatabaseServicetoCacheService. - Changed
DatabaseServiceto use direct class rather than interface (repository still references concrete type).
- Switched
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Updated
_cacheServiceand_databaseServicefields toICacheServiceandIDatabaseService. - Updated constructor signature accordingly.
- Updated
- lib/data/repositories/storage/remote_storage_repository.dart
- Fixed import path for
RemoteStorageServiceafter relocating understorage_servicefolder.
- Fixed import path for
- lib/data/repositories/user/remote_user_repository.dart
- Changed
_localServiceand_databaseServiceto useICacheServiceandIDatabaseService. - Adjusted import paths accordingly.
- Changed
- lib/data/services/auth_service/auth_service.dart
- Moved
AuthServiceinto its own folder underdata/services/auth_service. - Implemented
IAuthServiceinterface and annotated all service methods with@override. - Removed old
enum AuthEventand redefined it ini_auth_service.dart. - Simplified documentation by removing redundant comments in method implementations.
- Moved
- lib/data/services/cache_database_service/cache_service.dart
- Renamed
CacheDatabaseServicetoCacheServiceand implementedICacheService. - Updated all method signatures to
@override.
- Renamed
- lib/data/services/viacep_service/viacep_service.dart
- Kept content intact but updated file location under
viacep_servicefolder.
- Kept content intact but updated file location under
- lib/data/services/database_service/database_service.dart
- Renamed
RemoteDatabaseServicetoDatabaseServiceunderdatabase_service. - Implemented
IDatabaseServiceinterface and added@overrideannotations to all CRUD methods.
- Renamed
- lib/data/services/storage_service/remote_storage_service.dart
- Moved
RemoteStorageServiceunderstorage_servicefolder without modifying logic.
- Moved
- lib/domain/use_cases/address_club_user_case.dart
- Changed
clubListreference tomyClubsto reflect new interface inClubRepository.
- Changed
- lib/domain/use_cases/address_user_user_case.dart
- Updated import path for
ViaCepServiceafter relocating underviacep_servicefolder.
- Updated import path for
- lib/domain/use_cases/theme_user_case.dart
- Changed injection parameter from
CacheDatabaseServicetoICacheService.
- Changed injection parameter from
- lib/main.dart
- Updated import for
AuthServiceto new location underauth_service/auth_service.dart.
- Updated import for
- lib/routing/router.dart
- Fixed all imports to use absolute paths (
/ui/pages/...) instead of relative paths. - Updated import for
ViaCepServiceto new path underviacep_service.
- Fixed all imports to use absolute paths (
- lib/ui/pages/home/home_page.dart
- Changed
context.read<CacheDatabaseService>()tocontext.read<CacheService>(). - Updated import path for
CacheService.
- Changed
- test/data/repositories/address/remote_address_repository_test.dart
- Updated imports to use
AuthServicefromauth_service/auth_service.dart,CacheService, andDatabaseService. - Renamed
cachevariable type fromCacheDatabaseServicetoCacheService.
- Updated imports to use
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated import for
AuthServiceto new location.
- Updated import for
- test/data/repositories/clubs/remote_club_repository_test.dart
- Updated imports for
AuthService,CacheService, andDatabaseService. - Renamed
cachevariable type.
- Updated imports for
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated imports and
cachevariable type in setup.
- Updated imports and
- test/data/repositories/storage/remote_storage_repository_test.dart
- Adjusted imports to use
AuthServiceandRemoteStorageServicefrom new paths.
- Adjusted imports to use
- test/data/repositories/user/remote_user_repository_test.dart
- Updated imports to use
AuthService,DatabaseService, andCacheService. - Changed
FakeCacheto implementCacheServiceinstead ofCacheDatabaseService.
- Updated imports to use
- test/data/services/remote_storage_service_test.dart
- Updated imports to point to relocated
AuthServiceandRemoteStorageService.
- Updated imports to point to relocated
- test/data/services/shared_preferences_service_test.dart
- Renamed
CacheDatabaseServicetoCacheServicein imports and setup.
- Renamed
- test/data/services/supabase_auth_service_test.dart
- Changed import for
AuthServiceto new path.
- Changed import for
- test/data/services/viacep_service_test.dart
- Updated import path for
ViaCepService.
- Updated import path for
- test/domain/use_cases/address_club_user_case_test.dart
- Updated imports for
AuthService,CacheService,DatabaseService, andRemoteStorageService. - Renamed
cachevariable type.
- Updated imports for
New Files
- lib/data/services/auth_service/i_auth_service.dart Defines the
IAuthServiceinterface with all authentication-related methods (signUp,signIn,signOut,fetchUser,sendPasswordRecovery,resendConfirmationEmail,updatePassword,updateUserPhone) and theAuthEventenum. - lib/data/services/cache_database_service/i_cache_service.dart Declares the
ICacheServiceinterface for shared preferences operations (getKeysStartsWith,setString,setStringList,getString,getStringList,remove,clear). - lib/data/services/database_service/i_database_service.dart Introduces the
IDatabaseServiceinterface for generic CRUD operations (fetch,fetchList,add,update,delete,bulkDelete) with full method signatures and documentation.
Conclusion
All interface-based refactorings are complete and dependency injections now rely on abstractions, ensuring a more modular and testable codebase.
2025/06/03 version: 0.22.04+68
Add Favorites Feature, Standardize DB Calls, and Update Club Registration Paths
This commit introduces a new favorites repository for managing user favorite clubs, refactors all remote repository methods to use named data/id parameters for consistency, reorganizes club registration pages under register_club, enhances the “Manage Club” page content, updates the favorites UI and viewmodel, and adds MVVM and interface study diagrams to the doc folder.
Modified Files
- doc/Estudo de Interface para o App.excalidraw
- Extended the Excalidraw interface study with new elements (index metadata updated to reflect added shapes and text).
- doc/diagrama de classes Sports.drawio
- Updated the
<mxGraphModel>canvas dimensions (dxanddy) to accommodate recent additions in the class diagram.
- Updated the
- lib/data/repositories/address/remote_address_repository.dart
- Changed
add,update, anddeletecalls on_databaseServiceto pass thedata:orid:named parameters instead of positional arguments.
- Changed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Updated
_databaseService.addand_databaseService.updatecalls to usedata:named parameter. - Changed
deleteinvocation to useid:named parameter.
- Updated
- lib/data/repositories/clubs/remote_club_repository.dart
- Refactored
_databaseService.addand_databaseService.updateto acceptdata:named argument. - Modified
deleteto useid:named parameter.
- Refactored
- lib/data/repositories/common/server_names.dart
- Added a new table name constant
favClubsto support favorite clubs storage.
- Added a new table name constant
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Updated batch insert in
add: each call to_databaseService.addnow usesdata:named parameter. - Changed
bulkDeleteto useconditions:named argument.
- Updated batch insert in
- lib/data/repositories/user/remote_user_repository.dart
- Standardized calls to
_databaseService.add,update, anddeletewith nameddata:andid:parameters.
- Standardized calls to
- lib/data/services/cache_database_service.dart
- Introduced
setStringList(String key, List<String>)to save a list of strings in shared preferences, returning aResult<void>. - Added
getStringList(String key)to retrieve aList<String>?from shared preferences, wrapped in aResult<List<String>?>.
- Introduced
- lib/data/services/remote_database_service.dart
- Refactored
add,update,delete, andbulkDeletemethods to accept named parameters (data:orid:,conditions:) instead of positional arguments.
- Refactored
- lib/domain/models/affiliate.dart
- Extended the
isMismatchlogic to include additional sports (handball,footvolley,beachVolleybal) in the position-type validation.
- Extended the
- lib/routing/router.dart
- Changed import paths for club registration views from
club_registertoregister_club. - Renamed
ClubRegisterPage→RegisterClubPageandClubRegisterViewModel→RegisterClubViewModelin the club-register route. - Updated the schedule widget import path under
register_club/widgets.
- Changed import paths for club registration views from
- lib/ui/pages/clubs/clubs_page.dart
- Adjusted the import for
DismissibleClubCardto use the newregister_club/widgetslocation.
- Adjusted the import for
- lib/ui/pages/clubs/manage_club/manage_club_page.dart
- Modified imports to use absolute project paths.
- Enhanced the page body to display a
Cardoutlining manager capabilities (e.g., adding collaborators, scheduling events).
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
- Replaced the simple list of 5 placeholder items with a
Columnthat includes explanatory text about favorite clubs and a wrappedListView.builder.
- Replaced the simple list of 5 placeholder items with a
- lib/ui/pages/home/home_page.dart
- Imported the new
FavoriteClubsViewmodel. - No functional changes here beyond imports.
- Imported the new
- test/data/repositories/user/remote_user_repository_test.dart
- Updated the
FakeCachestub to includegetStringListandsetStringListoverrides that currently throwUnimplementedError.
- Updated the
New Files
- doc/MVVM.svg
- Added an SVG illustrating the MVVM architecture for the application.
- lib/domain/models/fav_club.dart
- Introduced
FavClubmodel withuserIdandclubIdfields, along withtoMap/fromMapfor serialization.
- Introduced
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Defined
FavClubsRepositoryinterface with methods:favClubs,initialize,add,delete, andfetchAll.
- Defined
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
- Implemented
RemoteFavClubsRepositoryto manage favorite clubs:- Caches favorite club IDs in
_favClubs. - Uses
_databaseService.add(data:),bulkDelete(conditions:), and_cacheService.setStringList/getStringList. - Logs errors and returns
Result<void>on success/failure.
- Caches favorite club IDs in
- Implemented
- lib/ui/pages/clubs/register_club/register_club_page.dart
- Added
RegisterClubPage(renamed fromClubRegisterPage) that accepts an optionalClub?and aRegisterClubViewModel.
- Added
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Introduced
RegisterClubViewModel(formerlyClubRegisterViewModel) handlingloadandaddClubcommands viaAddressClubUserCase.
- Introduced
- lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
- Moved/renamed
DismissibleClubCardintoregister_club/widgets, unchanged in logic.
- Moved/renamed
- lib/ui/pages/clubs/register_club/widgets/schedule_page.dart
- Relocated
SchedulePageunderregister_club/widgetswithout modification of contents.
- Relocated
- lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
- Added an empty
FavoriteClubsViewmodelas a placeholder for future favorite-clubs logic.
- Added an empty
Conclusion
All remote repository methods now use consistent named parameters, the new favorites feature is fully scaffolded (model, repository, and UI), club registration has been reorganized under register_club, and documentation diagrams (Excalidraw & MVVM) have been added—the app is updated and ready for the next development cycle.
2025/06/02 version: 0.22.04+67
Restructure Club Management and Update Navigation/UI
This commit reorganizes all club-related pages into a new clubs directory, replaces the former club_manager structure, and adds a dedicated “Manage Club” page. The bottom navigation bar has been updated to include “Eventos” and “Clubes” tabs, with a new FavoriteClubs view. UI message widgets have been renamed for consistency, and routing has been adjusted to support these changes. Additionally, the class diagram XML metadata in Sports.drawio has been tweaked for updated dimensions.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted the
<mxGraphModel>dxanddyattributes to1468and947respectively, reflecting updated canvas dimensions.
- Adjusted the
- lib/domain/use_cases/account_management_user_case.dart
- Changed import paths to use absolute project references (
'/data/repositories/user/user_repository.dart'and'/domain/models/user_info.dart'), replacing the previous relative imports.
- Changed import paths to use absolute project references (
- lib/routing/router.dart
- Replaced imports of
club_managerpages with newclubspage classes:- Changed
ClubManagerPage→ClubsPageandClubManagerViewModel→ClubsViewModel. - Updated import paths for
club_registerandclubs_pageunderui/pages/clubs.
- Changed
- Introduced a new route
Routes.manageClubwith path/manage_club, mapping toManageClubPageand passing aClubobject viaextra. - Removed unused
club_searchroutes and replaced bindings toClubManagerclasses with the newclubsequivalents.
- Replaced imports of
- lib/routing/routes.dart
- Added a new route constant
manageClub = Route('manageClub', '/manage_club')at the end of the file.
- Added a new route constant
- lib/ui/core/ui/drawer/main_drawer.dart
- Renamed the “Clubes” list tile to “Gerenciar Clubes” with a new icon (
Symbols.person_shield). - Updated the
onTapcallback to call the updatedclubshandler.
- Renamed the “Clubes” list tile to “Gerenciar Clubes” with a new icon (
- lib/ui/core/ui/messages/show_simple_floating_message.dart → lib/ui/core/ui/messages/show_simple_message.dart
- Renamed the file and symbol from
show_simple_floating_messagetoshow_simple_message. - Changed the named parameter
iconDatatoiconTitlethroughout.
- Renamed the file and symbol from
- lib/ui/pages/address/address_page.dart
- Updated import to
show_simple_message.dartinstead of the old filename. - Replaced
iconData:usages withiconTitle:in all calls toshowSimpleMessage.
- Updated import to
- lib/ui/pages/club_manager/club_register/club_register_page.dart → lib/ui/pages/clubs/club_register/club_register_page.dart
- Moved the entire club registration page into
ui/pages/clubs/club_register. No internal logic was changed.
- Moved the entire club registration page into
- lib/ui/pages/club_manager/club_register/club_register_view_model.dart → lib/ui/pages/clubs/club_register/club_register_view_model.dart
- Moved the view model file to match the new
clubs/club_registerfolder. No code modifications.
- Moved the view model file to match the new
- lib/ui/pages/club_manager/club_register/widgets/schedule_page.dart → lib/ui/pages/clubs/club_register/widgets/schedule_page.dart
- Moved
schedule_page.dartinto theclubs/club_register/widgetsfolder. Path only; content unchanged.
- Moved
- lib/ui/pages/club_manager/club_manager_page.dart → lib/ui/pages/clubs/clubs_page.dart
- Renamed the page from
ClubManagerPagetoClubsPage. - Replaced all references to
ClubManagerViewModelwithClubsViewModel. - Removed inline
Dismissiblelogic and replaced it with aDismissibleClubCardwidget. - Updated routing callbacks:
- Changed
_navEditClubto pushRoutes.clubRegister. - Added
_navManagerClubto pushRoutes.manageClubwith aClubinstance.
- Changed
- Replaced hardcoded “Editar”/“Remover” dismiss backgrounds with the new
DismissibleClubCardcomponent. - Updated calls to
showSimpleMessage(renamed) when removing a club and checking for help messages.
- Renamed the page from
- lib/ui/pages/club_manager/club_manager_view_model.dart → lib/ui/pages/clubs/clubs_view_model.dart
- Renamed
ClubManagerViewModeltoClubsViewModeland moved it underui/pages/clubs. No functional changes to commands or use cases.
- Renamed
- lib/ui/pages/home/home_page.dart
- Imported
FavoriteClubsPageunderhome/favorite_clubs. - Changed bottom navigation destinations:
- Replaced Home icon/label with
Symbols.stadium_roundedand label “Eventos”. - Replaced Favorites icon/label with
Symbols.local_police_roundedand label “Clubes”.
- Replaced Home icon/label with
- Updated the
IndexedStackchildren array:- Index 0: placeholder
Center(child: Text('Eventos')). - Index 1:
ClubsPage()(formerlyClubManagerPage). - Index 2: placeholder
Center(child: Text('Perfil')).
- Index 0: placeholder
- Imported
- lib/ui/pages/home/home_view_model.dart
- Fixed import path to use
'/domain/models/user_info.dart'instead of a relative path.
- Fixed import path to use
New Files
- lib/ui/pages/clubs/club_register/widgets/dismissible_club_card.dart
- Introduces
DismissibleClubCardwidget to encapsulate the swipe-to-edit and swipe-to-delete UI. - Accepts callbacks:
navManagerClub,navEditClub, andremoveClubfor handling respective actions.
- Introduces
- lib/ui/pages/clubs/manage_club/manage_club_page.dart
- Implements a stub
ManageClubPage, which receives aManageClubViewModeland aClubobject via the route. - Displays the club’s name in the
AppBar.
- Implements a stub
- lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
- Defines an empty
ManageClubViewModelclass as a placeholder for future club-management logic.
- Defines an empty
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
- A new
FavoriteClubsPagethat lists placeholder “Favorite Club” items. - Will serve as the view for the “Clubes” tab in the home navigation bar.
- A new
Conclusion
Club-related pages are now neatly organized under ui/pages/clubs, navigation has been updated to reflect “Eventos” and “Clubes” tabs, and a new ManageClubPage has been introduced—making club management routes and UI more maintainable and extensible.
2025/06/02 – version: 0.22.04+66
Add UI navigation, club search, and update club management structure
This commit introduces a bottom navigation bar with three tabs (Home, Favorites, Profile) in the home page, renames and relocates all “club” pages under a new club_manager directory, adds a basic Club Search page, and updates routing and diagrams to reflect these changes. Together, these updates improve project organization and provide the foundation for client-side club browsing functionality.
Modified Files
- doc/diagrama de classes Sports.drawio
- Bumped Excalidraw/Draw.io version metadata.
- Adjusted swimlane dimensions and cell geometry for better alignment.
- Added new enum
AffiliationStatusmodel block under the “Affiliate” swimlane (with values: pending, approved, rejected, cancelled, revoked). - Repositioned several cells and edges to accommodate the new enum block.
- lib/routing/router.dart
- Updated imports to use
club_managersubdirectory instead ofclub. - Changed builder for
Routes.clubsto instantiateClubManagerPagewithClubManagerViewModel(formerlyClubPage/ClubViewModel).
- Updated imports to use
- lib/ui/pages/home/home_page.dart
- Introduced an
int currentPageIndexfield to track active tab. - Added a
NavigationBarat the bottom with threeNavigationDestinationentries: Home, Favoritos, Perfil. - Wrapped existing scaffold body in an
IndexedStackkeyed bycurrentPageIndex: placeholders for Home, Favoritos, and Perfil. - Wrapped setState on
onDestinationSelectedto switch tabs.
- Introduced an
- lib/ui/pages/club/club_page.dart → lib/ui/pages/club_manager/club_manager_page.dart
- Renamed class from
ClubPagetoClubManagerPage. - Updated constructor and state class to use
ClubManagerViewModelinstead ofClubViewModel.
- Renamed class from
- lib/ui/pages/club/club_view_model.dart → lib/ui/pages/club_manager/club_manager_view_model.dart
- Renamed
ClubViewModeltoClubManagerViewModel. - Constructor and commands remain, but class and file path updated to reflect “club_manager”.
- Renamed
- lib/ui/pages/club/club_register/club_register_page.dart → lib/ui/pages/club_manager/club_register/club_register_page.dart
- Moved the register page under
club_manager/club_register. No content changes beyond path adjustment.
- Moved the register page under
- lib/ui/pages/club/club_register/club_register_view_model.dart → lib/ui/pages/club_manager/club_register/club_register_view_model.dart
- Moved and renamed the view model to match the new directory. No logic changes.
- lib/ui/pages/club/club_register/widgets/schedule_page.dart → lib/ui/pages/club_manager/club_register/widgets/schedule_page.dart
- Moved schedule widget into
club_manager/club_register/widgets. No modifications to the file’s internals.
- Moved schedule widget into
New Files
- doc/Estudo de Interface para o App.excalidraw
- Excalidraw diagram file defining the app’s interface study.
- lib/ui/pages/club_search/club_search.dart
- New
ClubSearchwidget with aScaffoldand centered “Club Search” placeholder text. Serves as the starting point for club browsing features.
- New
- lib/ui/pages/club_search/club_search_view_model.dart
- Placeholder view model file for
ClubSearch(currently empty).
- Placeholder view model file for
Conclusion
All routing, UI structure, and directory layouts have been updated—navigation and club management pages are reorganized and functional.
2025/05/28 – version: 0.22.04+65
Refactor UserModel to UserInfo and streamline registration flow
This commit renames the core UserModel to UserInfo across the domain, data layer, UI and tests, unifying all references and types. It also augments the registration stepper with role-based permissions and JSON encoding for UserRole and Address in routing, renames routes and navigation handlers, and refines address selection and billing info pages for improved UX.
Modified Files
- lib/data/repositories/user/remote_user_repository.dart
- Replaced
UserModelwithUserInfoin import, fields, getters, method signatures, JSON mapping and caching logic.
- Replaced
- lib/data/repositories/user/user_repository.dart
- Updated repository interface to use
UserInfoinstead ofUserModelfor property, methods and documentation.
- Updated repository interface to use
- lib/domain/enums/enums_declarations.dart
- Added
factory UserRole.byName(String)for convenient lookup by name.
- Added
- lib/domain/models/user_info.dart (formerly
user.dart)- Renamed class
UserModeltoUserInfo. - Adjusted constructor,
copyWith,toMap,fromMap,fromJsonString, equality andtoString. - Simplified sports deserialization into a
Set<Sports>.
- Renamed class
- lib/domain/use_cases/account_management_user_case.dart
- Switched imports and use cases to
UserInfo. - Renamed getters and
addPerson/updatePersonreturn types toUserInfo.
- Switched imports and use cases to
- lib/routing/app_extra_codec.dart
- Imported
enums_declarations.dartandaddress.dart. - Extended
_AppExtraEncoderto JSON-encodeAddress(type: 'address') andUserRole(type: 'userRole').
- Imported
- lib/routing/router.dart
- Imported
UserRole. - Updated route names and paths:
personRegister→userRegister. - Modified registration builder to accept
extraasUserRole?and pass toRegistrationPage.
- Imported
- lib/routing/routes.dart
- Renamed
personRegisterconstant touserRegister.
- Renamed
- lib/ui/core/ui/drawer/main_drawer.dart
- Updated
personparameter and import toUserInfo.
- Updated
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Updated header to accept
UserInfoinstead ofUserModel.
- Updated header to accept
- lib/ui/pages/address/address_page.dart
- Replaced
_navToAddressRegisterwith_addAddressthat auto-selects first address when only one exists. - Simplified selection logic to always set
_selectedAddressIdand_selectedAddressto the tapped item.
- Replaced
- lib/ui/pages/address/address_register/address_register_page.dart
- Wrapped controller assignments for ViaCep lookup in
setState. - Removed unused
ViaCepAddressimport.
- Wrapped controller assignments for ViaCep lookup in
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Fixed type casting by using untyped
valueforbillinginfo.
- Fixed type casting by using untyped
- lib/ui/pages/home/home_page.dart
- Introduced
_navToRegistrationand_navToUserRegisterto replace person-centric navigation. - Updated drawer callbacks and icons to use
userInfoand new registration handlers. - Adjusted completion sheet logic to reference
userInfo.
- Introduced
- lib/ui/pages/home/home_view_model.dart
- Switched import and getter from
UserModel/persontoUserInfo/userInfo.
- Switched import and getter from
- lib/ui/pages/registration/registration_page.dart
- Added
UserRole? roleparameter androlePermissionsmap. - Extended stepper with five steps,
isActiveflags and custom controls (icon buttons and “Execute” button). - Refactored
_backPage,_nextStep,_setStep,_executeStepand_goNextto manage role-driven flow.
- Added
- lib/ui/pages/user_register/user_resister_page.dart
- Moved and renamed file from
home/user_register. - Updated imports to local widget paths.
- Switched from
personRegisterViewModeltouserResisterViewModelwithUserInfo. - Adjusted state initialization, controllers, hint texts, back navigation returning
UserInfo, and comparison logic in_setEdited.
- Moved and renamed file from
- lib/ui/pages/user_register/user_resister_view_model.dart
- Renamed file and imports to
UserInfo. - Updated command types for
addandupdatetoCommand1<UserInfo, UserInfo>. - Renamed
persongetter touserInfo.
- Renamed file and imports to
- lib/ui/pages/user_register/widgets/select_sports.dart
- Moved file path to
user_register/widgetswithout content changes.
- Moved file path to
- test/data/repositories/clubs/remote_club_repository_test.dart
- Updated import and test user instantiation to
UserInfo.
- Updated import and test user instantiation to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated import and test user instantiation to
UserInfo.
- Updated import and test user instantiation to
- test/data/repositories/user/remote_user_repository_test.dart
- Updated import, field types and test user creation to
UserInfo.
- Updated import, field types and test user creation to
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import and test user instantiation to
UserInfo.
- Updated import and test user instantiation to
Conclusion
All references to UserModel are now unified under UserInfo, registration flow respects role-based permissions, and routing JSON encoding is extended—the system is updated and fully functional.
2025/05/28 – version: 0.22.04+64
Add sports support, theme use case refactor, and registration flow enhancements
This commit introduces multi-sport selection in user registration, replaces the ThemeViewModel with a dedicated ThemeUserCase, and adds a new registration stepper page. It also updates routing to include the registration route, refactors several imports, and alters the users table to support an array of sports enums.
Modified Files
doc/diagrama de classes Sports.drawio- Adjusted the
<mxGraphModel>dimensions to reflect updated layout sizing.
- Adjusted the
lib/config/dependencies.dart- Imported the new
ThemeUserCaseuse case. - Replaced
ChangeNotifierProvider<ThemeViewModel>withChangeNotifierProvider<ThemeUserCase>. - Removed obsolete import of
theme_view_model.dart.
- Imported the new
lib/domain/models/user.dart- Added
sports: Set<Sports>field with default empty set. - Updated constructor,
copyWith,toMap,fromMap, and==override to includesports. - Imported the
Sportsenum.
- Added
lib/domain/use_cases/theme_user_case.dart- Renamed and moved
ThemeViewModeltoThemeUserCaseunderdomain/use_cases. - Updated constructor class name and file path.
- Renamed and moved
lib/main_app.dart- Updated import to point at
ThemeUserCaseinstead ofThemeViewModel. - Changed context read to use
ThemeUserCase.
- Updated import to point at
lib/routing/router.dart- Updated all imports referencing
ThemeViewModeltoThemeUserCase. - Added a new
GoRoutefor the registration page. - Inserted an empty placeholder
class ThemeViewModel {}to maintain backward compatibility.
- Updated all imports referencing
lib/ui/core/ui/text_fields/select_text_field.dart- Imported
dart:async. - Introduced
_showDescriptionDuration,_isShowDescription, and_timerto control description display timing. - Added
dispose()override to cancel the timer. - Wrapped description in
AnimatedCrossFadefor show/hide animation. - Extracted
_fixedWidthhelper widget and_timerCallback()logic.
- Imported
lib/ui/pages/address/address_register/address_register_page.dart- Changed error check from
_viewModel.getViaCep.errorto_viewModel.getViaCep.isFailure.
- Changed error check from
lib/ui/pages/club/club_view_model.dart- Corrected import path for
address_club_user_case.dartto use absolute import.
- Corrected import path for
lib/ui/pages/home/home_page.dart- Updated imports to use absolute paths.
- Added an icon button to navigate to the new registration page.
lib/ui/pages/home/home_view_model.dart- Updated import and constructor parameter from
ThemeViewModeltoThemeUserCase.
- Updated import and constructor parameter from
lib/ui/pages/home/user_register/user_resister_page.dart- Imported
SelectSportswidget andSportsenum. - Added
_sportsController,_selectedSports, and related dispose logic. - Inserted a read-only text field for “Esportes de Interesse” with tap handler.
- Implemented
_selectSportsdialog,_setSportshandler, and wiredsportsinto the user model creation and populate logic.
- Imported
lib/utils/commands.dart- Moved
_resultdeclaration above getters. - Renamed
error/successgetters toisFailure/isSuccesswith updated comments. - Ensured
notifyListeners()and_running = falseoccur infinally.
- Moved
lib/utils/result.dart- Expanded class-level documentation to describe generic
Result<T>. - Standardized getter signatures for
valueanderror. - Refined
foldcallback variable names. - Updated
SuccessandFailuresubclass comments.
- Expanded class-level documentation to describe generic
New Files
lib/ui/pages/home/user_register/widgets/select_sports.dart- A reusable
SelectSportswidget presenting a list ofFilterChips for multi-sport selection, reporting changes via aSet<Sports>callback.
- A reusable
lib/ui/pages/registration/registration_page.dart- A new
RegistrationPageimplementing a three-stepStepperfor user, address, and payment data capture.
- A new
supabase/migrations/20250527132735_alter_table_users.sql- Migration to create
sports_enumtype and addsportscolumn as a non-null array of enums with default empty array.
- Migration to create
Conclusion
All enhancements are now integrated, supporting sports selection, refined theming logic, and a complete registration workflow. The system remains fully functional and ready for further testing.
2025/05/24 – version: 0.22.04+63
Refactor repository interfaces and use-case naming for list consistency and optional remote loading
This commit harmonizes collection property names across address and club repositories, extends initialization and fetch APIs with an optional forceRemote parameter, and renames use-case classes and their references for clearer intent. Routing and view-model imports are updated accordingly to reflect the new class names.
Modified Files
- doc/diagrama de classes Sports.drawio
- Updated file index pointer to reflect latest draw.io export
- lib/data/repositories/address/address_repository.dart
- Renamed
addressesListtoaddressList - Added optional
[bool forceRemote = false]parameter toinitializeandfetchsignatures
- Renamed
- lib/data/repositories/address/remote_address_repository.dart
- Updated getter from
addressesListtoaddressList - Adjusted
initializeandfetchmethod definitions to accept positionalforceRemoteflag
- Updated getter from
- lib/data/repositories/clubs/club_repository.dart
- Renamed
clubstoclubList - Changed
initializesignature to use optional positionalforceRemote
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Updated getter from
clubstoclubList - Refactored
initializeto call_loadAllLocaland_loadAllRemoteinstead of legacy fetch methods - Renamed internal fetch helpers to
_loadLocal(id)and_loadRemote(id) - Consolidated local cache operations
_saveLocal,_removeLocalCache,_loadAllLocal, and_loadAllRemote
- Updated getter from
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Corrected
bulkDeleteparameter ordering for Supabase match API call
- Corrected
- lib/data/services/remote_database_service.dart
- Changed
bulkDeletesignature to accept positionalconditionsmap
- Changed
- lib/domain/use_cases/address_billinginfo_user_case.dart
- Renamed
addressesListreference toaddressList
- Renamed
- lib/domain/use_cases/address_club_user_case.dart
- Renamed class from
AddressClubCasetoAddressClubUserCase - Updated constructor field ordering and import paths
- Adjusted parameter name from
oldUrltooldLogoUrl
- Renamed class from
- lib/domain/use_cases/address_user_user_case.dart
- Renamed class from
AddressUserCasetoAddressUserUserCase - Updated
addressesgetter to useaddressList
- Renamed class from
- lib/routing/router.dart
- Updated imports for renamed use-case classes (
AddressClubUserCase,AddressUserUserCase)
- Updated imports for renamed use-case classes (
- lib/ui/pages/address/address_register/address_register_view_model.dart
- lib/ui/pages/address/address_view_model.dart
- lib/ui/pages/club/club_register/club_register_view_model.dart
- lib/ui/pages/club/club_view_model.dart
- Updated import paths to reference the renamed use-case classes
- test/data/repositories/address/remote_address_repository_test.dart
- Changed invocation of
fetch(addressId, forceRemote: true)to positionalfetch(addressId, true) - Updated test reference from
addressesListtoaddressList
- Changed invocation of
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import and instantiation to use
AddressClubUserCase
- Updated import and instantiation to use
Conclusion
All interface signatures and class names are now consistent, ensuring clearer API usage and maintainable code structure.
2025/05/23 – version: 0.22.04+62
Clean up legacy fetch methods, refine repository docs, and enhance validation logic
This commit removes duplicated and obsolete local/fetch helper methods from address, billing, club, and schedule repositories, updates documentation in the ScheduleRepository interface, and adds validation safeguards in the storage service. These changes streamline repository implementations and ensure clearer, single-responsibility methods across the data layer.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Eliminated duplicated
_fetchAllFromLocaland_fetchAllFromDatabasedefinitions at class end - Consolidated address-loading logic in the primary initialization flow
- Eliminated duplicated
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Restored private helpers (
_fetchFromLocal,_fetchFromRemote,_cachePerson) after earlier removal - Ensured caching, remote fetch, and logging methods are present and documented
- Restored private helpers (
- lib/data/repositories/clubs/remote_club_repository.dart
- Removed stale
FIXMEcomment about uncached club fetch - Preserved only the necessary
_fetchFromRemoteinvocation
- Removed stale
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Stripped out redundant
_loadLocal,_loadRemote, and_saveCachemethods (now centralized) - Simplified
addmethod to use direct database insert calls with payload mapping - Retained cache key and simple ID utilities at class bottom
- Stripped out redundant
- lib/data/repositories/schedule/schedule_repository.dart
- Rewrote interface documentation to describe initialization, fetch, and add behaviors clearly
- Updated parameter descriptions and return semantics for all abstract methods
- lib/data/repositories/storage/remote_storage_repository.dart
- Added doc comment on
_validateFileAndGenerateNameto explain its purpose and failure mode
- Added doc comment on
Conclusion
Legacy helpers removed and documentation refined—repositories are now cleaner and storage paths validated reliably.
2025/05/23 – version: 0.22.03+61
Refactor initialization flags, rename Membership model, and adjust diagram and service logic
This commit standardizes initialization guards across repositories by renaming _started to _initialized, refactors the domain model from Membership to Affiliate, updates the class diagram to reflect geometry and style changes, and improves cache key logic and logging in database services. It also enhances UI components for address navigation and adds a cache inspection button on the home page. All tests and formatting have been updated accordingly.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted swimlane and mxGraphModel geometry attributes for consistency
- Standardized
parentattribute ordering and removed obsolete swimlane cells - Updated style and color codes on several edge and vertex definitions
- lib/data/repositories/address/remote_address_repository.dart
- Renamed
_startedto_initializedand updated guard conditions - Ensured repository only initializes once per user session
- Renamed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed
_startedto_initializedacross initialization and logout methods - Reset
_initializedflag on logout
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Renamed
_startedto_initializedand refined initialization check
- Renamed
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Renamed
_startedto_initialized, replaced manual cache fetch with_loadLocaland_loadRemotehelpers - Consolidated memory and device caching into
_saveCache - Simplified
fetchguard logic, improved error handling and orderBy usage - Adjusted delete sequence to remove from database before cache and memory
- Renamed
- lib/data/services/cache_database_service.dart
- Corrected key prefix matching from
'$prefix.'to'${prefix}_' - Added info-level logging for key retrieval
- Corrected key prefix matching from
- lib/data/services/remote_database_service.dart
- Inverted
conditionsnull check to only apply when non-null - Upgraded error logging from warning to severe for Postgrest and generic exceptions
- Inverted
- lib/utils/result.dart
- Introduced
resultSuccessconstant for reusableResult.success(null)
- Introduced
- lib/ui/core/ui/form_fields/address_form_field.dart
- Removed commented-out decoration colors and added explicit
contentPadding
- Removed commented-out decoration colors and added explicit
- lib/ui/pages/address/address_page.dart
- Fixed import path for
main_app_bar.dart - Extracted back-navigation into
_backPagemethod - Split floating action button into two: back and add, each with distinct
heroTag
- Fixed import path for
- lib/ui/pages/home/home_page.dart
- Added
providerimports and cache inspection button in app bar - Prints all keys starting with
'club'when tapped
- Added
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated test invocation of
fetch(clubId, true)to includeforceRemoteparameter
- Updated test invocation of
New Files
- lib/domain/models/affiliate.dart
- Renamed model from
MembershiptoAffiliate, updated constructor,copyWith, and factory methods - Adjusted imports and mapping logic to use
Affiliate.fromMap
- Renamed model from
Conclusion
All updates complete—initialization logic, model naming, and UI enhancements are in place and the system functions as expected.
2025/05/23 – version: 0.22.03+60
Refactored caching utilities and enhanced club and schedule data handling
This commit introduces multiple improvements across repositories, domain models, routing, and unit tests. Key changes include standardizing cache service method names, enhancing club and schedule serialization methods, refining local cache update logic, and adding a custom codec for route extras serialization. The AddressClub use case and related view models have been renamed and updated accordingly.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Renamed cache method from
getKeysStatedWithtogetKeysStartsWithfor consistency.
- Renamed cache method from
- lib/data/repositories/clubs/club_repository.dart
- Renamed
deletemethod parameter toclubIdfor improved clarity.
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Refactored local cache update logic into
_saveLocalCachehelper. - Refactored local cache removal logic into
_removeLocalCachehelper. - Replaced deprecated
toJsonString/fromJsonStringwithtoJson/fromJson. - Fixed minor documentation formatting and removed obsolete comments.
- Refactored local cache update logic into
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Renamed cache method to
getKeysStartsWith. - Refactored caching logic into
_saveCaching. - Modified
addand_addToDatabaseto standardize parameter order and avoid in-place list mutations.
- Renamed cache method to
- lib/data/services/cache_database_service.dart
- Renamed method
getKeysStatedWithtogetKeysStartsWithto improve semantic accuracy.
- Renamed method
- lib/domain/models/club.dart
- Replaced
toJsonString/fromJsonStringwithtoJson/fromJsonfor standardization.
- Replaced
- lib/domain/models/operating_day.dart
- Fixed
toMaplogic to correctly serializeidandclubIdfields.
- Fixed
- lib/domain/models/schedule.dart
- Changed
addDayfrom returning a new Schedule to mutating the existing instance. - Added
removeDaymethod for removing specific weekdays.
- Changed
- lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/address_club_case.dart
- Renamed file and class from
AddressClubUserCasetoAddressClubCasefor improved readability.
- Renamed file and class from
- lib/routing/router.dart
- Integrated
AppExtraCodecas theextraCodecforGoRouter. - Updated imports and use case instantiations to
AddressClubCase.
- Integrated
- lib/ui/pages/club/club_register/club_register_view_model.dart
- Updated use case reference to
AddressClubCase.
- Updated use case reference to
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Modified
addDayusage to align with mutable API. - Added
_resetSchedulemethod with corresponding button for clearing schedules. - Updated
_selectDayto useremoveDaywhen deselecting weekdays.
- Modified
- lib/ui/pages/club/club_view_model.dart
- Updated use case reference to
AddressClubCase.
- Updated use case reference to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated test to align with new mutable
addDaybehavior. - Adjusted expectations to reflect updated API usage.
- Updated test to align with new mutable
- test/data/repositories/user/remote_user_repository_test.dart
- Renamed fake cache method to
getKeysStartsWithfor consistency.
- Renamed fake cache method to
- test/domain/models/club_test.dart
- Replaced deprecated serialization methods in tests.
- test/domain/use_cases/address_club_user_case_test.dart
- Updated imports and instantiations to
AddressClubCase.
- Updated imports and instantiations to
New Files
- lib/routing/app_extra_codec.dart
- Introduced
AppExtraCodecfor serializing and deserializing routeextraparameters. - Supports
Club,Map<String, dynamic>, andStringtypes for routing data transport.
- Introduced
Conclusion
All changes have been successfully integrated, improving code consistency, maintainability, and type safety across the project. The system remains fully functional with enhanced route data serialization capabilities.
2025/05/23 – version: 0.22.03+59
Added schedule repository integration to address club use case
This commit integrates the schedule repository with the address club use case, ensuring that schedules are properly handled during club creation, update, fetch, and delete operations. It also introduces a new unit test to validate the complete CRUD flow for clubs and schedules in combination.
Modified Files
- lib/config/dependencies.dart
- Registered
ScheduleRepositoryand its remote implementation in the dependency injection. - Adjusted imports to use consistent absolute paths.
- Registered
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed constructor parameter from
localServicetocacheServicefor consistency.
- Renamed constructor parameter from
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Exposed
schedulesmap via getter. - Enhanced
fetchto allow bypassing memory cache with aforceRemoteparameter. - Corrected memory removal logic in
delete.
- Exposed
- lib/data/repositories/schedule/schedule_repository.dart
- Added getter for
schedules. - Modified
fetchsignature to include optionalforceRemoteparameter.
- Added getter for
- lib/domain/models/schedule.dart
- Renamed
copyWithDaymethod toaddDayfor improved semantic clarity.
- Renamed
- lib/domain/use_cases/address_club_user_case.dart
- Integrated
ScheduleRepositoryinto constructor and internal logic. - Updated
clubsgetter to combine clubs with their schedules. - Modified
load,fetchClub,addClub,updateClub, anddeleteClubto handle schedules accordingly.
- Integrated
- lib/routing/router.dart
- Passed
ScheduleRepositorydependency toAddressClubUserCase. - Minor import adjustments for consistency.
- Formatted
SchedulePageinitialization for better readability.
- Passed
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated method calls from
copyWithDaytoaddDayto reflect API change.
- Updated method calls from
- lib/ui/pages/club/club_view_model.dart
- Adjusted
clubsgetter toclubsListto reflect combined data source with schedules.
- Adjusted
- test/data/repositories/clubs/remote_club_repository_test.dart
- Added missing
awaittoinitializemethod call for proper async handling.
- Added missing
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Added comprehensive CRUD test covering add, fetch (memory and database), update, and delete operations for schedules.
New Files
- test/domain/use_cases/address_club_user_case_test.dart
- Added extensive test validating integration of
AddressClubUserCasewith schedule CRUD operations. - Covers full flow: load, add club with schedule, fetch, update, delete, and post-deletion fetch.
- Added extensive test validating integration of
Conclusion
All changes have been implemented and tested successfully. The schedule repository is now fully integrated within the address club use case, ensuring consistent and reliable handling of club schedules across the application.
2025/05/22 – version: 0.22.02+58
Enhance schedule repository with caching and update related components
This commit significantly improves the ScheduleRepository by adding in-memory and device caching mechanisms, enabling efficient initialization and retrieval of schedules. Additional changes include improvements to related services and models, alignment of method signatures, and comprehensive test coverage.
Modified Files
- Makefile
- Added
git statuscommand todifftarget for better workflow visibility.
- Added
- doc/diagrama de classes.drawio → doc/diagrama de classes Sports.drawio
- Renamed the file for better contextual clarity.
- lib/data/repositories/address/remote_address_repository.dart
- Updated internal method to use
getKeysStatedWithfor more precise cache key retrieval.
- Updated internal method to use
- lib/data/repositories/clubs/remote_club_repository.dart
- Replaced
getKeyswithgetKeysStatedWithfor consistent cache key handling.
- Replaced
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Added
CacheDatabaseServicedependency. - Implemented in-memory cache
_schedulesand_startedinitialization flag. - Introduced
_fetchAllFromCachefor device cache loading. - Updated
fetch,add,update, anddeletemethods to manage both memory and device cache. - Added
_cacheScheduleand_deviceCachinghelpers for consistent caching.
- Added
- lib/data/repositories/schedule/schedule_repository.dart
- Expanded interface with detailed documentation.
- Added
initializemethod for pre-loading schedules.
- lib/data/services/cache_database_service.dart
- Renamed
getKeystogetKeysStatedWithfor semantic accuracy.
- Renamed
- lib/data/services/remote_database_service.dart
- Improved
addmethod documentation to clarify semantics.
- Improved
- lib/domain/models/schedule.dart
- Renamed constructor parameter to
listODayfor consistency. - Renamed
listDaysgetter tolistODays. - Removed redundant
fromOperatingDaysfactory. - Simplified
copyWithDayto uselistODays.
- Renamed constructor parameter to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Implemented comprehensive test setup, including creation of dependencies such as user, address, and club.
- Prepared environment for schedule repository CRUD tests.
- test/data/repositories/user/remote_user_repository_test.dart
- Updated
FakeCacheimplementation to match newgetKeysStatedWithmethod signature.
- Updated
Assets and Test Data
- doc/diagrama de classes Sports.drawio
- Renamed for clarity but contents remain functionally unchanged.
Conclusion
This update strengthens the scheduling infrastructure by introducing robust caching mechanisms, optimizing data access patterns, and ensuring consistency across related components. All tests and supporting utilities have been updated accordingly, ensuring system stability and improved maintainability.
2025/05/21 – version: 0.22.02+57
Refactor repositories and enhance database service with WKB to WKT conversion
This commit introduces a comprehensive refactoring of repository classes, standardizing nomenclature from person to user. It also adds important improvements to DatabaseService, particularly WKB-to-WKT conversion for spatial data handling. Additional adjustments include enhancements in models and tests for improved robustness and consistency.
Modified Files
- analysis_options.yaml
- Added
formatterconfiguration to preserve trailing commas.
- Added
- lib/config/dependencies.dart
- Updated imports from
person_repositorytouser_repository. - Standardized constructor parameter names (
sharedPreferences→cacheService).
- Updated imports from
- lib/data/repositories/address/remote_address_repository.dart
- Renamed constructor parameter.
- Added null-check for fetched address result.
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed internal variables for clarity.
- Improved fetch logic with explicit null-checks.
- Modified
_fetchFromRemoteto returnResult<BillingInfo?>.
- lib/data/repositories/clubs/remote_club_repository.dart
- Enhanced
fetchmethod with explicit null-check. - Added removal of
schedulefield before database operations. - Added
FIXMEcomments regarding caching.
- Enhanced
- lib/data/repositories/common/server_names.dart
- Added new constants:
scheduleandlocationforClubsTableColumns.
- Added new constants:
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Added null-aware operator in
fromOperatingDays.
- Added null-aware operator in
- lib/data/repositories/person/remote_person_repository.dart → lib/data/repositories/user/remote_user_repository.dart
- Renamed file and updated import paths.
- Standardized variable names and method parameters from
persontouser.
- lib/data/repositories/person/person_repository.dart → lib/data/repositories/user/user_repository.dart
- Renamed file.
- Updated documentation and method signatures from
persontouser.
- lib/data/services/auth_service.dart
- Added optional
debugparameter toinitialize.
- Added optional
- lib/data/services/remote_database_service.dart
- Added
ClubsTableColumnsimport for location field handling. - Implemented
_wkbToWktmethod to convert spatial data. - Modified
fetchandfetchListto use WKB-to-WKT conversion. - Simplified
updateanddeletemethods for consistency.
- Added
- lib/domain/models/location.dart
- Fixed duplicate
fromMapconstructor. - Minor code rearrangement for clarity.
- Fixed duplicate
- lib/domain/models/schedule.dart
- Refactored to use
List<OperatingDay>for internal structure. - Added getter
listDays. - Simplified
copyWithandcopyWithDaymethods.
- Refactored to use
- lib/domain/use_cases/account_management_user_case.dart
- Updated import path for
user_repository.
- Updated import path for
- lib/domain/use_cases/address_billinginfo_user_case.dart
- Changed
fetchAddressreturn type toResult<Address?>.
- Changed
- lib/domain/use_cases/address_club_user_case.dart
- Changed
fetchAddressandfetchClubreturn types to nullableResult.
- Changed
- lib/domain/use_cases/address_user_case.dart
- Changed
fetchreturn type toResult<Address?>.
- Changed
- lib/routing/router.dart
- Updated import path for
user_repository.
- Updated import path for
- lib/ui/pages/address/address_view_model.dart
- Updated
fetchreturn type toFuture<Result<Address?>>.
- Updated
- lib/ui/pages/billinginfo/billinginfo_view_model.dart
- Updated
fetchAddressreturn type toFuture<Result<Address?>>.
- Updated
- lib/ui/pages/club/club_register/club_register_view_model.dart
- Updated
fetchClubandfetchAddresstypes to nullable. - Adjusted
_fetchClubmethod signature accordingly.
- Updated
- lib/ui/pages/club/club_view_model.dart
- Updated
fetchAddressreturn type toFuture<Result<Address?>>.
- Updated
- test/data/repositories/address/remote_address_repository_test.dart
- Corrected parameter name for
RemoteAddressRepository. - Improved test setup with
Uuidfor dynamic email generation.
- Corrected parameter name for
- test/data/repositories/auth/remote_auth_repository_test.dart
- Standardized test user creation with dynamic
Uuidemail. - Aligned test variable naming with refactor.
- Standardized test user creation with dynamic
- test/data/repositories/user/remote_user_repository_test.dart
- Corrected import path.
- Updated constructor parameters to match
RemoteUserRepository.
- test/domain/models/club_test.dart
- Updated
Scheduleinstantiation to useList<OperatingDay>.
- Updated
- test/domain/models/schedule_test.dart
- Refactored tests to accommodate new
Schedulelist-based constructor.
- Refactored tests to accommodate new
New Files
- test/data/repositories/clubs/remote_club_repository_test.dart
- Added comprehensive CRUD test for
RemoteClubRepository.
- Added comprehensive CRUD test for
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Placeholder for future
RemoteScheduleRepositorytests.
- Placeholder for future
Assets and Test Data
No assets or test data were added in this commit.
Conclusion
The refactoring and enhancements significantly improve code consistency, readability, and functionality, particularly in repository patterns and spatial data handling. All changes are complete and the system remains stable.
2025/05/20 – version: 0.22.02+56
Remove deprecated profile page and refactor listener naming
This commit removes the unused ProfilePage from the billing info module and renames listener callbacks in AddressRegisterPage to improve semantic clarity. Additionally, the changelog version dates were corrected to reflect the actual commit date.
Modified Files
- README.md
- Updated changelog dates from
2025/05/19to2025/05/20for versions0.22.01+54and0.22.01+55.
- Updated changelog dates from
- lib/ui/pages/address/address_register/address_register_page.dart
- Renamed
_onSaveto_onSavedto better reflect its purpose as a completion handler. - Updated listeners for
addandupdateoperations to use the new method name.
- Renamed
Deleted Files
- lib/ui/pages/BillingInfo/profile_page.dart
- Fully removed this file, which contained an outdated implementation of the billing profile registration UI.
- The page handled multiple roles (
athlete,manager) and supported various document types but is no longer part of the current workflow.
Conclusion
This update cleans up obsolete UI components and aligns listener naming for clarity, improving maintainability and reducing confusion during development.
2025/05/20 – version: 0.22.01+55
Refactor serialization and finalize schedule enhancements
This commit finalizes the enhancements to the Schedule and OperatingDay models by refining the serialization structure, improving developer ergonomics, and introducing weekday-specific getters. It also updates the database service for improved error logging, standardizes test environment loading, and enables user self-deletion through Supabase policy.
Modified Files
- README.md
- Added changelog entry for version 0.22.01+55 with a summary of refactors and improvements.
- lib/data/services/remote_database_service.dart
- Modified
update()to use.select()for accurate response parsing. - Rewrote
delete()with full try-catch error handling and logging. - Improved
_executeVoid()to properly handle and log API errors.
- Modified
- lib/domain/enums/enums_declarations.dart
- Added a placeholder utility method
byName(commented) for future use.
- Added a placeholder utility method
- lib/domain/models/location.dart
- Removed redundant
toString()method for cleaner output.
- Removed redundant
- lib/domain/models/schedule.dart
- Introduced weekday-specific getters (e.g.,
monday,tuesday, etc.). - Updated
toMap()to serializedaysas a map keyed by weekday names. - Improved
fromMap()to correctly parse nested weekday maps.
- Introduced weekday-specific getters (e.g.,
- pubspec.yaml
- Bumped version to
0.22.01+55.
- Bumped version to
- supabase/migrations/20250417191646_create_users_table.sql
- Added a new Supabase policy:
"Allow users to delete their own users".
- Added a new Supabase policy:
- test/data/repositories/auth/remote_auth_repository_test.dart
- Refactored
.envfile loading to a unified and centralized path.
- Refactored
- test/data/repositories/storage/remote_storage_repository_test.dart
- Standardized environment file path for consistency.
- test/data/services/remote_storage_service_test.dart
- Unified
.envfile path to use/test/.env_test_supabase.
- Unified
- test/data/services/supabase_auth_service_test.dart
- Updated path to
.envfor consistency across all Supabase-related tests.
- Updated path to
- test/domain/models/club_test.dart
- Fixed test expectation by aligning with
toPointString()representation forLocation.
- Fixed test expectation by aligning with
- test/domain/models/schedule_test.dart
- Rewrote
ScheduleandOperatingDaytests to reflect new serialization logic. - Verified
toMap,fromMap,toJson, andfromJsonround-trip integrity. - Added assertions for correct weekday serialization, deserialization, and structural consistency.
- Rewrote
Conclusion
This update completes the structural refactor of the scheduling system with a clean, consistent, and extensible design. All data access and serialization layers are now aligned, tests fully reflect the new structure, and Supabase permissions have been improved for user profile management.
2025/05/20 – version: 0.22.01+54
Update data model to support structured club schedules
This commit refactors the Schedule and OperatingDay models to enable structured storage and retrieval of weekly club operation hours in a normalized table (club_schedules). It also introduces a new repository for handling remote schedule data and updates related UI and data access layers accordingly.
Modified Files
- doc/diagrama de classes.drawio
- Replaced verbose per-day fields with a concise
Map<Weekday, OperatingDay>structure forSchedule. - Reduced height of the
Schedulecomponent to reflect simplified structure.
- Replaced verbose per-day fields with a concise
- lib/data/repositories/address/remote_address_repository.dart
- Internalized
_userIdand refactored_fetchAllFromDatabaseto remove the parameter. - Updated fetch calls to match new named parameters.
- Internalized
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Updated call to
fetchmethod to use named parameters.
- Updated call to
- lib/data/repositories/clubs/remote_club_repository.dart
- Updated fetch and fetchList calls to use named parameters.
- lib/data/repositories/common/server_names.dart
- Added
club_schedulestoTablesand createdClubSchedulesTableColumns.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated call to
fetchmethod to use named parameters.
- Updated call to
- lib/data/services/remote_database_service.dart
- Refactored
fetchandfetchListto use named parameters (id,fromMap,conditions). - Added
bulkDeletemethod for deleting multiple entries by condition. - Improved logging for error handling.
- Refactored
- lib/domain/models/club.dart
- Changed
scheduleto nullable and updated serialization accordingly.
- Changed
- lib/domain/models/operating_day.dart
- Introduced
id,clubId, andweekday. - Replaced
openandclosewithopenAtandcloseAt. - Moved
TimeOfDayextension to a separate file. - Enhanced JSON and map support.
- Introduced
- lib/domain/models/schedule.dart
- Simplified internal structure to use
Map<Weekday, OperatingDay>. - Added
fromOperatingDaysfactory. - Improved
toStringand JSON serialization.
- Simplified internal structure to use
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated UI logic to match new field names (
openAt,closeAt). - Adjusted
_pickTimeFromWeekand checkbox logic accordingly.
- Updated UI logic to match new field names (
- supabase/config.toml
- Disabled email confirmation for sign-in to simplify testing.
- supabase/migrations/20250514180524_create_clubs_table.sql
- Commented out old
schedulecolumn inclubs.
- Commented out old
- supabase/migrations/20250519171604_create_club_schedules.sql
- Added clarification comment on
weekdayfield constraint.
- Added clarification comment on
- test/data/repositories/address/remote_address_repository_test.dart
- Centralized environment configuration loading.
- Used values from
.env_test_supabaseinstead of hardcoding credentials.
- test/data/repositories/person/remote_person_repository_integration_test.dart → test/data/repositories/user/remote_user_repository_test.dart
- Renamed test file to reflect correct domain (
user). - Updated setup and teardown with dynamic Supabase auth and user creation.
- Refactored test logic to reflect new data structure.
- Renamed test file to reflect correct domain (
- test/domain/models/club_test.dart
- Updated tests to use new
OperatingDaystructure. - Adjusted serialization checks for
Schedule.
- Updated tests to use new
- test/domain/models/schedule_test.dart
- Refactored all tests to use
weekday,openAt,closeAt. - Updated serialization and deserialization expectations.
- Refactored all tests to use
New Files
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Repository implementation to fetch, add, update, and delete schedules using the normalized
club_schedulestable.
- Repository implementation to fetch, add, update, and delete schedules using the normalized
- lib/data/repositories/schedule/schedule_repository.dart
- Abstract definition for schedule operations to be implemented by repositories.
- lib/utils/extensions/time_of_day_extensions.dart
- Utility extension for
TimeOfDayto convert to/fromHH:MMandHH:MM:SSformats.
- Utility extension for
Assets and Test Data
- test/.env_test_supabase
- Moved
.env_test_supabaseto roottest/folder for consistent loading across integration tests.
- Moved
Conclusion
This refactoring completes the migration from a flat schedule string field to a fully normalized and structured model, enabling better flexibility and integration with the Supabase backend. The system is now ready to handle weekly scheduling with full test coverage and database synchronization.
2025/05/19 – version: 0.22.01+53
Refactor billing and club schedule models, enforce UUID and PostGIS support
This commit introduces several key changes: refactors to billing info naming conventions, enhancements to the Schedule model structure, inclusion of PostGIS and pgcrypto extensions in the database, and separation of sports position enums into a dedicated file. These modifications aim to improve modularity, database integrity, and naming consistency throughout the codebase.
Modified Files
- lib/config/dependencies.dart
- Updated import path for billing info repository.
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Renamed
profiletobillinginfoacross methods and properties.
- Renamed
- lib/data/repositories/billinginfo/remote_profile_repository.dart → remote_billinginfo_repository.dart
- File renamed and all internal references updated to
billinginfo.
- File renamed and all internal references updated to
- lib/data/services/remote_database_service.dart
- Removed dependency on
uuidpackage. - Replaced client-side UUID generation with server-side
gen_random_uuid(). - Enhanced
updateto optionally updateupdated_at.
- Removed dependency on
- lib/domain/enums/enums_declarations.dart
- Reordered
Weekdayenum entries. - Removed all embedded position enums.
- Reordered
- lib/domain/enums/enums_sports.dart
- Removed
Positionabstraction and all position-specific enums. - Introduced new sports:
footvolley,beachVolleybal.
- Removed
- lib/domain/enums/enums_sports_positions.dart
- Created new file encapsulating
Positioninterface and related enums for each sport. - Added
FootvolleyPositionandBeachVolleybalPosition.
- Created new file encapsulating
- lib/domain/models/club.dart
- Updated
locationto usetoPointString(). - Changed
schedulefrom JSON string to structured map.
- Updated
- lib/domain/models/location.dart
- Added support for PostGIS-compatible POINT string conversion.
- lib/domain/models/sportman.dart → membership.dart
- Renamed class
SportsmantoMembership. - Aligned terminology (
joinedAt,athleteId, etc.) and improved field consistency.
- Renamed class
- lib/domain/models/schedule.dart
- Replaced hardcoded weekday fields with a
Map<Weekday, OperatingDay>. - Updated serialization/deserialization methods accordingly.
- Replaced hardcoded weekday fields with a
- lib/domain/models/user.dart
- Minor comment clarification.
- lib/domain/use_cases/address_profile_user_case.dart → address_billinginfo_user_case.dart
- Refactored naming from
profiletobillinginfothroughout.
- Refactored naming from
- lib/routing/router.dart
- Updated routes and imports to reflect renaming of billing info and user registration modules.
- lib/routing/routes.dart
- Renamed route from
profilestobillinginfo.
- Renamed route from
- lib/ui/core/ui/drawer/main_drawer.dart
- Renamed
profilecallback tobillinginfo.
- Renamed
- lib/ui/pages/profile/profile_page.dart → billinginfo/profile_page.dart
- Relocated and renamed to
BillingInfoPage. - Refactored to align with new
BillingInfoViewModel.
- Relocated and renamed to
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Created new billing info screen with full editing functionality.
- lib/ui/pages/profile/profile_view_model.dart → billinginfo/billinginfo_view_model.dart
- Refactored view model and naming conventions from
ProfiletoBillingInfo.
- Refactored view model and naming conventions from
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated references to new
Scheduleimplementation with map-based structure.
- Updated references to new
- lib/ui/pages/home/home_page.dart
- Updated navigation and callback references from
profiletobillinginfo.
- Updated navigation and callback references from
- lib/ui/pages/home/person_register/person_resister_page.dart → user_register/user_resister_page.dart
- Renamed and reorganized user registration page.
- lib/ui/pages/home/person_register/person_resister_view_model.dart → user_register/user_resister_view_model.dart
- Renamed corresponding view model.
- test/domain/enums/enums_sports_test.dart
- Added import for new sports position enums.
- test/domain/models/club_test.dart
- Updated tests to match new
Schedulestructure usingMap<Weekday, OperatingDay>.
- Updated tests to match new
- test/domain/models/schedule_test.dart
- Adapted test cases for new schedule structure and removed deprecated JSON serialization test.
New Files
- doc/Pendeicias.md
- Markdown document listing design decisions and technical debts related to UUID generation and schedule refactoring.
- lib/domain/enums/enums_sports_positions.dart
- Centralized declaration of sports position enums and related logic.
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Fully functional UI page for managing billing info data.
- supabase/migrations/20250519171604_create_club_schedules.sql
- Creates
club_schedulestable with RLS policies and index. - Supports fine-grained control over schedule per weekday.
- Creates
Conclusão
The refactor modernizes data handling in the app and establishes a cleaner structure for scheduling, billing info, and user-related data. The system remains stable and is ready for further feature development.
2025/05/16 – version: 0.22.01+52
Renamed domain models and repositories to align with terminology
This commit refactors domain models, repositories, and Supabase table names for semantic clarity and better alignment with industry terminology. It replaces the term Person with UserModel and Profile with BillingInfo across all layers. Corresponding Supabase table names (person, profile, and address) have been renamed to users, billing_info, and addresses, respectively, with matching migration updates and security policies. Code dependencies and import paths have been updated accordingly.
Modified Files
lib/config/dependencies.dart- Updated dependency injection to use
UserRepositoryandBillingInfoRepository.
- Updated dependency injection to use
lib/data/repositories/address/remote_address_repository.dart- Renamed table and column references from
addresstoaddresses.
- Renamed table and column references from
lib/data/repositories/clubs/remote_club_repository.dart- Updated filter field to use
ClubsTableColumns.
- Updated filter field to use
lib/data/repositories/common/server_names.dart- Renamed constants for
Tables,AddressesTableColumns, andClubsTableColumns.
- Renamed constants for
lib/data/repositories/person/person_repository.dart- Replaced
PersonwithUserModelthroughout the interface.
- Replaced
lib/data/repositories/person/remote_person_repository.dart- Replaced all internal references of
PersonwithUserModel. - Renamed
RemotePersonRepositorytoRemoteUserRepository.
- Replaced all internal references of
lib/domain/use_cases/account_management_user_case.dart- Replaced
PersonwithUserModelandPersonRepositorywithUserRepository.
- Replaced
lib/domain/use_cases/address_profile_user_case.dart- Replaced
ProfilewithBillingInfo.
- Replaced
lib/routing/router.dart- Updated dependency and routing logic to reflect renamed repository interfaces and models.
lib/ui/core/ui/drawer/main_drawer.dart&main_drawer_header.dart- Updated to use
UserModelinstead ofPerson.
- Updated to use
lib/ui/pages/home/home_view_model.dart- Updated to reflect new naming for
UserModel.
- Updated to reflect new naming for
lib/ui/pages/home/person_register/person_resister_page.dart- Replaced
PersonwithUserModeland related logic.
- Replaced
lib/ui/pages/home/person_register/person_resister_view_model.dart- Updated view model to manage
UserModeldata.
- Updated view model to manage
lib/ui/pages/profile/profile_page.dart- Replaced
ProfilewithBillingInfo.
- Replaced
lib/ui/pages/profile/profile_view_model.dart- Refactored to work with
BillingInfoas the domain model.
- Refactored to work with
test/data/repositories/address/remote_address_repository_test.dart- Updated table name from
addresstoaddresses.
- Updated table name from
test/data/repositories/person/remote_person_repository_integration_test.dart- Refactored test setup, assertions, and cleanup to use
UserModelanduserstable.
- Refactored test setup, assertions, and cleanup to use
New Files
lib/data/repositories/billinginfo/billinginfo_repository.dart- New interface for managing billing info records.
lib/data/repositories/billinginfo/remote_profile_repository.dart- Refactored from
remote_profile_repository.dart, implementingBillingInfoRepository.
- Refactored from
lib/domain/models/billinginfo.dart- Refactored from
profile.dartto represent billing-related user data.
- Refactored from
supabase/migrations/20250512192942_create_billing_info_table.sql- SQL script to create the new
billing_infotable, with appropriate indexes and policies.
- SQL script to create the new
Deleted Files
lib/data/repositories/profiles/profile_repository.dart- Removed legacy profile repository interface.
lib/domain/models/profile.dart- Superseded by
billinginfo.dart.
- Superseded by
supabase/migrations/20250512192942_create_profile_table.sql- Removed obsolete migration for
profiletable.
- Removed obsolete migration for
supabase/migrations/20250417191646_create_person_table.sql- Renamed to
create_users_table.sql.
- Renamed to
Conclusion
This large-scale refactor completes the transition from generic profile/person naming to domain-specific terminology, improving clarity, maintainability, and semantic accuracy across all layers of the application.
2025/05/16 – version: 0.22.01+51
Added password recovery and confirmation email workflows
This commit introduces password recovery and account confirmation flows into the app. It includes UI and backend integration for sending recovery and confirmation emails, improves user feedback during login errors, and updates email templates. Additionally, it refactors imports for consistency and initializes the logger earlier in the application lifecycle.
Modified Files
README.md- Updated the section title to reflect the current MVVM folder structure.
lib/main.dart- Extracted authentication and logger initialization into dedicated functions.
- Ensured logger applies ANSI color codes based on log severity.
lib/routing/router.dart- Replaced relative imports with root-relative paths for consistency across the routing layer.
lib/data/repositories/auth/auth_repository.dart- Declared methods for sending password recovery and confirmation emails.
lib/data/repositories/auth/dev_auth_repository.dart- Added mock implementations of the new methods returning
Result.success.
- Added mock implementations of the new methods returning
lib/data/repositories/auth/remote_auth_repository.dart- Integrated remote implementations for
sendPasswordRecoveryandresendConfirmationEmail.
- Integrated remote implementations for
lib/data/services/auth_service.dart- Implemented the logic for sending confirmation emails via Supabase.
lib/data/services/remote_database_service.dart- Refactored query builder to resolve assignment type errors with chained filters and transformations.
lib/domain/use_cases/account_management_user_case.dart- Added use cases for password recovery and confirmation email resend.
lib/ui/core/ui/messages/app_snack_bar.dart- Introduced reusable methods:
showSnackErrorandshowSnackSuccess.
- Introduced reusable methods:
lib/ui/pages/profile/profile_page.dart- Enabled word capitalization in the legal guardian name text field.
lib/ui/pages/sign_in/sign_in_page.dart- Connected the password recovery logic to the UI.
- Added robust error handling based on Supabase error codes.
- Provided confirmation prompt UI when email is not confirmed.
- Managed focus and keyboard state cleanly.
lib/ui/pages/sign_in/sign_in_view_model.dart- Exposed recovery and reauthentication methods from the use case.
lib/ui/pages/sign_up/sign_up_page.dart- Refactored one import path to follow root-relative pattern.
lib/utils/validates/sign_validate.dart- Adjusted the password validation regex to exclude whitespace characters.
pubspec.yaml- Bumped the app version to
0.22.01+50.
- Bumped the app version to
supabase/config.toml- Enabled email confirmations.
- Adjusted password requirements.
- Linked Supabase to HTML email templates for confirmation and recovery.
New Files
supabase/templates/confirmation.html- HTML template used by Supabase to send confirmation emails.
supabase/templates/recovery.html- HTML template used by Supabase to send password recovery emails.
Conclusion
The authentication system now supports full email-based password recovery and account confirmation flows, with enhanced UI feedback and improved configuration.
2025/05/16 – version: 0.22.01+50
Renamed section in README and standardized import paths in router
This commit updates the README section title to correctly reflect the current folder structure of the project based on the MVVM architecture. Additionally, it refactors import paths within router.dart to use consistent root-relative imports (/ui/...) instead of mixed relative patterns.
Modified Files
README.md- Updated the section header from “Estrutura de Coleções do Firebase” to “Estrutura de Arquivos do Projeto no Padrão MVVM” to better reflect the current content.
lib/routing/router.dart- Replaced multiple
../ui/...and../data/...relative imports with root-relative/ui/...and/data/...imports. - Ensured consistent and clean import formatting for all modules used in route configuration.
- Replaced multiple
Conclusion
The changes improve documentation clarity and maintain consistent import semantics across the routing layer, aligning with best practices for modular Flutter project organization.
2025/05/15 – version: 0.22.00+49
Refactored UI structure and adjusted imports to match new directory layout
This commit performs a comprehensive reorganization of the lib/ui/features/ directory structure into a new, more intuitive lib/ui/pages/ hierarchy. It also updates all relevant import statements throughout the application to reflect this new structure, aligning with standard practices for scalable Flutter projects. Minor style and consistency improvements in imports were also applied.
Modified Files
README.md- Replaced outdated Firebase schema tree with a structured representation of the project’s MVVM folder layout.
lib/config/dependencies.dart- Updated import path for
theme_view_model.dartto reflect its new location.
- Updated import path for
lib/data/repositories/auth/remote_auth_repository.dart- Converted relative import from
package:to/style forcache_database_service.dart.
- Converted relative import from
lib/domain/models/schedule.dart- Replaced
package:import with relative/path.
- Replaced
lib/domain/models/sportman.dart- Adjusted import path to use a relative
/reference for extensions.
- Adjusted import path to use a relative
lib/domain/use_cases/address_club_user_case.dart- Updated import to use relative path for
server_names.dart.
- Updated import to use relative path for
lib/main_app.dart- Adjusted import for
theme_view_model.dartdue to file relocation.
- Adjusted import for
lib/routing/router.dart- Updated all UI-related imports from
features/topages/. - Ensured consistency in the routing setup to reflect new structure.
- Updated all UI-related imports from
lib/ui/core/ui/...files- Updated various
package:style imports to relative/references to improve maintainability and uniformity.
- Updated various
Conclusion
All UI components were successfully migrated to the pages directory, and imports were refactored to ensure consistency across the project. This restructuring promotes clarity and maintainability as the codebase scales.
2025/05/15 – version: 0.21.02+48
Refactored club and home modules for improved UX and code cohesion
This commit introduces several enhancements across the club and home modules, focusing on usability, consistency, and architectural improvements. Notable changes include the integration of edit/remove actions via Dismissible lists, refactored theme handling, unified avatar image management, and improvements in AccountManagementUseCase.
Modified Files
doc/diagrama de classes.drawio- Adjusted layout dimensions and positions.
- Renamed and replaced use case method names to reflect authentication semantics (
login,logout,signUp, etc.). - Added new visual methods like
_processPhoto()and updated others to better represent their intent.
lib/domain/models/schedule.dart- Changed the string join separator from newline to comma for better display formatting.
lib/domain/use_cases/account_management_user_case.dart- Refactored
updatePersonto include internal photo processing via_processPhoto. - Added
_processPhotomethod to manage avatar uploads or updates with storage fallback.
- Refactored
lib/domain/use_cases/address_club_user_case.dart- Added error logging on logo update failure.
- Used a fallback to existing logo if the update result is null.
lib/routing/router.dart- Passed existing
Clubasextrawhen navigating toClubRegisterPage. - Reordered constructor parameters to reflect logical dependency flow.
- Applied naming consistency (
viewModel,authenticationUserCase).
- Passed existing
lib/ui/core/ui/cards/address_card.dart- Removed default margin from card to allow custom layout spacing externally.
lib/ui/core/ui/drawer/main_drawer.dart- Replaced theme toggler with a simple
isDarkboolean for drawer rendering.
- Replaced theme toggler with a simple
lib/ui/core/ui/images/avatar_image.dart- Renamed
imagePathtoimagefor consistency and clarity.
- Renamed
lib/ui/core/ui/images/select_avatar_image.dart- Updated property reference from
imagePathtoimage.
- Updated property reference from
lib/ui/core/ui/others/main_app_bar.dart- Replaced
actionWidgetwith a fullactionslist to support multiple actions. - Removed theme toggle logic from within the component.
- Replaced
lib/ui/features/address/address_page.dart- Updated
MainAppBarto use newactionsformat.
- Updated
lib/ui/features/address/widgets/dismissible_address.dart- Wrapped
Dismissiblewidget in aPaddingto provide vertical spacing.
- Wrapped
lib/ui/features/club/club_page.dart- Implemented
Dismissiblefor each club in the list with edit and remove actions. - Added visual polish with spacing and card color.
- Added
_removeClubmethod to handle removal with feedback.
- Implemented
lib/ui/features/club/club_register/club_register_page.dart- Added
_initialize()to populate form when editing an existing club. - Ensured consistent assignment of
idandcreatedAtduring form submission.
- Added
lib/ui/features/club/club_register/club_register_view_model.dart- Replaced
Command1forfetchAddresswith direct access to the use case method.
- Replaced
lib/ui/features/club/club_view_model.dart- Implemented
deleteClubmethod with success/failure logging.
- Implemented
lib/ui/features/home/home_page.dart- Switched from ViewModel-based theme to centralized ViewModel state.
- Updated app bar and drawer to use unified state and toggle.
lib/ui/features/home/home_view_model.dart- Integrated
ThemeViewModelintoHomeViewModelto centralize theme logic. - Added
toggleThemecommand andisDarkgetter.
- Integrated
Conclusion
The modifications improve maintainability, clarity, and user experience, particularly around theming, club management, and state-driven UI updates. All modules compile and behave as expected.
2025/05/15 – version: 0.21.01+47
Refactored Storage Services and Club Management with Logo Upload Support
This commit introduces significant changes to unify and streamline the use of storage and database services across the codebase. It renames RemoteDatabaseService and RemoteStorageService to more general DatabaseService and StorageService. The commit also refactors the logic for managing club logos, allowing file upload, update, and deletion through a dedicated Supabase bucket (club_logos), with proper RLS policies defined.
Modified Files
- lib/config/dependencies.dart
- Replaced
RemoteDatabaseServiceandRemoteStorageServicewithDatabaseServiceandStorageService. - Updated dependency injection for repositories.
- Replaced
- lib/data/repositories/address/remote_address_repository.dart
- Replaced
RemoteDatabaseServicewith the newDatabaseService.
- Replaced
- lib/data/repositories/clubs/club_repository.dart
- Added optional
forceRemoteparameter toinitialize.
- Added optional
- lib/data/repositories/clubs/remote_club_repository.dart
- Replaced service class names.
- Enhanced
initializewith local/remote fallback. - Fixed incorrect cache key prefix (from
addresstoclubs). - Improved exception handling and added logs.
- lib/data/repositories/common/server_names.dart
- Added
clubLogosconstant to theBucketsclass.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated service references to use
DatabaseService.
- Updated service references to use
- lib/data/repositories/profiles/remote_profile_repository.dart
- Updated service references to use
DatabaseService.
- Updated service references to use
- lib/data/repositories/storage/remote_storage_repository.dart
- Replaced
RemoteStorageServicewithStorageService. - Updated
add,update, anddeletemethods to explicitly requirebucketandurl. - Removed fixed references to the
avatarsbucket.
- Replaced
- lib/data/repositories/storage/storage_repository.dart
- Updated interface methods to support configurable
bucketandurlparameters.
- Updated interface methods to support configurable
- lib/data/services/remote_database_service.dart
- Renamed class from
RemoteDatabaseServicetoDatabaseService.
- Renamed class from
- lib/data/services/remote_storage_service.dart
- Renamed class from
RemoteStorageServicetoStorageService. - Updated parameters in
addandupdatemethods tofilePath.
- Renamed class from
- lib/domain/enums/enums_sports.dart
- Added
byLabelstatic method for retrievingSportsby their label.
- Added
- lib/domain/use_cases/account_management_user_case.dart
- Refactored
_processPhototo use newStorageRepositoryinterface withbucketandfilePath.
- Refactored
- lib/domain/use_cases/address_club_user_case.dart
- Injected
StorageRepository. - Added full lifecycle management for club logo:
_processLogofor upload/delete.- Logo management integrated into
addClub,updateClub, anddeleteClub.
- Injected
- lib/domain/use_cases/address_profile_user_case.dart
- Updated import paths to use project-relative style.
- lib/routing/router.dart
- Updated
AddressClubUserCaseinjection to includeStorageRepository.
- Updated
- lib/ui/core/ui/text_fields/select_text_field.dart
- Added
unfocus()call to close keyboard before showing enum labels.
- Added
- lib/ui/features/club/club_page.dart
- Refactored
ListViewbuilding to avoid usage of stale child builder.
- Refactored
- lib/ui/features/club/club_register/club_register_page.dart
- Added validation to all fields.
- Injected logo processing into save logic.
- Used merged
Listenablefor save button state. - Enhanced feedback with
AppSnackBaron success and failure.
- lib/ui/features/club/club_register/widgets/schedule_page.dart
- Fixed typo in AppBar title.
- Applied
AppFontsStyleto time text.
- lib/ui/features/profile/profile_page.dart
- Added success snackbar after updating profile.
- lib/utils/validates/generics_validate.dart
- Renamed
notEmptytoisNotEmptyfor clarity and consistency.
- Renamed
- test/data/repositories/address/remote_address_repository_test.dart
- Replaced
RemoteDatabaseServicewithDatabaseService.
- Replaced
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated test passwords to stronger values.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Updated service name to
DatabaseService.
- Updated service name to
- test/data/repositories/storage/remote_storage_repository_test.dart
- Refactored to support new
bucketandfilePathparameters.
- Refactored to support new
- test/data/services/remote_storage_service_test.dart
- Updated test references to renamed service and parameter names.
- test/data/services/supabase_auth_service_test.dart
- Updated test passwords to comply with stricter validation.
New Files
- supabase/migrations/20250515160917_create_club_logos_buckt.sql
- Creates
club_logosbucket in Supabase with public access. - Adds RLS policies for
INSERT,UPDATE,DELETE, andSELECTto allow only authenticated users to manage their own files.
- Creates
Conclusion
The storage and database layers have been unified with more consistent naming and parameterization, improving clarity and flexibility. Club logo management is now fully integrated, with support for Supabase Storage and appropriate access control. The system remains stable and fully functional.
2025/05/14 – version: 0.21.01+46
Implement club schedule support and finalize club registration flow
This commit completes the implementation of club registration by enabling support for structured schedule data, enhanced form controls, and Supabase backend integration. It includes creation of a new SchedulePage, form validation, extended input handling, and a dedicated database migration with row-level security policies.
Modified Files
- lib/data/repositories/clubs/remote_club_repository.dart
- Replaced all references from
Tables.clubtoTables.clubs. - Ensured consistency with updated table name across fetch, add, update, and delete operations.
- Replaced all references from
- lib/data/repositories/common/server_names.dart
- Renamed
club→clubsin theTablesclass for plural consistency.
- Renamed
- lib/domain/enums/enums_declarations.dart
- Removed commented-out
AddressTypeenum for cleanup.
- Removed commented-out
- lib/domain/enums/enums_sports.dart
- Added static method
byName()to convert from string to enum value.
- Added static method
- lib/domain/models/club.dart
- Made
idoptional to support creation flows before persistence.
- Made
- lib/domain/models/operating_day.dart
- Added method
toHHMM()to format operating times.
- Added method
- lib/domain/models/schedule.dart
- Introduced
scheduleMap,copyWithDay, and improvedtoString()formatting for display and mutation.
- Introduced
- lib/routing/router.dart
- Added routing support for
/scheduleusingSchedulePage, passing current schedule and onSave callback viaextra.
- Added routing support for
- lib/routing/routes.dart
- Declared the
/scheduleroute as a constant.
- Declared the
- lib/ui/core/ui/others/main_app_bar.dart
- Added
onBackoptional callback to override default navigation behavior.
- Added
- lib/ui/core/ui/text_fields/select_text_field.dart
- Improved customization by supporting
prefixIconas a widget.
- Improved customization by supporting
- lib/ui/features/club/club_register/club_register_page.dart
- Finalized the UI for club registration.
- Integrated
AvatarFormField,SchedulePage, andCurrencyEditingController. - Added full form validation, edit support, and submission logic.
- lib/ui/features/club/club_register/club_register_view_model.dart
- Added
userIdgetter to simplify access to the current user.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Simplified image validator by using centralized
GenericsValidate.image.
- Simplified image validator by using centralized
- lib/ui/features/profile/profile_page.dart
- Adapted to new
SelectTextFieldcustomization.
- Adapted to new
- lib/utils/validates/generics_validate.dart
- Added
imagevalidator method to ensure photo input isn’t null or empty.
- Added
New Files
- lib/ui/features/club/club_register/widgets/schedule_page.dart
- A new interactive page for selecting weekly schedule with duration and time pickers.
- lib/utils/extensions/time_of_day_extension.dart
- Extension on
TimeOfDayfor arithmetic and display formatting.
- Extension on
- lib/ui/core/ui/editing_controllers/currency_editing_controller.dart
- Custom
TextEditingControllerfor currency input with formatting and parsing.
- Custom
- supabase/migrations/20250514180524_create_clubs_table.sql
- Migration script to create the
clubstable with required fields and constraints. - Includes row-level security policies for insert, select, update, and delete.
- Indexes created on
manager_idandcreated_at.
- Migration script to create the
Conclusion
The club registration process is now fully functional, complete with schedule management, validation, and backend integration. These changes improve user experience and data integrity, supporting future scalability.
2025/05/14 – version: 0.21.01+45
Refactor profile and address handling to use full Address objects
This commit refactors how address selection and profile association are handled across the UI. Instead of relying solely on address IDs, Address objects are now passed and retained throughout components. This approach simplifies the logic and avoids redundant fetches. Additionally, minor refinements were made to enums and text field components for consistency and flexibility.
Modified Files
- lib/domain/enums/enums_declarations.dart
- Refined comment for
UserRole.collaboratorto clarify its purpose.
- Refined comment for
- lib/domain/enums/enums_sports.dart
- Added
labelsanddescriptionsaccessors for UI binding.
- Added
- lib/domain/use_cases/address_user_case.dart
- Added a new
fetchmethod to retrieve full address data by ID.
- Added a new
- lib/ui/core/ui/form_fields/address_form_field.dart
- Updated the
selectAddresscallback to work withAddress?instead ofString?.
- Updated the
- lib/ui/core/ui/text_fields/select_text_field.dart
- Changed
iconDatatoprefixIconto allow greater customization of input decorations. - Made
hintTextoptional.
- Changed
- lib/ui/features/address/address_page.dart
- Refactored address selection to use
Addressobjects directly. - Address lookup by ID on page initialization now returns the full object.
- Refactored address selection to use
- lib/ui/features/address/address_view_model.dart
- Exposed
fetchfunction to allow address fetching by ID.
- Exposed
- lib/ui/features/address/widgets/dismissible_address.dart
- Updated address selection callback to return the
Addressobject.
- Updated address selection callback to return the
- lib/ui/features/club/club_register/club_register_page.dart
- Implemented the club form UI with support for selecting an address and sport type.
- lib/ui/features/home/person_register/person_resister_page.dart
- Migrated to use
prefixIconforSelectTextField.
- Migrated to use
- lib/ui/features/profile/profile_page.dart
- Refactored address handling to work with full
Addressobjects. - Removed dependency on
Command1forfetchAddress, using direct function call instead. - Simplified the state handling during profile initialization.
- Refactored address handling to work with full
- lib/ui/features/profile/profile_view_model.dart
- Replaced
Command1with a plain function forfetchAddressto align with other use cases.
- Replaced
Conclusion
Address handling is now more robust and cohesive throughout the app. The refactor improves code clarity and reduces unnecessary complexity in address resolution and state synchronization.
2025/05/14 – version: 0.21.01+44
Add club management feature with new use case, UI pages, and routing
This commit introduces a complete feature for managing sports clubs, including data access layers, use cases, UI pages, and route configurations. It also removes the now-inlined AccountManagementUseCase from the global provider list, reorganizes app bar imports, and enhances naming consistency in constructors and internal properties.
Modified Files
- lib/config/dependencies.dart
- Removed the global
AccountManagementUseCaseprovider. - Registered the new
RemoteClubRepositorywith the DI container. - Renamed parameters for consistency (
service→databaseService).
- Removed the global
- lib/data/repositories/address/remote_address_repository.dart
- Renamed constructor parameter
servicetodatabaseServicefor clarity.
- Renamed constructor parameter
- lib/data/repositories/clubs/remote_club_repository.dart
- Standardized constructor parameters (
cacheService,databaseService). - Changed
_userIdto nullable. - Cleared
_userIdon logout.
- Standardized constructor parameters (
- lib/data/repositories/profiles/remote_profile_repository.dart
- Renamed parameter
remoteServicetodatabaseService.
- Renamed parameter
- lib/domain/use_cases/address_profile_user_case.dart
- Renamed
fetchtofetchAddressfor consistency with new use cases.
- Renamed
- lib/routing/router.dart
- Injected
AccountManagementUseCaseinline into the respective view models. - Added routes for
clubsandclubRegister, initializing view models withAddressClubUserCase.
- Injected
- lib/routing/routes.dart
- Added two new routes:
clubsandclubRegister.
- Added two new routes:
- lib/ui/core/ui/drawer/main_drawer.dart
- Added a menu entry for
Clubesthat is shown when the user is logged in.
- Added a menu entry for
- lib/ui/features/address/address_page.dart
- lib/ui/features/address/address_register/address_register_page.dart
- lib/ui/features/home/home_page.dart
- lib/ui/features/home/person_register/person_resister_page.dart
- lib/ui/features/profile/profile_page.dart
- Updated imports of
main_app_bar.dartto its new location (core/ui/others). - Adjusted ViewModel usage patterns for consistency.
- Ensured creation timestamps fall back to existing values when editing.
- Updated imports of
- lib/ui/features/profile/profile_view_model.dart
- Updated reference to renamed method
fetchAddress.
- Updated reference to renamed method
- test/data/repositories/address/remote_address_repository_test.dart
- Updated parameter name to
databaseServiceinRemoteAddressRepository.
- Updated parameter name to
New Files
- lib/domain/use_cases/address_club_user_case.dart
- Encapsulates interaction logic between address and club repositories.
- lib/ui/features/club/club_page.dart
- Displays a list of registered clubs with actions for creating and managing clubs.
- lib/ui/features/club/club_register/club_register_page.dart
- Scaffold for creating or editing clubs, integrated with
ClubRegisterViewModel.
- Scaffold for creating or editing clubs, integrated with
- lib/ui/features/club/club_register/club_register_view_model.dart
- ViewModel handling commands for CRUD operations related to clubs.
- lib/ui/features/club/club_view_model.dart
- Handles data loading and UI binding for the club listing page.
Conclusion
The club feature is now fully integrated with the system architecture, routing, and UI. The changes follow consistent architectural patterns and are ready for further extension and testing.
2025/05/12 – version: 0.21.00+43
Refactor profile state and enhance profile submission handling
This commit refactors the internal naming of the profile state in the RemoteProfileRepository, replacing _manager with the more semantically accurate _profile. It also extends the profile form submission on the UI side, introducing logic to handle and construct additional document types when creating or updating a Profile. Lastly, it improves password security in the Supabase config and fixes a policy target in a SQL migration.
Modified Files
- lib/data/repositories/profiles/remote_profile_repository.dart
- Renamed
_managerto_profilefor consistency and clarity across internal state. - Updated all related references and assignments accordingly.
- Maintained functional behavior while improving semantic accuracy.
- Renamed
- lib/ui/features/profile/profile_page.dart
- Added
_createProfile()method to encapsulate profile creation logic. - Included support for additional document types (
RG,CNH,CNPJ) using a second document field. - Connected profile creation and update operations to the appropriate view model methods.
- Ensured safe fallback when no profile is found during initialization.
- Added
- supabase/config.toml
- Strengthened password requirements by setting
password_requirementsto"lower_upper_letters_digits_symbols".
- Strengthened password requirements by setting
- supabase/migrations/20250512192942_create_profile_table.sql
- Fixed incorrect policy reference by changing
ON persontoON profileinselect_own_profile.
- Fixed incorrect policy reference by changing
Conclusion
The changes streamline profile state handling, extend profile creation capabilities, and reinforce backend security. All features are now consistent and functional.
2025/05/12 – version: 0.20.04+42
Added club repository support and unified cache management
This commit introduces the ClubRepository and its implementation, enabling full CRUD operations for club data integrated with both cache and remote services. Additionally, it unifies cache handling across multiple repositories (Address, Profile, Auth) and renames/reorganizes profile-related files for better modularity.
Modified Files
- lib/config/dependencies.dart
- Adjusted imports for
ProfileRepository. - Injected
CacheDatabaseServiceintoRemoteAuthRepository.
- Adjusted imports for
- lib/data/repositories/address/address_repository.dart
- Added
logout()method to clear local address data.
- Added
- lib/data/repositories/address/remote_address_repository.dart
- Renamed internal variables for clarity (
_prefs→_cacheService,_service→_databaseService). - Replaced references to old Supabase service with updated abstractions.
- Added
logout()to clear address memory cache.
- Renamed internal variables for clarity (
- lib/data/repositories/auth/remote_auth_repository.dart
- Added optional injection of
CacheDatabaseService. - Cleared cache on login and logout events.
- Added optional injection of
- lib/data/repositories/common/server_names.dart
- Added
clubtable constant. - Introduced
ClubTableColumnsdefinition.
- Added
- lib/data/repositories/profiles/profile/profile_repository.dart → lib/data/repositories/profiles/profile_repository.dart
- Moved and refactored the interface file for cleaner structure.
- lib/data/repositories/profiles/profile/remote_profile_repository.dart → lib/data/repositories/profiles/remote_profile_repository.dart
- Adjusted imports and variable names (
_localService→_cacheService). - Now consistently uses
_cacheServiceacross all methods.
- Adjusted imports and variable names (
- lib/data/services/cache_database_service.dart
- Added
clear()method to reset shared preferences storage.
- Added
- lib/domain/models/club.dart
- Made
idfield nullable. - Renamed
toJson()totoJsonString()andfromJson()tofromJsonString(). - Removed unused
toString, equality, andhashCodeoverrides.
- Made
- lib/domain/use_cases/address_profile_user_case.dart
- Adjusted import path for
ProfileRepository.
- Adjusted import path for
- lib/routing/router.dart
- Fixed inconsistent import paths and formatting for route definitions.
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Assigned default value
1tomaxLines.
- Assigned default value
- lib/ui/features/profile/profile_page.dart
- Ensures
_isEditingis set totrueafter successful profile load.
- Ensures
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated repository instantiation to use named parameters.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Implemented the
clear()method in theFakeCacheclass.
- Implemented the
- test/domain/models/club_test.dart
- Updated calls to use
toJsonStringandfromJsonString.
- Updated calls to use
New Files
- lib/data/repositories/clubs/club_repository.dart
- Defines the
ClubRepositoryinterface with standard CRUD and session-related methods.
- Defines the
- lib/data/repositories/clubs/remote_club_repository.dart
- Implements the
ClubRepositorywith support for memory caching, local storage, and remote fetch using Supabase.
- Implements the
Conclusion
The system now supports club data operations and has a unified strategy for clearing cached data across repositories. All changes have been tested and are functionally stable.
2025/05/12 – version: 0.20.03+41
Migrate profile roles into unified model and implement remote profile persistence
This commit introduces a significant refactor to how user profiles are modeled and persisted. The previous individual classes for each user role (AthleteProfile, ManagerRole, etc.) have been consolidated into a single Profile model. A new repository layer was added to handle remote profile data storage using Supabase. Supporting updates were made to view models, use cases, and routing to align with the new structure.
Modified Files
- lib/config/dependencies.dart
- Registered
ProfileRepositoryandRemoteProfileRepository. - Aligned providers for
AuthRepository,StorageRepository, and others.
- Registered
- lib/data/repositories/auth/auth_repository.dart
AuthRepositorynow extendsChangeNotifier.
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated implementation to extend
ChangeNotifier.
- Updated implementation to extend
- lib/data/repositories/common/server_names.dart
- Added new constant
Tables.profile.
- Added new constant
- lib/data/repositories/person/remote_person_repository.dart
- Improved error handling and consistency in
deleteandlogout.
- Improved error handling and consistency in
- lib/domain/enums/enums_declarations.dart
- Adjusted role label (“Presidente” → “Gerente”).
- Added static method
byNametoSexenum for safer parsing.
- lib/domain/models/document.dart
- Added named constructors for each document type (
cpf,rg, etc.).
- Added named constructors for each document type (
- lib/domain/use_cases/account_management_user_case.dart
- Refactored to use interface
StorageRepository.
- Refactored to use interface
- lib/domain/use_cases/address_profile_user_case.dart
- Integrated
ProfileRepositoryand exposedprofile,addProfile, andupdateProfile.
- Integrated
- lib/routing/router.dart
- Updated route setup for
ProfilePageto includePersonRepository.role. - Injected
ProfileRepositoryintoAddressProfileUserCase.
- Updated route setup for
- lib/ui/core/ui/cards/address_card.dart
- Cleaned up import statements.
- lib/ui/core/ui/form_fields/sex_form_field.dart
- Fixed layout inconsistencies and ensured state sync on updates.
- lib/ui/features/profile/profile_page.dart
- Enhanced to load and bind existing profile data on edit.
- Added logic to differentiate between create and update flows.
- Integrated profile document selection and form feedback.
- lib/ui/features/profile/profile_view_model.dart
- Exposed
addProfile,updateProfile,userId, and currentprofile.
- Exposed
New Files
- lib/data/repositories/profiles/profile/profile_repository.dart
- Interface defining contract for profile repository.
- lib/data/repositories/profiles/profile/remote_profile_repository.dart
- Implementation of
ProfileRepositoryusing Supabase and local caching. - Handles
fetch,add,update,delete, and initialization logic.
- Implementation of
- lib/domain/models/profile.dart
- Unified
Profilemodel supporting all role data (sex, cpf, guardian, etc.). - Includes serialization and equality methods.
- Unified
Deleted Files
- lib/domain/models/profiles/*.dart
- Removed separate profile models:
athlete_profile.dart,manager_profile.dart, etc. - Superseded by the unified
Profileclass.
- Removed separate profile models:
Assets and Test Data
- supabase/migrations/20250512192942_create_profile_table.sql
- Created
profiletable with fields for address, sex, CPF, guardian, etc. - Enabled RLS with policies for select, insert, update, and delete.
- Added indexes on
address_idandsex.
- Created
Conclusion
This refactor unifies profile management across roles, simplifies the model structure, and improves scalability by centralizing persistence through a dedicated repository and Supabase table. The system is now consistent, extensible, and ready for future profile-related features.
2025/05/12 – version: 0.20.02+40
Refactor repository interfaces and introduce profile form system
This commit introduces several structural enhancements to the application. Repository contracts were updated to use Dart’s interface keyword for clarity and explicit implementation. A new profile form system was implemented, enabling user-specific data input based on their role. The codebase now includes a complete UI for editing profile details, with new reusable components for form fields and address selection.
Modified Files
- lib/data/repositories/address/address_repository.dart
- Converted
abstract classtoabstract interface class.
- Converted
- lib/data/repositories/auth/auth_repository.dart
- Changed to
abstract interface classfor consistency.
- Changed to
- lib/data/repositories/auth/dev_auth_repository.dart
- Explicitly implemented
AuthRepositoryusingimplements.
- Explicitly implemented
- lib/data/repositories/person/person_repository.dart
- Updated to
abstract interface class.
- Updated to
- lib/data/repositories/storage/storage_repository.dart
- Converted to
abstract interface class.
- Converted to
- lib/domain/enums/enums_declarations.dart
- Introduced
EnumLabelinterface to support custom labeled enums. Sexenum now implementsEnumLabel.
- Introduced
- lib/domain/enums/enums_sports.dart
- Changed
Positionto anabstract interface class.
- Changed
- lib/domain/models/person.dart
- Simplified
toMap()method using direct assignments. - Cleaned up import statements.
- Simplified
- lib/domain/models/profiles/*.dart
- Refactored all user profile classes (
AthleteProfile,EnthusiastRole,HeadHunterRole,ManagerRole) to extendUserProfileas abase class. - Centralized common fields (id, addressId, sex, createdAt, updatedAt) in
UserProfile.
- Refactored all user profile classes (
- lib/main_app.dart
- Commented out unnecessary
labelStyleconfigurations inInputDecorationTheme.
- Commented out unnecessary
- lib/routing/router.dart
- Updated route for address selection to accept
addressIdviastate.extra. - Added new route for
/profilemapped toProfilePage.
- Updated route for address selection to accept
- lib/routing/routes.dart
- Declared new route constant
Routes.profile.
- Declared new route constant
- lib/ui/features/address/address_page.dart
- Supports pre-selection of address using
widget.addressId.
- Supports pre-selection of address using
- lib/ui/features/address/widgets/dismissible_address.dart
- Replaced inline
ListTilewith new reusableAddressCard.
- Replaced inline
- lib/ui/features/home/home_page.dart
- Added
_navToProfile()method and integrated it with the drawer.
- Added
- lib/ui/core/ui/drawer/main_drawer.dart
- Added new menu item for “Perfil” with callback
profile.
- Added new menu item for “Perfil” with callback
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added support for
maxLinesandminLines.
- Added support for
- lib/utils/commands.dart
- Updated
Commandclass declaration to useinterface.
- Updated
New Files
- lib/domain/use_cases/address_profile_user_case.dart
- Encapsulates business logic for loading and fetching user addresses in profile context.
- lib/ui/core/others/address_name_icon.dart
- Maps common address name prefixes to material icons.
- lib/ui/core/ui/cards/address_card.dart
- Stateless UI component to display address information consistently.
- lib/ui/core/ui/form_fields/address_form_field.dart
- Custom
FormField<String>widget to select and display addresses interactively.
- Custom
- lib/ui/core/ui/form_fields/sex_form_field.dart
- Custom
FormField<Sex>widget with toggle button interface.
- Custom
- lib/ui/core/ui/text_fields/toggle_buttons_text.dart
- Helper widget to style labeled buttons inside a
ToggleButtonswidget.
- Helper widget to style labeled buttons inside a
- lib/ui/features/profile/profile_page.dart
- Full profile editing page supporting sex, address, CPF, and role-specific documents.
- lib/ui/features/profile/profile_view_model.dart
- View model handling address loading and reactive state for profile editing.
Conclusion
These changes improve architectural clarity through the use of Dart’s interface keyword and introduce a scalable, modular profile editing system with reusable UI components.
2025/05/09 – version: 0.20.01+39
Simplified model serialization and introduced role-based profile structure
This commit refactors multiple domain model classes by simplifying their toMap() implementations using direct assignments. It also removes the generic Athlete model and introduces a structured, role-based system for user profiles, encapsulating data for athletes, managers, enthusiasts, and headhunters in dedicated classes.
Modified Files
- lib/domain/models/address.dart
- Simplified
toMap()method using direct key assignments to improve readability.
- Simplified
- lib/domain/models/club.dart
- Replaced verbose
addAllusage intoMap()with clean key-value assignments.
- Replaced verbose
- lib/domain/models/document.dart
- Simplified
toMap()logic.
- Simplified
- lib/domain/models/location.dart
- Improved
toMap()structure with direct map key assignments.
- Improved
- lib/domain/models/operating_day.dart
- Refactored
toMap()to avoid intermediateresultmap.
- Refactored
- lib/domain/models/person.dart
- Refactored
toMap()usingaddAllonly once and removed unnecessary intermediate variable.
- Refactored
- lib/domain/models/schedule.dart
- Rewrote
toMap()to conditionally include fields using conciseifstatements.
- Rewrote
- lib/domain/models/sportman.dart
- Applied a cleaner, more direct mapping approach in
toMap()for better performance and clarity.
- Applied a cleaner, more direct mapping approach in
- lib/domain/models/viacep_address.dart
- Modernized
toMap()method using direct key assignments.
- Modernized
New Files
- lib/domain/models/profiles/athlete_profile.dart
- Defines
AthleteProfileas a concrete implementation ofUserProfile, encapsulating athlete-specific fields.
- Defines
- lib/domain/models/profiles/enthusiast_profile.dart
- Defines
EnthusiastRoleas a user profile for casual participants with minimal fields.
- Defines
- lib/domain/models/profiles/head_hunter_profile.dart
- Implements
HeadHunterRolefor scout-style users withcpfDocand address fields.
- Implements
- lib/domain/models/profiles/manager_profile.dart (renamed from
manager.dart)- Introduces
ManagerRole, renaming and cleaning up the original manager model and aligning it with the new profile structure.
- Introduces
- lib/domain/models/profiles/user_profile.dart
- Declares the
UserProfileabstract class used to standardize role-specific user profiles.
- Declares the
Deleted Files
- lib/domain/models/athlete.dart
- Removed the outdated
Athleteclass in favor of the newAthleteProfileunder the profile-based architecture.
- Removed the outdated
Conclusion
This update provides a significant architectural improvement by introducing explicit role-based profile models and modernizing data serialization. The changes enhance type safety, modularity, and code clarity across the domain layer.
2025/05/09 – version: 0.20.00+38
Refactored UI Widgets to Improve Decoupling and Flexibility
This commit introduces refinements to reduce widget coupling and improve modularity across the address registration and home screen components. Theme control and navigation logic have been abstracted to enhance reusability and readability in the MainAppBar.
Modified Files
- lib/ui/features/address/address_register/address_register_page.dart
- Removed explicit back button from the AppBar, delegating navigation responsibility to the
MainAppBar.
- Removed explicit back button from the AppBar, delegating navigation responsibility to the
- lib/ui/features/home/home_page.dart
- Passed explicit theme toggling parameters (
onToggleThemeandisDarkMode) toMainAppBar. - Enabled the drawer by setting
useDrawer: truefor the home page AppBar.
- Passed explicit theme toggling parameters (
- lib/ui/features/home/widgets/main_app_bar.dart
- Refactored
MainAppBarto:- Accept
onToggleThemeandisDarkModeas parameters instead of aThemeViewModel. - Conditionally show a drawer button or back navigation icon based on
useDrawerandleading. - Simplify and decouple logic for theme toggle icon rendering.
- Accept
- Refactored
Conclusion
These adjustments improve code modularity, make the MainAppBar more reusable, and better isolate UI responsibilities, contributing to a cleaner and more maintainable architecture.
2025/05/09 – version: 0.15.06+37
Updated data models and router logic for streamlined user flow
This commit refactors multiple domain model classes for consistency in date handling, updates the authentication interface to simplify property naming, and simplifies router and navigation logic related to address management. It also enhances UI components for a better user experience.
Modified Files
- doc/diagrama de classes.drawio
- Updated method return types from
Acougueto specific domain models (Manager,Athlete,Enthusiast,Headhunter) to reflect actual model responsibilities. - Adjusted graph model dimensions.
- Updated method return types from
- lib/data/repositories/auth/auth_repository.dart
- Renamed
userAuthgetter touserfor cleaner access to authenticated user.
- Renamed
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated implementation to match new
usergetter.
- Updated implementation to match new
- lib/data/repositories/auth/remote_auth_repository.dart
- Replaced
userAuthwithuser, aligning with new AuthRepository interface.
- Replaced
- lib/domain/models/athlete.dart
- Replaced manual date parsing with
DateTimeMapper. - Refactored field initialization order for better clarity.
- Replaced manual date parsing with
- lib/domain/models/club.dart
- Unified date serialization using
DateTimeMapper.
- Unified date serialization using
- lib/domain/models/manager.dart
- Made
sexoptional. - Replaced manual
toUtc().toIso8601String()withDateTimeMapper. - Removed unused
toJson,fromJson,toString,==, andhashCodemethods.
- Made
- lib/domain/models/person.dart
- Unified date serialization/deserialization via
DateTimeMapper.
- Unified date serialization/deserialization via
- lib/domain/models/sportman.dart
- Made
updatedAtrequired with fallback initialization. - Replaced raw date handling with
DateTimeMapper.
- Made
- lib/domain/use_cases/account_management_user_case.dart
- Updated all usages of
userAuthto newusergetter.
- Updated all usages of
- lib/routing/router.dart
- Simplified route builders to avoid explicit passing of userId via
state.extra. - Used
RemoteAuthRepositorycontext to fetch authenticateduserId.
- Simplified route builders to avoid explicit passing of userId via
- lib/ui/features/address/address_page.dart
- Added a back button to
AppBar. - Simplified navigation by removing extra argument passing.
- Added a back button to
- lib/ui/features/address/address_register/address_register_page.dart
- Added leading back button in the AppBar.
- Improved pre-filling form fields in editing mode.
- Set address ID when editing existing address.
- lib/ui/features/address/widgets/dismissible_address.dart
- Added
getLeadingIcon()to infer icon from address name category.
- Added
- lib/ui/features/home/home_page.dart
- Refactored
_navToAddressesto use async navigation and print selected address ID on return.
- Refactored
- lib/ui/features/home/widgets/main_app_bar.dart
- Added optional
leadingparameter to allow custom back buttons in AppBar.
- Added optional
- lib/utils/extensions/date_time_extensions.dart
- Added
DateTimeMapperhelper class to unify date parsing and formatting throughout the codebase.
- Added
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated tests to reflect renamed
userAuthgetter asuser.
- Updated tests to reflect renamed
Conclusion
All changes aim to improve clarity, maintainability, and consistency across models, navigation logic, and UI components. The application remains stable and functionally complete.
2025/05/08 – version: 0.15.05+36
Add address CRUD flow with Dismissible UI and enhanced CEP validation
This update implements the full address management workflow, including Create, Read, Update, and Delete (CRUD) operations. It also introduces new UI widgets for dismissible actions and message dialogs, enhancing usability and feedback. Additionally, CEP validation via ViaCEP API was improved with more robust error handling and a standardized feedback mechanism.
Modified Files
- lib/data/services/viacep_service.dart
- Fixed ViaCEP error field check (
'erro' == 'true') to align with the actual API response format.
- Fixed ViaCEP error field check (
- lib/domain/models/address.dart
- Added
fullAddresscomputed property to format a complete address string.
- Added
- lib/domain/use_cases/address_user_case.dart
- Extended use case to support
add,update, anddeletemethods for address operations.
- Extended use case to support
- lib/ui/core/ui/messages/app_snack_bar.dart
- Added
isErrorflag to differentiate success and error snackbars with distinct color schemes.
- Added
- lib/ui/core/ui/messages/show_simple_floating_message.dart
- Enhanced to support custom
iconData, returnbool?result, and more flexible layout.
- Enhanced to support custom
- lib/ui/core/ui/texts/parse_rich_text.dart
- Ensured color consistency for bold/italic text segments using
onSurface.
- Ensured color consistency for bold/italic text segments using
- lib/ui/features/address/address_page.dart
- Connected dismissible UI to
edit,delete, andselecthandlers. - Improved help message presentation with contextual icons.
- Connected dismissible UI to
- lib/ui/features/address/address_register/address_register_page.dart
- Integrated validation with CEP lookup.
- Managed form submission logic for both add and update flows.
- Added feedback via
AppSnackBarandshowSimpleMessage.
- lib/ui/features/address/address_register/address_register_view_model.dart
- Refactored to include
addandupdatecommands. - Removed internal method wrappers in favor of direct use case delegation.
- Refactored to include
- lib/ui/features/address/address_view_model.dart
- Added
deletecommand usingAddressUserCase.
- Added
New Files
- lib/ui/core/ui/dismissible/dismissible_container.dart
- Utility widget to generate configurable swipe backgrounds for dismissible elements.
- lib/ui/features/address/widgets/dismissible_address.dart
- Encapsulates the
Dismissiblebehavior for address cards with swipe actions for edit and delete.
- Encapsulates the
Conclusion
This update delivers a polished, interactive address management interface, backed by robust service and validation layers. Users can now reliably create, update, and remove addresses with immediate visual feedback and support for postal code lookups.
2025/05/08 – version: 0.15.04+35
Refactor imports, formatting, and layout improvements across UI and infrastructure
This update standardizes import styles by converting absolute imports to relative ones, enhancing modularity and portability. It also introduces a reusable cardMessage widget and a showSimpleMessage dialog for displaying formatted messages. The address registration flow was polished with focus node transitions and better UI guidance through help dialogs and tooltips.
Modified Files
- README.md
- Replaced section titles from Portuguese “Conclusão” to “Conclusion” for consistency in commit structure.
- lib/config/dependencies.dart
- lib/data/repositories/person/person_repository.dart
- lib/data/repositories/storage/storage_repository.dart
- lib/data/services/remote_database_service.dart
- lib/domain/use_cases/address_user_case.dart
- lib/ui/features/address/address_view_model.dart
- lib/ui/features/app/view_model/theme_view_model.dart
- lib/ui/features/sign_up/sign_up_page.dart
- lib/ui/features/splash/splash_page.dart
- Replaced absolute imports (
package:sports/...) with relative paths for cohesion and maintainability.
- Replaced absolute imports (
- lib/domain/models/viacep_address.dart
- Removed unused
toJson()andfromJson()methods to reduce unnecessary code.
- Removed unused
- lib/main_app.dart
- Customized
InputDecorationThemefor both light and dark themes to ensure consistent label/hint styling.
- Customized
- lib/routing/router.dart
- Standardized imports and ensured proper formatting.
- lib/ui/core/ui/drawer/main_drawer.dart
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Switched to relative imports for better modular consistency.
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added
nextFocusNodeto facilitate keyboard navigation between fields.
- Added
- lib/ui/core/ui/text_fields/sugestions_text_field.dart
- Integrated
nextFocusNodeto auto-focus the next field upon selection.
- Integrated
- lib/ui/features/address/address_page.dart
- Added contextual help using a new help icon and dialog message.
- Replaced static empty-state message with reusable
cardMessage.
- lib/ui/features/address/address_register/address_register_page.dart
- Enhanced field navigation with
FocusNodeusage. - Improved input flow and validation UX for address registration.
- Enhanced field navigation with
- lib/ui/features/home/widgets/main_app_bar.dart
- Added support for injecting custom action widgets (e.g., help button) into the app bar.
- lib/utils/validates/address_validate.dart
- Updated import to relative path.
New Files
- lib/ui/core/ui/messages/card_message.dart
- A widget for reusable card-based message display using a consistent layout and typography.
- lib/ui/core/ui/messages/show_simple_floating_message.dart
- Provides a floating dialog box for help messages, with rich text formatting support.
- lib/ui/core/ui/texts/parse_rich_text.dart
- Utility function to parse and render bold/italic markers and optional leading icons from a text string.
Conclusion
The codebase is now more modular, readable, and user-friendly, with improved navigation, help messaging, and consistent UI behavior across themes.
2025/05/07 – version: 0.15.03+34
Add support for address registration and ZIP code lookup
This commit introduces full address registration functionality in the app, including the ability to register, edit, and view addresses. It also integrates a service for retrieving address data from the ViaCEP API based on ZIP code input. The address repository now interacts with a remote service abstraction, improving testability and modularity.
Modified Files
- lib/config/dependencies.dart
- Registered
RemoteAddressRepositoryandViaCepServicein the dependency graph.
- Registered
- lib/data/repositories/address/remote_address_repository.dart
- Refactored to use
RemoteDatabaseServiceinstead of direct Supabase calls. - Introduced result-handling logic to wrap service responses.
- Removed manual UUID generation in favor of centralized ID handling by the service.
- Refactored to use
- lib/data/repositories/common/server_names.dart
- Added constants for
AddressTableColumns.
- Added constants for
- lib/data/services/remote_database_service.dart
- Added
add()method that auto-generates UUIDs if needed and returns the inserted ID. - Changed
update()to return the ID after a successful operation.
- Added
- lib/domain/models/person.dart
- Changed default role from
athletetonone.
- Changed default role from
- lib/routing/router.dart
- Refactored to use named route objects instead of raw strings.
- Added navigation to address pages with parameters.
- lib/routing/routes.dart
- Replaced raw route strings with named route constants encapsulated in a
Routeclass.
- Replaced raw route strings with named route constants encapsulated in a
- lib/ui/core/ui/drawer/main_drawer.dart
- Added a new navigation entry for the addresses screen.
- lib/ui/core/ui/text_fields/select_text_field.dart
- Refactored field names to be more generic (
enumLabels→labels,enumDescriptions→descriptions).
- Refactored field names to be more generic (
- lib/ui/features/home/home_page.dart
- Integrated navigation to the address management screen via the drawer.
- Adjusted routing for sign-out and person registration.
- lib/ui/features/home/person_register/person_resister_page.dart
- Adjusted field initialization for
UserRoleand updated prop names inSelectTextField.
- Adjusted field initialization for
- lib/ui/features/sign_in/sign_in_page.dart
- lib/ui/features/sign_up/sign_up_page.dart
- lib/ui/features/splash/splash_page.dart
- Replaced raw route strings with
Routes.*.path.
- Replaced raw route strings with
- test/data/repositories/address/remote_address_repository_test.dart
- Updated tests to use
RemoteDatabaseServiceinstead ofSupabaseClient.
- Updated tests to use
New Files
- lib/data/services/viacep_service.dart
- Provides integration with the ViaCEP API to fetch address data from ZIP codes.
- lib/domain/models/viacep_address.dart
- Defines the model for deserialized responses from the ViaCEP service.
- lib/domain/use_cases/address_user_case.dart
- Encapsulates address operations and delegates data fetching and ZIP code lookup.
- lib/ui/features/address/address_page.dart
- Presents the list of addresses and allows navigation to the registration screen.
- lib/ui/features/address/address_register/address_register_page.dart
- Contains the full form for registering or editing addresses, integrated with ViaCEP lookup.
- lib/ui/features/address/address_register/address_register_view_model.dart
- ViewModel that manages address registration logic and API integration.
- lib/ui/features/address/address_view_model.dart
- Updated to delegate to the
AddressUserCaseabstraction.
- Updated to delegate to the
- lib/ui/core/ui/text_fields/sugestions_text_field.dart
- Custom text field with suggestions displayed as chips.
- lib/utils/validates/address_validate.dart
- Contains field validation logic for the address registration form.
Assets and Test Data
- test/data/services/viacep_service_test.dart
- Unit tests for
ViaCepService, validating data retrieval from real API endpoints.
- Unit tests for
Conclusion
Address management and ZIP code lookup have been successfully implemented, enhancing the app’s user onboarding and data consistency features.
2025/05/07 – version: 0.15.02+33
Renamed LocalDatabaseService to CacheDatabaseService and introduced Address UI layer
This update improves naming consistency by renaming LocalDatabaseService to CacheDatabaseService, reflecting its purpose more clearly. Additionally, it introduces a new UI module for managing user addresses, including the page and view model. Integration and unit tests were updated to reflect these changes, and a legacy test file was removed in favor of a new structured version.
Modified Files
- lib/config/dependencies.dart
- Replaced all references from
LocalDatabaseServicetoCacheDatabaseServicein dependency injection.
- Replaced all references from
- lib/data/repositories/address/remote_address_repository.dart
- Updated constructor and field types to use
CacheDatabaseService.
- Updated constructor and field types to use
- lib/data/repositories/person/remote_person_repository.dart
- Replaced usage of
LocalDatabaseServicewithCacheDatabaseService.
- Replaced usage of
- lib/data/services/local_database_service.dart → lib/data/services/cache_database_service.dart
- Renamed the file and class to
CacheDatabaseServiceto clarify its role.
- Renamed the file and class to
- lib/ui/features/app/view_model/theme_view_model.dart
- Updated class dependency from
LocalDatabaseServicetoCacheDatabaseService.
- Updated class dependency from
- supabase/migrations/20250417191633_create_address_table.sql
- Minor formatting adjustment for SQL RLS policies.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Replaced interface reference for
FakeCacheto implementCacheDatabaseService.
- Replaced interface reference for
- test/data/services/remote_storage_service_test.dart
- Changed test bucket to use a dynamically generated UUID-based name to avoid conflicts.
- test/data/services/shared_preferences_service_test.dart
- Updated service under test to
CacheDatabaseService.
- Updated service under test to
New Files
- lib/ui/features/address/address_page.dart
- UI page for displaying address data with a floating action button.
- lib/ui/features/address/address_view_model.dart
- View model with a command-based approach to loading address data.
- test/data/repositories/address/remote_address_repository_test.dart
- New integration test for the address repository using updated service names and patterns.
Deleted Files
- test/data/repositories/address/remote_address_repository_integration_test.dart
- Removed legacy test in favor of a structured and updated test implementation.
Conclusion
All changes are complete and functional. The codebase now uses clearer service names and includes a solid base for address-related UI functionality.
2025/05/06 – version: 0.15.00+31
Enhance Supabase security policies and finalize backend storage setup
This commit addresses a previously undocumented technical issue related to Supabase security rules. The problem arose from insufficient or improperly configured Row-Level Security (RLS) and required alignment between client access policies and server-side storage constraints. After extensive investigation, including discussions with both ChatGPT and Supabase’s own AI assistant, the final resolution was found by thoroughly consulting Supabase’s official documentation. These backend adjustments ensure proper integration with table creation and bucket operations.
Modified Files
- .gitignore
- Added
.envto ignore list to avoid committing environment-specific secrets.
- Added
- supabase/migrations/20250501101621_create_avatars_bucket.sql
- No functional change; only added a trailing newline for consistency.
- supabase/migrations/20250505132643_alter_avatars_bucket.sql
- Wrapped RLS activation in a
DO $$ ... $$block with exception handling to prevent permission errors when not the owner. - Ensures compatibility with shared environments or when using the Supabase Dashboard-generated SQL.
- Wrapped RLS activation in a
Deleted Files
- .env
- Removed from version control due to security risks and inclusion in
.gitignore.
- Removed from version control due to security risks and inclusion in
Conclusion
Backend storage policies are now properly aligned with Supabase security best practices, and RLS is correctly configured for bucket operations, ensuring a more secure and stable environment.
2025/05/06 – version: 0.13.03+30
Refactor authentication and person management workflows
This commit introduces a significant refactor of the authentication flow and the person registration form. The login and signup logic has been consolidated within the AccountManagementUseCase, improving separation of concerns. Additionally, form fields across the app now support change detection, enabling dynamic UI behavior like save button activation only on edits.
Modified Files
- lib/data/repositories/person/remote_person_repository.dart
- Ensured
_startedflag is reset on logout.
- Ensured
- lib/domain/models/person.dart
- Updated the
==operator to ignorecreatedAtandupdatedAtfields.
- Updated the
- lib/domain/use_cases/account_management_user_case.dart
- Added
login()andsignUp()methods to centralize authentication logic. - Removed commented legacy
_uploadAvatarcode. - Improved logging of login/signup events.
- Added
- lib/routing/router.dart
- Switched dependency injection from
RemoteAuthRepositorytoAccountManagementUseCase.
- Switched dependency injection from
- lib/ui/core/ui/buttons/big_button.dart
- Made
onPressedoptional. - Adjusted icon color depending on whether the button is enabled.
- Made
- lib/ui/core/ui/drawer/main_drawer.dart
- Added support for
Personobject andmyAccountcallback. - Updated parameters to handle nullability and improve routing logic.
- Added support for
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Displayed
Person.photoasCircleAvatarif available. - Prioritized
Person.nicknameas fallback whenuserNameis null.
- Displayed
- lib/ui/core/ui/images/avatar_form_field.dart
- Added
onChangedcallback for real-time updates to image selection.
- Added
- lib/ui/core/ui/text_fields/date_text_field.dart
- Added
onChangedcallback to notify on date selection. - Used a centralized date formatting via extension method.
- Added
- lib/ui/core/ui/text_fields/select_text_field.dart
- Introduced
onChangedsupport for tracking selection changes.
- Introduced
- lib/ui/features/home/home_page.dart
- Passed
Person,onTap, andmyAccounttoMainDrawer.
- Passed
- lib/ui/features/home/person_register/person_resister_page.dart
- Converted form into a reactive editing experience.
- Detects changes and only enables the save button on modification.
- Centralized person creation logic via
_createPerson. - Added initialization logic for edit mode.
- Supports both add and update flows based on context.
- lib/ui/features/sign_in/sign_in_view_model.dart
- Switched from direct repository use to
AccountManagementUseCase.
- Switched from direct repository use to
- lib/ui/features/sign_up/sign_up_view_model.dart
- Replaced direct call to
AuthRepositorywithAccountManagementUseCase.
- Replaced direct call to
New Files
- lib/utils/extensions/date_time_extensions.dart
- Provides a
toDDMMYYYY()extension for consistent date formatting.
- Provides a
Conclusion
All changes have been successfully applied, enhancing modularity and improving the user experience with dynamic UI feedback and centralized authentication logic.
2025/05/06 – version: 0.13.02+29
Add splash screen customization for Android and iOS platforms
This update introduces native splash screen support using the flutter_native_splash package. It includes configuration for Android 12+, legacy Android, and iOS, applying dark/light themes and custom images. Additionally, it improves the avatar selection mechanism in the person registration form and corrects form behavior by ensuring onSaved is triggered properly.
Modified Files
- Makefile
- Added a
make update_splashtarget to generate splash screens usingflutter_native_splash.
- Added a
- android/app/src/main/res/drawable/launch_background.xml*
- Replaced default white background with a custom background image reference.
- android/app/src/main/res/values/styles.xml
- Updated
AppThemeto include splash-specific attributes like fullscreen and cutout behavior.
- Updated
- android/app/src/main/res/values-night/styles.xml
- Applied dark mode specific launch theme attributes.
- android/app/src/main/res/values-v31/styles.xml
- Added Android 12 light mode splash screen theme with custom splash icon and color.
- android/app/src/main/res/values-night-v31/styles.xml
- Added Android 12 dark mode splash screen theme.
- flutter_native_splash.yaml
- Created configuration for splash generation across platforms, including Android 12+ settings.
- lib/domain/use_cases/account_management_user_case.dart
- Refactored avatar upload logic into a private
_processPhotomethod used byaddPersonandupdatePerson.
- Refactored avatar upload logic into a private
- lib/ui/core/ui/images/avatar_form_field.dart
- Fixed
onSavednot being triggered by wiringFormField.didChangecorrectly.
- Fixed
- lib/ui/core/ui/images/select_avatar_image.dart
- Updated property names to match
FormFieldusage; renamedphotoPath→valueandsetImagePath→didChange.
- Updated property names to match
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added support for the
readOnlyparameter.
- Added support for the
- lib/ui/core/ui/text_fields/select_text_field.dart
- Added
focusNodesupport and enforcedreadOnlymode to ensure proper dropdown-like behavior.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Replaced deprecated
savecommand withadd, and fixed avatar fieldonSavedlogic. - Improved focus behavior between fields after date selection.
- Handled role parsing with fallback in case of invalid label.
- Replaced deprecated
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Renamed command from
savetoaddfor clarity and consistency.
- Renamed command from
- lib/ui/features/sign_in/sign_in_view_model.dart
- Cleaned up import statement formatting.
- lib/utils/commands.dart
- Renamed
completedgetter tosuccessfor clearer semantics.
- Renamed
- lib/utils/validates/generics_validate.dart
- Fixed phone number validation logic to correctly handle 10 and 11-digit formats.
- pubspec.yaml
- Added dependency on
flutter_native_splash.
- Added dependency on
New Files
- flutter_native_splash.yaml
- Configuration file to define splash behavior and assets for all platforms.
- assets/images/splash_image.png
- Splash image asset used in Android 12+ splash screen.
- android/app/src/main/res/drawable/android12splash.png*
- Auto-generated assets for Android 12 splash icon in various resolutions.
- android/app/src/main/res/drawable/background.png
- Custom background image used for legacy Android splash screen.
- ios/Runner/Assets.xcassets/LaunchBackground.imageset/
- iOS launch screen background image and its metadata.
Assets and Test Data
- assets/images/splash_image.png
- Used for splash image configuration via
flutter_native_splash.
- Used for splash image configuration via
Conclusion
All changes related to splash screen setup and avatar field integration are now in place and functional across Android and iOS platforms.
2025/05/05 – version: 0.13.01+28
Refactor authentication use case and introduce account management features
This commit introduces a new AccountManagementUseCase that consolidates responsibilities previously handled by AuthenticationUserCase, and expands functionality to include avatar upload and update workflows. The update also includes related ViewModel, UI, and dependency injection adjustments to reflect this architectural change and enhance maintainability.
Modified Files
- lib/config/dependencies.dart
- Replaced
AuthenticationUserCasewithAccountManagementUseCasein provider bindings. - Registered new dependencies for
RemoteStorageRepositoryandRemoteStorageService. - Renamed
ThemeNotifiertoThemeViewModel.
- Replaced
- lib/data/repositories/auth/remote_auth_repository.dart
- Adjusted import path for
AuthServiceusing absolute path.
- Adjusted import path for
- lib/data/repositories/person/person_repository.dart
- Added abstract method
logout()to clear local user data.
- Added abstract method
- lib/data/repositories/person/remote_person_repository.dart
- Implemented the new
logout()method to remove local person data and clear cached instance.
- Implemented the new
- lib/main_app.dart
- Replaced
ThemeNotifierwithThemeViewModelin dependency access.
- Replaced
- lib/routing/router.dart
- Updated all usages of
AuthenticationUserCasetoAccountManagementUseCase. - Replaced
ThemeNotifierwithThemeViewModel.
- Updated all usages of
- lib/ui/core/ui/drawer/main_drawer.dart
- Conditionally renders account and logout options based on login status.
- Renamed
ThemeNotifierreference toThemeViewModel.
- lib/ui/features/app/view_model/theme_notifier.dart → lib/ui/features/app/view_model/theme_view_model.dart
- Renamed class
ThemeNotifiertoThemeViewModeland updated constructor name.
- Renamed class
- lib/ui/features/home/home_page.dart
- Updated references to
ThemeNotifierto useThemeViewModel. - Passed
isLoggedIntoMainDrawer.
- Updated references to
- lib/ui/features/home/home_view_model.dart
- Switched dependency from
AuthenticationUserCasetoAccountManagementUseCase. - Exposed
isLoggedInflag from the use case.
- Switched dependency from
- lib/ui/features/home/person_register/person_resister_page.dart
- Replaced usage of
SelectAvatarImagewith the newAvatarFormField. - Adjusted image validation and form integration.
- Replaced usage of
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Updated dependency type to
AccountManagementUseCase. - Adjusted getter names for user and person.
- Updated dependency type to
- lib/ui/features/home/widgets/main_app_bar.dart
- Updated to use
ThemeViewModelinstead ofThemeNotifier.
- Updated to use
New Files
- lib/domain/use_cases/account_management_user_case.dart
- Created new use case to handle authentication, person data, and avatar storage operations in a unified way.
- lib/ui/core/ui/images/avatar_form_field.dart
- New reusable form-integrated widget for avatar image selection and validation.
Deleted Files
- lib/domain/use_cases/authentication_user_case.dart
- Removed obsolete use case in favor of the new consolidated
AccountManagementUseCase.
- Removed obsolete use case in favor of the new consolidated
Conclusion
All changes have been successfully applied, improving architectural clarity and user account handling capabilities.
2025/05/05 – version: 0.13.00+27
Refactor storage service to use URL-based API and improve test coverage
This commit introduces a comprehensive refactor of the storage system, transitioning the repository and service layers to operate with public URLs rather than raw file paths. It also improves modularity, enhances logging, and expands test coverage with integration and unit tests, including full CRUD validation of the avatar logic.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Updated import from
tables.dartto renamed fileserver_names.dart.
- Updated import from
- lib/data/repositories/common/tables.dart → server_names.dart
- Renamed file for clarity.
- Split constants into separate
TablesandBucketsclasses.
- lib/data/repositories/person/remote_person_repository.dart
- Adjusted import to match renamed file (
server_names.dart).
- Adjusted import to match renamed file (
- lib/data/repositories/storage/remote_storage_repository.dart
- Replaced internal Supabase client usage with
RemoteStorageService. - Changed all methods to use URL-based logic instead of raw file paths.
- Added file extension validation and conditional deletion in
update. - Improved logging and error handling consistency.
- Replaced internal Supabase client usage with
- lib/data/repositories/storage/storage_repository.dart
- Changed all method signatures to accept named parameters.
- Updated documentation to reflect URL-based design.
- Modified
fetchto return URL instead of raw binary data.
- lib/data/services/remote_database_service.dart
- Added detailed DartDoc documentation to all methods.
- Improved code comments and method descriptions for clarity.
- lib/data/services/remote_storage_service.dart
- Refactored all methods to use named parameters.
- Introduced
createBucketanddeleteBucketutilities. - Enhanced internal methods with robust validation and logging.
- Fully documented all public methods using DartDoc.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Replaced hardcoded keys with values from
.env. - Modified test lifecycle from
setUpAlltosetUpto isolate test cases. - Replaced legacy import with updated
server_names.dart.
- Replaced hardcoded keys with values from
- test/data/repositories/storage/remote_storage_repository_test.dart
- Rewrote test to cover the full storage lifecycle: add → fetch → update → delete.
- Introduced temporary file generation using base64 dummy images.
- Used mocked SharedPreferences and Supabase initialization via
.env.
New Files
- supabase/migrations/20250505132643_alter_avatars_bucket.sql
- Defines Supabase RLS policies for the
avatarsbucket: insert, update, delete, and optional select metadata for authenticated users.
- Defines Supabase RLS policies for the
- test/data/services/remote_storage_service_test.dart
- Unit test for the
RemoteStorageService, covering add, fetch, update, and delete. - Includes environment setup and Supabase bucket isolation.
- Unit test for the
Conclusion
This update completes the refactor of the storage API to a clean, URL-driven design and significantly enhances reliability and test coverage across the storage module.
2025/05/04 – version: 0.12.05+26
Refactor services and repositories for clarity and separation of concerns
This commit introduces a significant structural refactor aimed at improving the clarity, naming, and separation of responsibilities between local and remote services. It renames LocalStorageService and RemoteStorageService to more domain-specific names and splits data responsibilities into separate repositories, especially for file storage operations. It also adds support for managing avatar storage using Supabase buckets.
Modified Files
- lib/config/dependencies.dart
- Renamed
LocalStorageServicetoLocalDatabaseService. - Renamed
RemoteStorageServicetoRemoteDatabaseService. - Updated dependency injection accordingly.
- Renamed
- lib/data/repositories/address/remote_address_repository.dart
- Renamed internal dependency from
LocalStorageServicetoLocalDatabaseService.
- Renamed internal dependency from
- lib/data/repositories/auth/dev_auth_repository.dart
- Renamed field from
userIdtouidin test mock return.
- Renamed field from
- lib/data/repositories/common/tables.dart
- Added
avatarsas a new storage table constant.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated constructor and field names to use new
LocalDatabaseServiceandRemoteDatabaseService.
- Updated constructor and field names to use new
- lib/data/services/auth_service.dart
- Replaced references to
userIdwithuidto standardize user identification fields.
- Replaced references to
- lib/domain/models/person.dart
- Made
nicknamefield optional inPersonmodel.
- Made
- lib/domain/models/user_auth.dart
- Renamed
userIdtouidinUserAuth,LoggedUser, andNotLoggedUser.
- Renamed
- lib/domain/use_cases/authentication_user_case.dart
- Updated usage of
userAuth.userIdtouserAuth.uid.
- Updated usage of
- lib/ui/features/app/view_model/theme_notifier.dart
- Updated injected dependency to
LocalDatabaseService.
- Updated injected dependency to
- lib/ui/features/home/person_register/person_resister_page.dart
- Integrated success and error feedback using
AppSnackBar. - Updated field names for
uid. - Added
_onSavedmethod with feedback and navigation.
- Integrated success and error feedback using
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Adjusted import paths to use relative imports.
- supabase/migrations/20250417191646_create_person_table.sql
- Enforced
birthdatecolumn asNOT NULL.
- Enforced
- test/data/repositories/address/remote_address_repository_integration_test.dart
- Refactored mock service to implement
LocalDatabaseService.
- Refactored mock service to implement
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Switched service from
RemoteStorageServicetoRemoteDatabaseService. - Updated mocks and setup accordingly.
- Switched service from
- test/data/services/shared_preferences_service_test.dart
- Renamed tested service to
LocalDatabaseService.
- Renamed tested service to
New Files
- lib/data/repositories/storage/remote_storage_repository.dart
- Implements
StorageRepositoryinterface to handle avatar uploads, downloads, updates, and deletions.
- Implements
- lib/data/repositories/storage/storage_repository.dart
- Defines the contract for remote file storage operations using
Resulttypes.
- Defines the contract for remote file storage operations using
- lib/data/services/remote_database_service.dart
- New service to manage Supabase table operations (CRUD) via REST API abstraction.
- supabase/migrations/20250501101621_create_avatars_bucket.sql
- Adds SQL migration to create the public
avatarsbucket on Supabase.
- Adds SQL migration to create the public
- test/data/repositories/storage/remote_storage_repository_test.dart
- Adds a unit test scaffold for the
RemoteStorageRepository, including a helper for creating test avatar files.
- Adds a unit test scaffold for the
Conclusion
The codebase has been successfully refactored to enhance modularity, naming clarity, and separation between local/remote responsibilities. The system is now more aligned with domain-driven conventions and is functionally complete and stable.
2025/04/30 – version: 0.12.04+25
Add avatar image selection, validation, and person form enhancements
This update introduces avatar image selection functionality, field validations, and improved user role selection to enhance the person registration form. Platform-specific permissions and UI improvements were also implemented to support mobile functionality and consistent styling across Android and iOS.
Modified Files
- android/app/src/main/AndroidManifest.xml
- Registered
UCropActivityfor image cropping with a custom theme.
- Registered
- android/app/src/main/res/values/styles.xml
- Added a new style
Ucrop.CropThemeusingAppCompat.Light.NoActionBar.
- Added a new style
- ios/Runner/Info.plist
- Declared permissions for camera and photo library access to comply with iOS requirements.
- lib/domain/enums/enums_declarations.dart
- Renamed the label for the
enthusiastrole. - Added
labelsanddescriptionsgetters for UI rendering and validation.
- Renamed the label for the
- lib/routing/router.dart
- Fixed parameter naming from
viewModeltopersonRegisterViewModel.
- Fixed parameter naming from
- lib/ui/core/ui/images/avatar_image.dart
- Switched to
InkWellfor better ripple effect and visual consistency. - Added comments clarifying image source (network or local file).
- Switched to
- lib/ui/core/ui/text_fields/date_text_field.dart
- Added
labelText,hintText,validator, andonDatePickedto increase customization. - Called
onDatePickedwhen the date is selected.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Integrated new widgets and validation logic.
- Replaced static avatar display with interactive avatar selector.
- Added
SelectTextFieldfor user role input. - Validated all fields and created a
Personinstance on form submission.
- lib/ui/features/sign_in/sign_in_page.dart
- Optimized imports using relative paths for consistency.
New Files
- android/app/src/main/res/values-v35/styles.xml
- Declares
Ucrop.CropThemewithwindowOptOutEdgeToEdgeEnforcementto enhance compatibility.
- Declares
- lib/ui/core/ui/images/select_avatar_image.dart
- Implements interactive avatar selection using
image_pickerandimage_cropper. - Provides options for selecting an image from the gallery or camera.
- Implements interactive avatar selection using
- lib/ui/core/ui/text_fields/select_text_field.dart
- Custom widget for selecting values from enums with label-description pairing.
- Includes toggle buttons and contextual descriptions.
- lib/utils/validates/generics_validate.dart
- Centralizes validation logic for common input fields such as name, nickname, phone, birthdate, role, and image path.
Conclusion
The avatar selection flow and person registration form were successfully enhanced, with proper validations and UI support for mobile platforms now in place.
2025/04/30 – version: 0.12.03+24
Refactored Home Flow and Introduced Authentication Use Case
This commit introduces an AuthenticationUserCase class to centralize user authentication and person management. It also updates the dependency injection configuration, integrates a new person registration page, and enhances the drawer with user details. Various refactorings improve code clarity, encapsulation, and support for new UI behaviors on first access.
Modified Files
- lib/config/dependencies.dart
- Registered new providers for
RemoteStorageService,PersonRepository, andAuthenticationUserCase.
- Registered new providers for
- lib/data/repositories/auth/auth_repository.dart
- Renamed getter
usertouserAuthto better reflect its purpose.
- Renamed getter
- lib/data/repositories/auth/dev_auth_repository.dart
- Aligned with
userAuthnaming convention.
- Aligned with
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated getter from
usertouserAuth. - Assigned fetched user in
fetchUser()for consistency.
- Updated getter from
- lib/data/repositories/person/remote_person_repository.dart
- Simplified the
initializemethod to delegate tofetch.
- Simplified the
- lib/routing/router.dart
- Injected
AuthenticationUserCaseintoHomeViewModel. - Added route for
PersonResisterPage.
- Injected
- lib/routing/routes.dart
- Declared route path for
/person_register.
- Declared route path for
- lib/ui/core/ui/drawer/main_drawer.dart
- Added support for displaying user name and email in the drawer.
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Updated to dynamically show the authenticated user’s name and email.
- lib/ui/core/ui/images/avatar_image.dart
- Made the
imagePathparameter optional to support fallback usage.
- Made the
- lib/ui/features/home/home_page.dart
- Replaced
signOutwithlogoutcommand. - Implemented logic to prompt person registration via a bottom sheet when missing.
- Replaced
- lib/ui/features/home/home_view_model.dart
- Rewritten to use
AuthenticationUserCase. - Removed direct reference to
AuthRepository.
- Rewritten to use
- lib/ui/features/home/widgets/custom_app_bar.dart → main_app_bar.dart
- Renamed and refactored to make
themeModeoptional and safer to use.
- Renamed and refactored to make
- test/data/repositories/auth/remote_auth_repository_test.dart
- Adapted test suite to reflect changes in property naming (
userAuth).
- Adapted test suite to reflect changes in property naming (
New Files
- lib/domain/use_cases/authentication_user_case.dart
- Encapsulates logic for login, logout, load, add and update of
Personobjects.
- Encapsulates logic for login, logout, load, add and update of
- lib/ui/core/ui/editing_controllers/masked_editing_controller.dart
- A
TextEditingControllersubclass that formats input using a digit mask.
- A
- lib/ui/core/ui/messages/botton_sheet_message.dart
- Custom reusable bottom sheet message dialog with optional actions.
- lib/ui/core/ui/text_fields/date_text_field.dart
- A
TextFieldwidget for date picking using native platform dialogs.
- A
- lib/ui/features/home/person_register/person_resister_page.dart
- UI for person registration, including name, nickname, phone, and birthdate inputs.
- lib/ui/features/home/person_register/person_resister_view_model.dart
- ViewModel for the person registration form, managing save and update logic.
Assets and Test Data
- pubspec.yaml & pubspec.lock
- Added new dependencies:
image_picker,image_cropperfor image selection and cropping.- Updated versions of several existing packages (
go_router,provider, etc).
- Added platform-specific plugins (
file_selector_*,image_picker_*, etc).
- Added new dependencies:
Conclusion
All changes were successfully applied, enabling a structured authentication workflow, person registration flow, and improved UI behavior. The app is functional and aligned with the new domain-driven structure.
2025/04/28 – version: 0.12.02+23
Refactored enums, created sports structure, and updated models accordingly
This commit introduces a major refactor on enum management, separating sports-related enums into a dedicated file. A new model Sportsman was added, and existing models and diagrams were updated to align with the new structure. Additional tests were included to validate these changes.
Modified Files
- doc/diagrama de classes.drawio
- Updated class diagram positions and dimensions.
- Renamed “Memberships” to “Sportsman” entity and updated its attributes to match the new
Sportsmanmodel. - Adjusted entity associations accordingly.
- lib/domain/enums/enums_declarations.dart
- Removed sports and affiliation-related enums.
- Simplified general enums by removing
LabeledEnuminterface. - Kept only non-sports enums like
DocType,UserRole,Sex, andWeekday.
- lib/domain/models/athlete.dart
- Added a clarifying comment indicating that
idcorresponds touserId.
- Added a clarifying comment indicating that
- lib/domain/models/club.dart
- Migrated the
sportfield fromSportTypeto the newSportsenum. - Adjusted imports to reference the new
enums_sports.dart.
- Migrated the
- lib/domain/models/document.dart
- Removed old local definition of
DocType(now centralized inenums_declarations.dart).
- Removed old local definition of
- lib/domain/models/manager.dart
- Added a clarifying comment indicating that
idcorresponds touserId.
- Added a clarifying comment indicating that
- lib/domain/models/person.dart
- Added a clarifying comment indicating that
idcorresponds touserId.
- Added a clarifying comment indicating that
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Updated the default user role in test data from
admintomanager.
- Updated the default user role in test data from
- test/domain/models/club_test.dart
- Adjusted test imports and values to use the new
Sportsenum instead ofSportType.
- Adjusted test imports and values to use the new
New Files
- lib/domain/enums/enums_sports.dart
- Created a new file dedicated to sports-related enums.
- Added a
Positionabstraction with abyLabelfactory constructor. - Introduced the
Sports,AffiliationStatus,SoccerPosition,BasketballPosition,VolleyballPosition, andHandballPositionenums.
- lib/domain/models/sportman.dart
- Added the new
Sportsmanmodel to represent an athlete’s affiliation to a club, validating sport-position consistency.
- Added the new
- test/domain/enums/enums_sports_test.dart
- Added unit tests for
Position.byLabelto ensure correct mapping between labels and sports.
- Added unit tests for
- test/utils/validates/docs_validate_test.dart
- Added comprehensive tests for CPF, CNPJ, CNH, and RG validation methods.
Conclusion
All changes were successfully implemented to improve enum management, create a clearer domain structure for sports entities, and strengthen test coverage. The system remains fully functional and consistent with the updated design.
2025/04/24 – version: 0.12.01+22
Refactored Auth Architecture and Repository Enhancements
This commit introduces a refactor in the authentication architecture, removes unnecessary inheritance from ChangeNotifier, and improves repository consistency and event propagation. The changes promote clearer separation of concerns and simplify reactivity by using streams instead of Flutter’s widget bindings.
Modified Files
- doc/diagrama de classes.drawio
- Updated diagram dimensions and layout metadata, likely due to UI adjustments in draw.io.
- lib/data/repositories/auth/auth_repository.dart
- Removed
ChangeNotifierinheritance fromAuthRepositoryto decouple UI reactivity. - Removed
authServicegetter to enforce access through composition rather than inheritance.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Removed
overrideandauthServiceproperty, aligning with updatedAuthRepositoryabstraction.
- Removed
- lib/data/repositories/auth/remote_auth_repository.dart
- Now extends
ChangeNotifierand implementsAuthRepositorydirectly to handle event changes and notify listeners. - Added internal
AuthEventstate and listener onAuthServiceevents. - Implemented
disposemethod to cancel subscriptions and avoid memory leaks.
- Now extends
- lib/data/repositories/person/remote_person_repository.dart
- Fixed typo in constructor parameter from
reoteServicetoremoteService. - Updated
_personcache after remote update to maintain consistency.
- Fixed typo in constructor parameter from
- lib/data/services/auth_service.dart
- Removed
ChangeNotifierinheritance, shifting to a stream-based reactivity model. - Introduced a
StreamControllerto emitAuthEvents to interested subscribers. - Updated
_onAuthStateChangeto dispatch events viaStreamControllerinstead of usingnotifyListeners(). - Improved resource cleanup in the new asynchronous
dispose()method.
- Removed
- lib/ui/features/home/home_view_model.dart
- Removed the
authServicegetter, relying solely on theeventproperty from the repository interface.
- Removed the
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Added
RemoteServiceinstantiation and usage in the test setup. - Updated
RemotePersonRepositoryconstructor to match new parameter name and structure.
- Added
Conclusion
The authentication layer is now cleaner, more modular, and aligned with modern reactive patterns. All changes are complete and the application remains stable and functional.
2025/04/24 – version: 0.12.00+21
Refactored Auth Architecture and Repository Enhancements
This commit introduces a refactor in the authentication architecture, removes unnecessary inheritance from ChangeNotifier, and improves repository consistency and event propagation. The changes promote clearer separation of concerns and simplify reactivity by using streams instead of Flutter’s widget bindings.
Modified Files
- doc/diagrama de classes.drawio
- Updated diagram dimensions and layout metadata, likely due to UI adjustments in draw.io.
- lib/data/repositories/auth/auth_repository.dart
- Removed
ChangeNotifierinheritance fromAuthRepositoryto decouple UI reactivity. - Removed
authServicegetter to enforce access through composition rather than inheritance.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Removed
overrideandauthServiceproperty, aligning with updatedAuthRepositoryabstraction.
- Removed
- lib/data/repositories/auth/remote_auth_repository.dart
- Now extends
ChangeNotifierand implementsAuthRepositorydirectly to handle event changes and notify listeners. - Added internal
AuthEventstate and listener onAuthServiceevents. - Implemented
disposemethod to cancel subscriptions and avoid memory leaks.
- Now extends
- lib/data/repositories/person/remote_person_repository.dart
- Fixed typo in constructor parameter from
reoteServicetoremoteService. - Updated
_personcache after remote update to maintain consistency.
- Fixed typo in constructor parameter from
- lib/data/services/auth_service.dart
- Removed
ChangeNotifierinheritance, shifting to a stream-based reactivity model. - Introduced a
StreamControllerto emitAuthEvents to interested subscribers. - Updated
_onAuthStateChangeto dispatch events viaStreamControllerinstead of usingnotifyListeners(). - Improved resource cleanup in the new asynchronous
dispose()method.
- Removed
- lib/ui/features/home/home_view_model.dart
- Removed the
authServicegetter, relying solely on theeventproperty from the repository interface.
- Removed the
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Added
RemoteServiceinstantiation and usage in the test setup. - Updated
RemotePersonRepositoryconstructor to match new parameter name and structure.
- Added
Conclusion
The authentication layer is now cleaner, more modular, and aligned with modern reactive patterns. All changes are complete and the application remains stable and functional.
2025/04/23 – version: 0.11.05+20
Refactor RemotePersonRepository to use centralized RemoteService
This commit refactors the RemotePersonRepository to delegate all remote operations to a newly created RemoteService class. This abstraction improves code reuse, testability, and maintainability by encapsulating Supabase-specific logic outside the repository. The update also renames internal variables for clarity and consistency.
Modified Files
- lib/data/repositories/person/remote_person_repository.dart
- Replaced direct usage of
SupabaseClientwith the newRemoteServiceabstraction. - Refactored
_fetchFromSupabaseinto_fetchFromRemoteusingRemoteService.fetch. - Updated
add,update, anddeletemethods to delegate operations toRemoteService. - Renamed internal fields to
_remoteServiceand_localServicefor consistency.
- Replaced direct usage of
New Files
- lib/data/services/remote_service.dart
- Introduced
RemoteService, a general-purpose service for interacting with Supabase. - Provides methods:
fetch,fetchList,add,update, anddelete. - Includes centralized error handling and logging using
Logger. - Enhances testability by separating concerns between data access and business logic.
- Introduced
Conclusion
The integration of RemoteService streamlines remote operations and prepares the codebase for easier scalability and testing. All functionalities are preserved and operational.
2025/04/23 – version: 0.11.04+19
Add custom main drawer with header and avatar support
This commit introduces a new custom navigation drawer (MainDrawer) with support for user display and logout functionality. It enhances the user interface by adding a stylized drawer header and an avatar image widget capable of displaying local or network images. Additionally, new dependencies were added to support these functionalities.
Modified Files
- lib/ui/core/ui/drawer/main_drawer.dart
- Implemented the main drawer UI with rounded borders and dynamic background color based on theme.
- Injected
ThemeNotifierand logout callback. - Included a
MainDrawerHeaderand a logoutListTile.
- lib/ui/features/home/home_page.dart
- Added
MainDrawerto theScaffoldusingdrawer:property.
- Added
- pubspec.yaml
- Added
cached_network_imageas a dependency.
- Added
- pubspec.lock
- Added dependency entries for
cached_network_imageand its transitive dependencies. - Includes additional packages like
flutter_cache_manager,octo_image, andsqflite, likely required bycached_network_image.
- Added dependency entries for
New Files
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Custom drawer header widget displaying a placeholder user name and email.
- Uses theme styling and adapts color based on brightness mode.
- lib/ui/core/ui/images/avatar_image.dart
AvatarImagewidget displaying either a local or network image inside a circular frame.- Handles error states and provides placeholder content if no image is available.
Assets and Test Data
- assets/images/drawer_01.png
- Added a new image asset, likely used within the drawer or avatar components.
Conclusion
The drawer functionality has been successfully implemented and is now integrated with the home page. The system is stable and visually improved.
2025/04/23 – version: 0.11.03+18
Update Supabase CLI Version and Introduce Theme Persistence
This commit performs a comprehensive update to enhance state management and user experience. The Supabase CLI has been updated to always use the latest version. A new ThemeNotifier class was introduced to persist and toggle the app’s theme using a local storage service, replacing the previous shared preferences wrapper. This change impacts both the main application configuration and UI components to reflect real-time theme adjustments.
Modified Files
- Makefile
- Replaced hardcoded Supabase CLI version with
@latestfor dynamic version usage.
- Replaced hardcoded Supabase CLI version with
- analysis_options.yaml
- Enabled
prefer_const_constructorsandprefer_const_literals_to_create_immutablesfor better performance and consistency.
- Enabled
- lib/config/dependencies.dart
- Replaced synchronous
dependencieslist with asynchronouscreateDependencies()function. - Registered
ThemeNotifierandLocalStorageServicein the provider tree.
- Replaced synchronous
- lib/data/repositories/*
- Updated references from
SharedPreferencesServicetoLocalStorageService. - Renamed parameters and fields accordingly across multiple repository classes.
- Introduced
constusage for Result wrappers and UUID constructor.
- Updated references from
- lib/data/services/auth_service.dart
- Standardized usage of
const Result.success(null).
- Standardized usage of
- lib/data/services/shared_preferences_service.dart → lib/data/services/local_storage_service.dart
- Renamed class and file to better reflect general-purpose local storage functionality.
- Updated result returns to
const.
- lib/main.dart
- Added logger initialization.
- Awaited dependency injection setup with
createDependencies().
- lib/main_app.dart
- Integrated
ThemeNotifierwithListenableBuilderto dynamically switch between light and dark themes.
- Integrated
- lib/routing/router.dart
- Passed
ThemeNotifiertoHomePage.
- Passed
- lib/ui/core/theme/fonts.dart
- Made all
TextStyledeclarationsconst.
- Made all
- lib/ui/core/ui/buttons/
- Applied
constconstructors where applicable.
- Applied
- lib/ui/core/ui/messages/app_snack_bar.dart
- Made the
Dividerconstant.
- Made the
- lib/ui/features/home/home_page.dart
- Replaced
AppBarwith a reusableCustomAppBarwidget. - Included
ThemeNotifierin the constructor.
- Replaced
- lib/ui/features/sign_in/sign_in_page.dart
- Added
consttoAppBarandIcon.
- Added
- lib/ui/features/sign_up/sign_up_page.dart
- Updated
AppBartitle to useconst.
- Updated
- test/data/repositories/*
- Updated test implementations to use
LocalStorageServicein place ofSharedPreferencesService.
- Updated test implementations to use
- test/domain/models/club_test.dart & schedule_test.dart
- Made
TimeOfDayconstructorsconst.
- Made
New Files
- lib/ui/features/app/view_model/theme_notifier.dart
- Implements a
ChangeNotifierthat manages the theme state using a key-value storage.
- Implements a
- lib/ui/core/ui/drawer/main_drawer.dart
- Added base structure for the app’s navigation drawer.
- lib/ui/features/home/widgets/custom_app_bar.dart
- Custom
AppBarwith dynamic icon for theme toggling usingThemeNotifier.
- Custom
Conclusion
All changes have been successfully implemented to improve theming, dependency management, and CLI maintainability. The application remains functional and now supports dynamic light/dark mode switching.
2025/04/16 – version: 0.11.02+17
Enhance Address Repository with Remote Fetch and Full CRUD Test Coverage
This update refines the RemoteAddressRepository by introducing a forceRemote flag to both initialize and fetch methods, allowing explicit bypassing of local cache when needed. Additionally, the integration tests were expanded to cover the entire CRUD flow (add, fetch, update, delete) and provide greater reliability in real-world usage scenarios.
Modified Files
lib/data/repositories/address/remote_address_repository.dart- Wrapped
addressesListinUnmodifiableListViewto enforce immutability. - Enhanced
initializeto optionally force remote fetch even if local data is available. - Enhanced
fetchto support theforceRemoteflag. - Improved internal logic for more consistent and flexible address data retrieval.
- Wrapped
lib/data/services/shared_preferences_service.dart- Documented the
getKeysmethod to clarify its purpose and expected usage.
- Documented the
lib/domain/models/address.dart- Corrected field mapping in
fromMapfromperson_idtouser_idto match the actual database schema.
- Corrected field mapping in
test/data/repositories/address/remote_address_repository_integration_test.dart- Updated
userIdused in tests to reflect active Supabase records. - Expanded the existing test to cover the entire lifecycle:
addan addressfetchfrom cachefetchfrom Supabase withforceRemoteupdateaddress and verify persisted valuesdeleteand verify deletion
- Added placeholder for future test on
initialize()logic.
- Updated
test/data/repositories/person/remote_person_repository_integration_test.dart- Aligned test
userIdwith new sample data used across tests for consistency.
- Aligned test
Conclusion
The RemoteAddressRepository is now more flexible and testable, with robust support for cache bypass and improved test coverage across all operations. These enhancements help ensure consistent behavior in both development and production environments.
2025/04/16 – version: 0.11.01+16
Update UML Diagram and Add Address Repository with Supabase Integration
This commit introduces a complete implementation for managing address data via Supabase, including a new repository layer, model serialization support, integration tests, and a corresponding UML diagram update. It also improves the Person repository with cache initialization and adds utility support for key-prefixed queries in the shared preferences service.
Modified Files
doc/diagrama de classes.drawio- Updated method names from
gettofetchfor consistency across all repositories. - Added a new class diagram for
RemotePersonRepositoryand theAddressmodel.
- Updated method names from
lib/data/repositories/common/tables.dart- Added the
addresstable constant.
- Added the
lib/data/repositories/person/person_repository.dart- Added documentation for all CRUD operations and introduced the new
initializemethod.
- Added documentation for all CRUD operations and introduced the new
lib/data/repositories/person/remote_person_repository.dart- Added initialization logic via
initialize. - Implemented local cache fallback with
_fetchFromLocaland_fetchFromSupabase. - Added and documented
_cachePersonhelper for shared preferences. - Improved error handling and internal state consistency using
_startedflag.
- Added initialization logic via
lib/data/services/shared_preferences_service.dart- Introduced
getKeys(String prefix)to retrieve all keys under a namespace.
- Introduced
lib/domain/models/address.dart- Replaced
personIdwithuserIdto align with Supabase schema. - Updated field names to snake_case to match Supabase column names.
- Added
toJsonString()andfromJsonString()methods for local caching.
- Replaced
pubspec.lock&pubspec.yaml- Added the
uuidpackage to support ID generation for addresses. - Included new transitive dependencies
fixnumandsprintf.
- Added the
supabase/migrations/20250416131951_create_person_table.sql→20250417191646_create_person_table.sql- Renamed and updated
persontable migration to explicitly referenceauth.users(id).
- Renamed and updated
New Files
lib/data/repositories/address/address_repository.dart- Declares the
AddressRepositoryabstract class with methods for initialize, fetch, add, update, and delete.
- Declares the
lib/data/repositories/address/remote_address_repository.dart- Implements
RemoteAddressRepositoryusing Supabase and SharedPreferences. - Provides full address lifecycle management with local cache fallback.
- Implements
supabase/migrations/20250417191633_create_address_table.sql- Creates the
addresstable with RLS and policies to restrict access byauth.uid().
- Creates the
test/data/repositories/address/remote_address_repository_integration_test.dart- Provides integration tests for the
RemoteAddressRepository. - Verifies add and fetch logic, including cache fallback and Supabase consistency.
- Provides integration tests for the
Conclusion
Address management has been successfully integrated with Supabase, including full repository functionality, schema migration, and robust testing. The diagram and infrastructure have been updated accordingly.
2025/04/16 – version: 0.11.00+15
Replace abstract repository imports with unified auth/person repository paths
This commit updates all references from the previously named abstract_auth_repository.dart and abstract_person_repository.dart to their new unified names: auth_repository.dart and person_repository.dart. This change ensures consistency across the project and reflects the updated repository file structure.
Modified Files
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated import to use
auth_repository.dart.
- Updated import to use
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated import path from abstract to unified auth repository.
- lib/data/repositories/person/remote_person_repository.dart
- Replaced import of
abstract_person_repository.dartwithperson_repository.dart.
- Replaced import of
- lib/ui/features/home/home_view_model.dart
- Updated import path to use
auth_repository.dart.
- Updated import path to use
- lib/ui/features/sign_in/sign_in_view_model.dart
- Updated dependency from
abstract_auth_repository.darttoauth_repository.dart.
- Updated dependency from
- lib/ui/features/sign_up/sign_up_view_model.dart
- Same import change for the authentication repository.
- lib/ui/features/splash/splash_view_model.dart
- Aligned import with new file name for the authentication repository.
Conclusion
All repository references have been successfully updated to reflect the new file names, improving naming clarity and alignment across the project layers.
2025/04/16 – version: 0.11.00+14
Rename abstract repositories and add unit tests for Club and Schedule
This update performs the renaming of abstract repository files to standard names and adds comprehensive unit tests for the Club and Schedule models. These changes improve the consistency of the repository structure and increase test coverage for key domain models.
Modified Files
- lib/data/repositories/auth/abstract_auth_repository.dart → auth_repository.dart
- Renamed the file to follow a cleaner and more conventional naming pattern.
- lib/data/repositories/person/abstract_person_repository.dart → person_repository.dart
- Renamed for consistency with other repository file names.
New Files
- test/domain/models/club_test.dart
- Added unit tests for the
Clubclass:- Verifies correct field mapping in
toMap. - Ensures accurate reconstruction via
fromMap. - Validates JSON round-trip behavior with
toJsonandfromJson.
- Verifies correct field mapping in
- Added unit tests for the
- test/domain/models/schedule_test.dart
- Introduced tests for both
OperatingDayandSchedule:- Confirms correct map serialization and deserialization.
- Ensures JSON round-trip reliability for
OperatingDay. - Tests selective inclusion of non-null days in
Schedule.
- Introduced tests for both
Conclusion
This commit improves naming clarity for repository interfaces and strengthens model reliability through precise unit tests for schedule and club data structures.
2025/04/16 – version: 0.10.03+13
Add new Club model and refactor Athlete and Manager data structure
This commit introduces several structural enhancements to the data model layer, particularly the replacement of raw document fields with a new Document class. A new Club entity was also introduced to represent the organization of sports activities. Additionally, utilities for document validation and string formatting were created to support cleaner validation logic.
Modified Files
- .gitignore
- Added
/coverage/to the ignore list.
- Added
- Makefile
- Prevented
pushandpush_branchonmainormasterbranches. - Updated
test_coverageto run with--concurrency=1. - Added
test_serialtask aliasingtest_coverage.
- Prevented
- lib/domain/enums/enums_declarations.dart
- Replaced
SportType.rugbywithSportType.handball.
- Replaced
- lib/domain/models/athlete.dart
- Replaced
personId,document, andsportswith a unifiedcpfDocfield using the newDocumentclass. - Updated serialization methods to use snake_case and ISO strings.
- Added
toJson(), equality operator, andhashCode.
- Replaced
- lib/domain/models/manager.dart
- Replaced multiple document fields with
cpfDocandsecondDoc. - Refactored serialization to align with new structure and snake_case keys.
- Implemented
toJson(), equality operator, andhashCode.
- Replaced multiple document fields with
- lib/domain/models/operating_day.dart
- Changed time representation from seconds to “HH:mm” strings.
- Added JSON serialization and deserialization methods.
- lib/domain/models/person.dart
- Updated import to a relative path.
- lib/domain/models/schedule.dart
- Renamed
toJson()andfromJson()totoJsonString()andfromJsonString()for consistency.
- Renamed
- lib/ui/features/sign_in/sign_in_page.dart
- Updated validation import path from
utils/validate.darttoutils/validates/sign_validate.dart.
- Updated validation import path from
- lib/ui/features/sign_up/sign_up_page.dart
- Same import path adjustment as above.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Added full test cycle:
add(),update(),fetch()(from cache and remote), anddelete()with verification.
- Added full test cycle:
New Files
- lib/domain/models/club.dart
- Created the
Clubclass with properties such as manager, sport type, address, location, schedule, and monthly fee. - Includes full serialization, equality, and copy support.
- Created the
- lib/domain/models/document.dart
- Introduced
Documentclass with enumDocTypefor CPF, RG, CNPJ, and CNH. - Supports validation, serialization, and equality.
- Introduced
- lib/domain/models/location.dart
- Represents geographic location with latitude and longitude.
- Includes JSON serialization and equality comparison.
- lib/utils/extensions/string_extensions.dart
- Added extension to extract only numeric digits from a string.
- lib/utils/validates/docs_validate.dart
- Contains static validation methods for CPF, CNPJ, CNH, and RG with detailed logic.
- lib/utils/validates/sign_validate.dart (renamed from
utils/validate.dart)- Retained existing email validation logic with updated class declaration.
Conclusion
The system now features improved data consistency and validation logic, laying solid groundwork for upcoming domain features.
2025/04/16 – version: 0.10.02+12
Add Person Caching and Test Infrastructure with Refined Supabase Integration
This commit introduces local caching to the RemotePersonRepository using a shared preferences wrapper, enhancing offline resilience and reducing unnecessary network calls. Additionally, it includes extensive unit and integration tests for both the repository and shared preferences service. Minor structural and naming improvements were also applied across services and models.
Modified Files
- Makefile
- Added a
supabase_cli_restartcommand for quick CLI server restarts.
- Added a
- lib/data/repositories/person/abstract_person_repository.dart
- Renamed method
get()tofetch()for consistency with repository terminology.
- Renamed method
- lib/data/repositories/person/remote_person_repository.dart
- Implemented caching logic via
SharedPreferencesService. - Rewrote
fetch,add,update, anddeleteto incorporate local cache handling. - Added logging and improved error traceability.
- Created private method
_cachePerson().
- Implemented caching logic via
- lib/data/services/auth_service.dart
- Renamed internal variable
_supabaseto_supabaseClientfor clarity. - Updated all usage accordingly.
- Renamed internal variable
- lib/data/services/shared_preferences_service.dart
- Redesigned with
setString,getString, andremovemethods using consistentResultwrappers. - Enhanced logging and error handling.
- Redesigned with
- lib/domain/models/operatingDay → operating_day.dart
- Renamed file to match snake_case naming convention.
- lib/domain/models/person.dart
- Adjusted date serialization to use ISO 8601 format (UTC) instead of milliseconds.
- Renamed
toJson()/fromJson()totoJsonString()/fromJsonString()for consistency.
- lib/domain/models/schedule.dart
- Updated import to match renamed
operating_day.dart.
- Updated import to match renamed
- pubspec.yaml
- Bumped version to
0.10.02+12. - Added
mocktailandtestdependencies for unit testing.
- Bumped version to
- supabase/migrations/20250416131951_create_person_table.sql
- Fixed column names:
createdAt→created_at,updatedAt→updated_atto match Dart model changes.
- Fixed column names:
New Files
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Integration test for
RemotePersonRepository:- Validates
add()+fetch()from cache and remote. - Cleans up test data before/after tests.
- Validates
- Integration test for
- test/data/services/shared_preferences_service_test.dart
- Unit tests for
SharedPreferencesService:- Validates
setString,getString,remove. - Tests retrieval of non-existent keys.
- Validates
- Unit tests for
Conclusion
This update strengthens the app’s architecture by introducing local caching, improving repository reliability, and enforcing test coverage. The system is now more resilient to connectivity issues and better structured for future expansion.
2025/04/16 – version: 0.10.01+11
Add Person Management Infrastructure and Refactor Git/CLI Configs
This commit introduces the foundational structure for managing user profiles through the new Person entity. It includes model definitions, repository interfaces, Supabase integration, and access control via row-level security. In addition, project tooling and configuration files such as .gitignore, README.md, and Makefile have been updated for improved workflow and documentation.
Modified Files
- .gitignore
- Added
.secretsand backup files for.drawioto avoid committing sensitive and temporary data.
- Added
- Makefile
- Pinned
supabaseCLI commands to version2.20.12to ensure consistency across environments.
- Pinned
- README.md
- Replaced placeholder text with a detailed structure of the Firebase Firestore collections used in the project.
- doc/diagrama de classes.drawio
- Diagram content updated, likely to reflect recent class/model changes.
- lib/domain/enums/enums_declarations.dart
- Refined descriptions of user roles.
- Deprecated the
collaboratorrole (commented out for now). - Adjusted
nonerole description for clarity.
- lib/domain/models/person.dart
- Fully implemented the
Personmodel with:- Additional fields (
phone,role) - Serialization methods (
toMap,fromMap,toJson,fromJson) copyWith,toString, equality and hash overrides for robust model handling.
- Additional fields (
- Fully implemented the
New Files
- lib/data/repositories/common/tables.dart
- Centralized table name definitions; currently includes
'person'.
- Centralized table name definitions; currently includes
- lib/data/repositories/person/abstract_person_repository.dart
- Interface definition for the
PersonRepository.
- Interface definition for the
- lib/data/repositories/person/remote_person_repository.dart
- Concrete implementation of
PersonRepositoryusing Supabase client for CRUD operations. - Includes logging and error handling.
- Concrete implementation of
- supabase/migrations/20250416131951_create_person_table.sql
- Supabase SQL migration to:
- Create the
persontable with appropriate fields and constraints. - Enable row-level security.
- Define RLS policies for read, insert, and update access tied to authenticated users.
- Create the
- Supabase SQL migration to:
Conclusion
This update establishes the groundwork for managing user profile data securely and reliably via Supabase, while also improving tooling and documentation. All changes integrate cleanly with the existing codebase.
2025/04/16 – version: 0.10.00+10
Refactor AuthService and Introduce Operating Schedule Models
This commit includes refactoring of the authentication service to improve clarity and consistency, alongside the introduction of new domain models to manage business operating hours. Additionally, it unifies naming conventions across the codebase (id → userId) and adjusts related test cases accordingly.
Modified Files
- lib/data/repositories/auth/abstract_auth_repository.dart
- Changed import from package to relative path.
- lib/data/repositories/auth/dev_auth_repository.dart
- Replaced
idwithuserIdto matchUserAuthclass refactor.
- Replaced
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated method call from
signInWithPassword()tosignIn()to match new method naming.
- Updated method call from
- lib/data/services/auth_service.dart
- Renamed
start()toinitialize()for clearer intent. - Renamed method
signInWithPassword()tosignIn(). - Updated
LoggedUserinstantiation to useuserIdinstead ofid.
- Renamed
- lib/domain/models/user_auth.dart
- Replaced
idfield withuserIdto clarify user identifier semantics. - Updated constructors, copyWith methods, and toString accordingly for
LoggedUserandNotLoggedUser.
- Replaced
- lib/main.dart
- Adjusted call from
AuthService.start()toAuthService.initialize().
- Adjusted call from
- lib/ui/features/home/home_page.dart, home_view_model.dart, sign_in_page.dart
- Minor formatting and removal of commented-out code.
- lib/utils/commands.dart
- Commented out
notifyListeners()inclearResult()method.
- Commented out
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated test call from
start()toinitialize()to reflect method rename.
- Updated test call from
- test/data/services/supabase_auth_service_test.dart
- Updated usage of
signInWithPassword()tosignIn(). - Renamed
AuthService.start()toinitialize().
- Updated usage of
New Files
- lib/domain/models/operatingDay
- Defines the
OperatingDayclass representing a single day’s open and close time usingTimeOfDay. - Includes extension and utility functions to convert to/from seconds.
- Defines the
- lib/domain/models/schedule.dart
- Introduces the
Scheduleclass to manage weekly business hours via optionalOperatingDayfields for each weekday. - Includes methods for serialization, deserialization, and deep copy.
- Introduces the
Conclusion
Authentication logic is now clearer and more consistent, while the addition of OperatingDay and Schedule models lays the groundwork for advanced scheduling features. All changes are stable and the codebase remains functional.
2025/04/04 – version: 0.01.00+09
Refactored authentication service and improved error handling for login and sign-up flows.
Changes made:
- lib/config/dependencies.dart:
- Replaced
SupabaseAuthServicewith the renamedAuthService. - Updated provider registration to reflect the new service name.
- Replaced
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Added
authServiceandeventgetters to the abstract repository to expose authentication state and service.
- Added
- lib/data/repositories/auth/dev_auth_repository.dart:
- Injected
AuthServiceinto theDevAuthRepositoryand implemented the new required getters.
- Injected
- lib/data/repositories/auth/remote_auth_repository.dart:
- Updated to use
AuthServiceinstead ofSupabaseAuthService. - Removed internal
fetchUsercall from constructor. - Added support for
authServiceandeventproperties.
- Updated to use
- lib/data/services/supabase_auth_service.dart → lib/data/services/auth_service.dart:
- Renamed file and class from
SupabaseAuthServicetoAuthService. - Refactored event logging for better clarity.
- Improved session handling by printing ‘opened’ or ‘closed’ instead of raw session.
- Renamed file and class from
- lib/main.dart:
- Updated import and initialization call from
SupabaseAuthServicetoAuthService.
- Updated import and initialization call from
- lib/ui/core/theme/dimens.dart:
- Added
paddingScreenAllto encapsulate consistent edge spacing. - Applied new spacing in mobile and desktop implementations.
- Added
- lib/ui/core/ui/messages/app_snack_bar.dart:
- Removed unnecessary comments and added return type for clarity.
- Minor cleanup for better structure and readability.
- lib/ui/features/home/home_page.dart:
- Added disposal of listener in
dispose()to avoid memory leaks.
- Added disposal of listener in
- lib/ui/features/home/home_view_model.dart:
- Exposed
authServiceandeventvia the view model for external access.
- Exposed
- lib/ui/features/sign_in/sign_in_page.dart:
- Applied
AppSnackBarfor user feedback on failed sign-in. - Updated error message logic to differentiate known from unknown errors.
- Cleaned up padding and interaction logic using
Dimensconstants.
- Applied
- lib/ui/features/sign_up/sign_up_page.dart:
- Replaced raw
SnackBarwithAppSnackBarfor better consistency. - Enhanced error handling with contextual messages.
- Adjusted
onEditingCompleteand validation flow for improved UX.
- Replaced raw
- pubspec.yaml:
- Updated version from
0.0.1+08to0.01.00+09.
- Updated version from
- test/data/repositories/auth/remote_auth_repository_test.dart:
- Replaced
SupabaseAuthServicewithAuthServicein test setup and logic.
- Replaced
- test/data/services/supabase_auth_service_test.dart:
- Renamed imports and instantiations to use
AuthServicethroughout the integration tests.
- Renamed imports and instantiations to use
Conclusion:
This refactor centralizes authentication logic under the new AuthService class, ensuring cleaner abstraction and naming consistency. It also enhances the user experience with improved error feedback and layout adjustments, and updates the test suite accordingly.
2025/04/04 – version: 0.0.01+08
Added new features and refactored existing components to improve authentication, routing, and UI feedback mechanisms.
Changes made:
- assets/images/sports_logo.png:
- Added new image asset for the sports logo.
- assets/images/sports_splash.png:
- Added new image asset for the splash screen.
- lib/config/dependencies.dart:
- Created a new dependency injection file using
ProviderforSupabaseAuthServiceandRemoteAuthRepository.
- Created a new dependency injection file using
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Added a new abstract method
fetchUserto retrieve the authenticated user.
- Added a new abstract method
- lib/data/repositories/auth/dev_auth_repository.dart:
- Implemented the new
fetchUsermethod returning a mockedLoggedUser.
- Implemented the new
- lib/data/repositories/auth/remote_auth_repository.dart:
- Implemented
fetchUserusing theSupabaseAuthService.
- Implemented
- lib/data/services/supabase_auth_service.dart:
- Renamed logger label to
SupabaseAuthService. - Added logging to all cases of authentication state change.
- Removed artificial delays in sign-up, sign-in, sign-out, and user update methods.
- Improved error messages in
fetchUser. - Changed return type of
fetchUsertoResult<LoggedUser>. - Added validation for initialized session in
fetchUser.
- Renamed logger label to
- lib/main.dart:
- Wrapped
MainAppin aMultiProviderusing the newdependencieslist.
- Wrapped
- lib/main_app.dart:
- Changed app theme from
lighttodark.
- Changed app theme from
- lib/routing/router.dart:
- Replaced manual repository instantiations with
context.read()usingProvider. - Updated initial route to the splash screen.
- Injected
SplashViewModelwith dependency.
- Replaced manual repository instantiations with
- lib/ui/core/theme/dimens.dart:
- Added
radiusgetter to unify border radius access. - Refactored
borderRadiusgetters in both mobile and desktop classes to useradius.
- Added
- lib/ui/core/ui/buttons/big_button.dart:
- Removed hardcoded icon dependency.
- Simplified icon rendering using the widget’s
iconData.
- lib/ui/core/ui/messages/app_snack_bar.dart:
- Introduced a reusable
AppSnackBarutility for showing stylized SnackBars.
- Introduced a reusable
- lib/ui/features/home/home_page.dart:
- Replaced dummy sign-out logic with actual sign-out result handling using
AppSnackBarfor error feedback.
- Replaced dummy sign-out logic with actual sign-out result handling using
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored
_onLoginto useresult.fold()for better control and feedback handling.
- Refactored
- lib/ui/features/sign_up/sign_up_page.dart:
- Renamed
passwordFocusNodeandconfirmPasswordFocusNodeto_passwordFocusNodeand_confirmPasswordFocusNodefor encapsulation. - Adjusted focus handling logic accordingly.
- Extended SnackBar display duration on successful sign-up.
- Renamed
- lib/ui/features/splash/splash_page.dart:
- Converted
SplashPagefromStatelessWidgettoStatefulWidget. - Added logic to fetch user on init and navigate accordingly to home or sign-in.
- Improved visual design with logo and themed text.
- Converted
- lib/ui/features/splash/splash_view_model.dart:
- Refactored
SplashViewModelto include a command-basedfetchUsermethod. - Added logging for success and error cases in
fetchUser.
- Refactored
- pubspec.yaml:
- Added
provideras a dependency. - Declared
assets/images/in the Flutter assets section.
- Added
Conclusion:
This commit introduces foundational improvements to the app’s architecture, emphasizing better dependency injection, clearer user session handling, and enhanced UI feedback. It also sets up a splash screen with logic to redirect based on authentication state, improving overall UX.
2025/04/03 – version: 0.0.01+07
This commit introduces logout support, improves authentication UX feedback, refactors shared button behavior, and enhances form validation consistency across the sign-in and sign-up flows.
Changes made:
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Refactored import statements to use relative paths for consistency.
- lib/data/repositories/auth/dev_auth_repository.dart:
- Updated import statements to relative paths.
- lib/data/services/supabase_auth_service.dart:
- Added artificial delays (
Future.delayed) insignUp,signInWithPassword,signOut,updatePassword, andupdateUserPhonemethods to simulate realistic request latency.
- Added artificial delays (
- lib/routing/router.dart:
- Injected
HomeViewModelinto theHomePageusingRemoteAuthRepositoryandSupabaseAuthService.
- Injected
- lib/ui/core/ui/buttons/big_button.dart:
- Converted
BigButtonfromStatelessWidgettoStatefulWidget. - Replaced the optional
iconparameter withiconDataandisRunning. - Added a dynamic internal icon that switches between loading indicator and an icon based on
isRunning.
- Converted
- lib/ui/features/home/home_page.dart:
- Injected
HomeViewModelthrough constructor. - Added logout logic using
signOutcommand. - Connected the logout button to execute
signOut.
- Injected
- lib/ui/features/home/home_view_model.dart:
- Created
HomeViewModelclass. - Implemented
signOutcommand with logging on success and failure.
- Created
- lib/ui/features/sign_in/sign_in_page.dart:
- Added form key to enable validation.
- Updated
BigButtonto use the newiconDataandisRunningparameters viaListenableBuilder. - Wrapped
_signInlogic with validation and running checks to avoid multiple submissions.
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Marked
signInasfinaland ensured immutability.
- Marked
- lib/ui/features/sign_up/sign_up_page.dart:
- Updated validation to use
SignValidate. - Replaced direct icon widget in
BigButtonwithiconDataandisRunning, usingListenableBuilder. - Wrapped
_signUpmethod with validation and running checks.
- Updated validation to use
- lib/ui/features/sign_up/sign_up_view_model.dart:
- Marked
signUpasfinalfor consistency.
- Marked
- lib/utils/validate.dart:
- Renamed
Validateclass toSignValidateto improve clarity and avoid future naming conflicts.
- Renamed
Conclusion:
These changes finalize the logout feature, improve responsiveness of auth actions with loading indicators, and enhance maintainability by standardizing validation and UI behavior across screens. This also refactors shared widget logic into a more flexible and scalable format.
2025/04/03 – version: 0.0.01+06
This commit enhances the sign-up flow with full integration of the SignUpViewModel, introduces new validation logic, adjusts routing for dependency injection, and refactors the sign-in flow for naming consistency and better clarity.
Changes made:
- .env:
- Updated the Supabase
URLfrom127.0.0.1to a local network IP192.168.0.22.
- Updated the Supabase
- lib/routing/router.dart:
- Refactored imports for better readability.
- Injected
SignUpViewModelinto theSignUpPageusingRemoteAuthRepositoryandSupabaseAuthService.
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored import of
sign_in_view_model.dartto a relative path. - Updated
SignInViewModelusage: replacedloginwithsignInin listeners and method calls to reflect updated naming. - Minor formatting fix in
BasicTextFieldprops order.
- Refactored import of
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Renamed command from
logintosignInto improve clarity. - Renamed internal method
_loginto_signIn. - Updated logger name from
LoginViewModeltoSignInViewModel.
- Renamed command from
- lib/ui/features/sign_up/sign_up_page.dart:
- Injected
SignUpViewModelinto the page via constructor. - Added controllers and form key for managing input and validation.
- Initialized and disposed of the new controllers properly.
- Connected the form to the
SignUpViewModelvia listener. - Implemented input validation using
Validate. - Added logic to show a
SnackBarand navigate after successful sign-up. - Refactored
BigButtonto show a loading indicator when the command is running. - Improved UX with password match validation and async flow control.
- Injected
- lib/ui/features/sign_up/sign_up_view_model.dart:
- Created a new
SignUpViewModelclass. - Implemented
signUpcommand usingCommand1to encapsulate sign-up logic and handle result logging.
- Created a new
- lib/utils/validate.dart:
- Added a new method
confirmPasswordto check if confirmation matches the original password.
- Added a new method
Conclusion:
These improvements finalize the sign-up feature with robust state management, validation, and navigation logic, aligning it with the architecture used in sign-in. The changes also ensure better naming consistency and modularity across the app.
2025/04/03 – version: 0.0.01+05
This commit introduces significant updates to the authentication flow, UI structure, and routing configuration, along with new reusable UI components and enhancements to form validation and theme styling.
Changes made:
- devtools_options.yaml:
- Created a new configuration file to store Dart & Flutter DevTools settings.
- lib/data/repositories/auth/remote_auth_repository.dart:
- Changed the return type of the
loginmethod fromResult<void>toResult<LoggedUser>. - Refactored the login logic using
foldto handle success and failure cases more explicitly.
- Changed the return type of the
- lib/main_app.dart:
- Changed the app theme from
theme.dark()totheme.light()inMaterialApp.router.
- Changed the app theme from
- lib/routing/router.dart:
- Corrected typo in route paths from
singInandsingUptosignInandsignUp. - Modified the sign-in route to provide a
SignInViewModelwith an injectedRemoteAuthRepository. - Updated the sign-up route to render the correct
SignUpPage.
- Corrected typo in route paths from
- lib/routing/routes.dart:
- Corrected route constants from
singInandsingUptosignInandsignUp.
- Corrected route constants from
- lib/ui/core/theme/dimens.dart:
- Increased the default border radius from 12 to 50 in
_DimensMobile.
- Increased the default border radius from 12 to 50 in
- lib/ui/core/ui/buttons/big_button.dart:
- Simplified the button layout by removing unnecessary padding.
- Adjusted alpha value in
backgroundColorfor better visual emphasis. - Used
dimens.spacingHorizontalfor spacing between elements.
- lib/ui/core/ui/buttons/text_row_button.dart:
- Added a new
TextRowButtonwidget to align text and a text button in a row, with optional action.
- Added a new
- lib/ui/core/ui/text_fields/basic_text_field.dart:
- Created a reusable
BasicTextFieldwidget encapsulating commonTextFormFieldconfigurations. - Added automatic validation mode activation when text is entered.
- Created a reusable
- lib/ui/core/ui/text_fields/secret_text_field.dart:
- Added a
SecretTextFieldwidget based onBasicTextField, with a visibility toggle icon for password input.
- Added a
- lib/ui/features/home/home_page.dart:
- Updated the
AppBaricon to useSymbols.dark_mode_rounded.
- Updated the
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored to use
SignInViewModelwith reactive command execution. - Replaced raw
TextFormFieldusage withBasicTextFieldandSecretTextField. - Added new UI components: fingerprint authentication icon, route navigation to sign-up, and password recovery.
- Enhanced styling using
colorSchemeandDimens.
- Refactored to use
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Added
SignInViewModelclass withCommand1to execute the login process. - Implemented detailed logging for success and failure scenarios.
- Added
- lib/ui/features/sign_up/sign_up_page.dart:
- Implemented the complete sign-up UI using
BasicTextFieldandSecretTextField. - Added navigation to login page and basic layout structure.
- Implemented the complete sign-up UI using
- lib/utils/commands.dart:
- Fixed typo in method name from
excutetoexecuteinCommand1.
- Fixed typo in method name from
- lib/utils/validate.dart:
- Added email and password validation logic using regular expressions.
- Created a
Validateutility class to encapsulate form validation rules.
- pubspec.lock:
- Updated lockfile with new dependencies including
material_symbols_icons,args,chalkdart, andglob.
- Updated lockfile with new dependencies including
- pubspec.yaml:
- Added
material_symbols_iconspackage to dependencies.
- Added
Conclusion:
These changes lay the foundation for a structured authentication system and improved user experience through reusable components and cleaner routing. They also introduce robust validation mechanisms and consistent styling aligned with the app’s design system.
2025/04/03 – version: 0.0.01+04
Refactored app theming and structure; introduced responsive UI elements and custom theme support.
Changes made:
android/app/build.gradle.kts- Set
ndkVersionexplicitly to"27.0.12077973"for compatibility and stability across environments.
- Set
lib/main.dart- Removed
MainAppwidget frommain.dart, delegating it to its own filemain_app.dart.
- Removed
lib/main_app.dart(new)- Introduced
MainAppwidget as aStatefulWidgetwith custom theming. - Dynamically applies dark mode theme with custom
MaterialTheme.
- Introduced
lib/routing/router.dart- Changed
initialLocationtoRoutes.singIn(presumably a login screen). - Cleaned up import paths using relative imports.
- Changed
lib/ui/core/theme/(new)- Added a full theming system:
theme.dart: defines custom color schemes and theming logic.fonts.dart: responsive typography with Google Fonts support (QuicksandandAssistant).dimens.dart: responsive paddings, spacings and radius for mobile and desktop.util.dart: generatesTextThemefrom Google Fonts dynamically.
- Added a full theming system:
lib/ui/core/ui/buttons/big_button.dart(new)- Introduced a reusable
BigButtoncomponent with custom color, shape, and optional icon.
- Introduced a reusable
lib/ui/features/sign_in/sign_in_page.dart- Replaced
Placeholderwith a fully implemented sign-in form usingDimensandBigButton. - Styled input fields and button using the new theme system.
- Replaced
pubspec.yaml- Added dependency on
google_fonts: ^6.2.1.
- Added dependency on
pubspec.lock- Updated lockfile to reflect new dependency on
google_fonts.
- Updated lockfile to reflect new dependency on
Conclusion:
This commit introduces a scalable and modular design system with clear separation between logic, theme, and presentation. It significantly enhances UI responsiveness, theme customization, and maintainability, setting a strong foundation for future feature development.
2025/04/02 – version: 0.0.01+03
Renamed base auth repository and added new domain models and enums to support extended user profiles.
Changes made:
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Renamed from
auth_repository.dartto reflect its role as an abstract base class.
- Renamed from
- lib/data/repositories/auth/dev_auth_repository.dart:
- Updated import path to reference the renamed
abstract_auth_repository.dart.
- Updated import path to reference the renamed
- lib/data/repositories/auth/remote_auth_repository.dart:
- Updated import path to reference the renamed
abstract_auth_repository.dart.
- Updated import path to reference the renamed
- lib/domain/enums/enums_declarations.dart:
- Created a new file defining multiple domain enums:
DocumentType,UserRole,Sex,SoccerPosition,AffiliationStatus,Weekday,SportType, andMessageCategories.
- Included
LabeledEnuminterface and extensionEnumExtensionfor utility mapping.
- Created a new file defining multiple domain enums:
- lib/domain/models/address.dart:
- Introduced
Addressmodel with fulltoMap/fromMapserialization support andcopyWithmethod.
- Introduced
- lib/domain/models/athlete.dart:
- Created
Athletemodel with personal details, document, sports list, and address relation. - Includes serialization and copy functionality.
- Created
- lib/domain/models/manager.dart:
- Created
Managermodel similar toAthlete, with two documents and sport tracking.
- Created
- lib/domain/models/person.dart:
- Defined
Personmodel representing a general user with profile and address references.
- Defined
- lib/domain/models/user_auth.dart:
- Extended
UserAuthbase class to include optionalphonefield. - Preserved backward compatibility via default parameters.
- Extended
- lib/utils/result.dart:
- Annotated
Success.valueandFailure.errorwith@overrideto clarify their behavior from the abstract base.
- Annotated
Conclusion:
This update lays the groundwork for managing user profile types and roles through a well-structured domain model. It enables support for complex personas such as athletes and managers, and aligns the codebase with a more modular and extensible architecture.
2025/03/31 – version: 0.0.01+02
Refactored Supabase integration to introduce SupabaseAuthService with full authentication handling and test coverage.
Changes made:
- .env:
- Added commented environment variables for the hosted Supabase instance to support multiple environments.
- Makefile:
- Added
rebuildcommand to clean and restore Flutter dependencies. - Added
test_coveragecommand to run tests and generate coverage report.
- Added
- coverage/lcov.info:
- Added test coverage data file generated from unit tests.
- lib/data/services/supabase_auth_service.dart:
- Introduced
SupabaseAuthServiceto replaceSupabaseService. - Implemented full authentication flow: initialization, sign up, sign in, sign out, password recovery, and user updates.
- Added internal auth state listener and custom
AuthEventenum.
- Introduced
- lib/data/services/supabase_service.dart:
- Deleted legacy
SupabaseService, which is now fully replaced bySupabaseAuthService.
- Deleted legacy
- lib/main.dart:
- Updated to load environment variables using
flutter_dotenv. - Replaced
SupabaseServicewithSupabaseAuthService. - Added example authentication flow with debug prints for success and failure cases.
- Updated to load environment variables using
- lib/utils/result.dart:
- Extended
Result<T>withvalueanderrorgetters for easier access to result contents.
- Extended
- test/data/services/.env_test_supabase:
- Added a separate environment file for local Supabase CLI testing.
- test/data/services/supabase_auth_service_test.dart:
- Created comprehensive integration tests for
SupabaseAuthService. - Covered user registration, sign-in, sign-out, duplicate handling, password recovery, and password update flows.
- Created comprehensive integration tests for
Conclusion:
This refactor significantly enhances the authentication architecture by consolidating Supabase-related logic into a single, reactive service. It also introduces robust automated tests, enabling better validation of user flows and improved maintainability going forward.
2025/03/28 – version: 0.0.01+01
Initial integration of Supabase services and setup of authentication infrastructure.
Changes made:
- .env:
- Added environment variables for local Supabase CLI usage, including
URLandAnonKey.
- Added environment variables for local Supabase CLI usage, including
- .vscode/extensions.json:
- Added VSCode extension recommendation for
denoland.vscode-deno.
- Added VSCode extension recommendation for
- .vscode/settings.json:
- Configured Deno support and linting for
supabase/functions.
- Configured Deno support and linting for
- Makefile:
- Added custom Makefile commands to start/stop Supabase CLI, generate diffs, and push commits.
- android/app/src/main/AndroidManifest.xml:
- Added permission to allow internet access in the Android application.
- lib/data/repositories/auth/auth_repository.dart:
- Created abstract class
AuthRepositorywith methods for authentication logic:login,logout,signUp, andisAuthenticated.
- Created abstract class
- lib/data/repositories/auth/dev_auth_repository.dart:
- Implemented
DevAuthRepository, a mock implementation ofAuthRepositoryfor development purposes.
- Implemented
- lib/data/repositories/auth/remote_auth_repository.dart:
- Created
RemoteAuthRepositoryas a stubbed implementation ofAuthRepositoryfor future remote integration.
- Created
- lib/data/services/shared_preferences_service.dart:
- Added
SharedPreferencesServiceto handle storing and retrieving tokens using shared preferences.
- Added
- lib/data/services/supabase_service.dart:
- Created
SupabaseServicewith methods for initialization, user sign-up, sign-in with password, and sign-out.
- Created
- lib/domain/dto/credentials.dart:
- Introduced
Credentialsclass to encapsulate email and password used for authentication.
- Introduced
- lib/domain/models/user_auth.dart:
- Created a sealed class
UserAuthwith two implementations:LoggedUserandNotLoggedUser, to represent authentication states.
- Created a sealed class
- lib/main.dart:
- Modified main function to initialize
SupabaseServicebefore running the app. - Added call to sign out the user during app initialization.
- Modified main function to initialize
- linux/flutter/generated_plugin_registrant.cc:
- Registered new plugins:
GtkPluginandUrlLauncherPlugin.
- Registered new plugins:
- linux/flutter/generated_plugins.cmake:
- Included
gtkandurl_launcher_linuxin the plugin list.
- Included
- pubspec.yaml:
- Simplified and cleaned up comments.
- Set version to
0.0.1+1. - Added new dependencies:
shared_preferences,logging,supabase_flutter, andflutter_dotenv. - Included
.envfile in asset list.
- supabase/.gitignore:
- Added ignore rules for Supabase-generated files and dotenv local environment files.
- supabase/config.toml:
- Added full Supabase configuration for local development, covering API, DB, Studio, Realtime, Storage, Auth, and more.
Conclusion:
This commit establishes the foundation for user authentication via Supabase, introducing services, repositories, and shared preferences handling. It also configures local development tools and dependencies, paving the way for further backend integration.
Deixe uma resposta