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 for smstel, and android.support.customtabs.action.CustomTabsService
  • ios/Runner/Info.plist
    • added LSApplicationQueriesSchemes array containing sms and tel
  • lib/domain/use_cases/fav_club_user_case.dart
    • replaced _nearbyClubIds list with _clubDisList of ClubDistance
    • exposed clubDisList and nearbyClubsIds getters
    • updated nearbyClubs to use nearbyClubsIds
    • cleared _clubDisList at start of fetchNearbyClubs
    • populated _clubDisList with distances from repository
  • lib/ui/view/home/fav_clubs/club_details/club_details_view.dart
    • converted to StatefulWidget to support actions
    • imported url_launcher and added _openBrowser method 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 AppFontsStyle and Dimens
  • 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 ClubDistance DTO
    • exposed clubDisList and clubDistanceOf(String) helper
  • pubspec.yaml
    • added url_launcher: ^6.3.1 under dependencies
  • pubspec.lock
    • marked url_launcher as a direct main dependency

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/...
  • 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 cacheClubList to _cacheClubList and made it private
  • lib/data/repositories/clubs/i_club_repository.dart
    • removed cacheClubList from interface
    • declared Future<Result<void>> fetchByIds(List<String> ids) in interface
  • lib/data/repositories/fav_clubs/fav_clubs_repository.dart
    • updated service import paths
  • lib/data/repositories/functions/functions_repository.dart
    • replaced inline LastSearched DTO with import of /domain/dto/last_search.dart and /domain/dto/club_distance.dart
    • changed fetchNearbyClubs to return ClubDistance list and updated caching logic accordingly
  • lib/data/repositories/functions/i_functions_repository.dart
    • updated return type to Result<List<ClubDistance>> and clarified method docs
  • 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_service and updated import to local i_cache_service.dart
  • lib/data/services/cache_database/i_cache_service.dart
    • path unchanged, now under cache_database
  • lib/data/services/database/database_service.dart
    • renamed and relocated file, updated i_database_service.dart import
    • implemented fetchByIds<T> method that queries by id in [...], converts WKB to WKT, and maps results
  • lib/data/services/database/i_database_service.dart
    • declared Future<Result<List<T>>> fetchByIds<T>(...) in interface
  • lib/data/services/functions/functions_service.dart
    • adjusted imports, replaced manual WKB mapping with ClubDistance.fromMap for function results
  • lib/data/services/functions/i_functions_service.dart
    • updated return type to Result<List<ClubDistance>> for fetchNearbyClubs
  • lib/data/services/storage/storage_service.dart
    • relocated and updated import for i_storage_service.dart
  • lib/data/services/viacep/i_viacep_service.dart
    • moved interface file under viacep directory
  • 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 _saveLocal in favor of _cacheClub
    • introduced clubFromCacheById and cacheClubList methods for direct cache access
    • replaced local cache updates to use _cacheClub consistently in add/update flows
    • simplified cache deserialization to drop Schedule.fromString
  • lib/data/repositories/clubs/i_club_repository.dart
    • added cacheClubList and clubFromCacheById to the interface
  • lib/data/repositories/functions/functions_repository.dart
    • created LastSearched value type to track last location/radius
    • cached recent search results and short-circuited identical requests
  • lib/data/services/functions/functions_service.dart
    • switched to accept CoordLocation instead of raw latitude/longitude
    • fixed column naming for location WKB-to-WKT conversion
  • lib/data/services/functions/i_functions_service.dart
    • updated method signature to require CoordLocation
  • lib/data/services/geolocator/geolocator_service.dart
    • changed currentPosition to return CoordLocation instead of Position
  • lib/data/services/geolocator/i_geolocator_service.dart
    • updated interface to reflect CoordLocation return type
  • lib/domain/models/club.dart
    • removed scheduleString field and legacy parsing logic
    • adjusted toMap/fromMap to use JSON-serialized schedule
  • lib/domain/models/coord_location.dart
    • added model for geographic coordinates with copyWith
  • lib/domain/models/schedule.dart
    • eliminated fromString factory and obsolete code
    • retained toJson/fromJson for schedule serialization
  • lib/domain/use_cases/fav_club_user_case.dart
    • dropped schedule repository dependency and related calls
    • added _nearbyClubIds tracking and nearbyClubs getter
    • invoked cacheClubList and populated _nearbyClubIds after fetch
  • lib/routing/router.dart
    • removed unused scheduleRepository injection
  • lib/ui/view/clubs/register_club/register_club_view.dart
    • removed obsolete scheduleString assignment when registering a club
  • lib/ui/view/home/fav_clubs/fav_clubs_view.dart
    • bound view to new nearbyClubs and fetch listeners via _viewModel
    • replaced manual list rendering with ListenableBuilder and empty-state message
    • factored out distance selection logic into _favClubsNearby method
  • lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
    • exposed nearbyClubs getter from user case
  • test/domain/models/club_test.dart
    • updated test to include Thursday in Schedule and verify JSON round-trip
  • test/domain/models/schedule_test.dart
    • commented out obsolete fromString tests

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_string column to schedule in public.clubs
  • supabase/migrations/20250611204108_update_clubs_function_update.sql rebuilds get_clubs_within_radius function to return schedule and 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/... to lib/ui/view/... for FavClubsViewModel, club pages, registration, sign-in/up, splash, address, billinginfo, and home views.
    • Updated builder closures to instantiate *View classes instead of the old *Page widgets.

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 children list to instantiate FavClubsView with the existing viewModel, replacing FavClubsPage

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 Schedule and, when loading from cache, used each club’s scheduleString to rebuild its Schedule via Schedule.fromString.
  • lib/data/repositories/schedule/schedule_repository.dart
    • Removed all local-device caching logic (_loadLocal_loadRemote_saveCache) and now always returns Result.voidSuccess from initialize.
  • lib/domain/enums/enums_declarations.dart
    • Added FavClubsPageEnum with labels for myClubsnearby, and selected.
  • lib/domain/models/club.dart
    • Added nullable scheduleString property; updated constructors, toMap, and fromMap to serialize/deserialize schedule_string and fallback to Schedule.fromString when needed.
  • lib/domain/models/operating_day.dart
    • Introduced OperatingDay.fromHHMMRange(weekday, range) to parse a "08:00 às 18:00" string into an OperatingDay.
  • lib/domain/models/schedule.dart
    • Added Schedule.fromString(str) factory to parse a comma-separated “Day: HH:MM às HH:MM” string into a Schedule object.
  • lib/domain/use_cases/club_user_case.dart
    • Modified fetchClubWithSchedule flow: only fetches schedule from repository if club.schedule == null, then merges it via copyWith.
  • lib/ui/pages/clubs/register_club/register_club_page.dart
    • Assigned _scheduleController.text to scheduleString when constructing a new Club.
  • lib/ui/pages/home/fav_clubs/fav_clubs_page.dart
    • Replaced static text with a SelectionFavClubs widget and conditional buttons for each FavClubsPageEnum mode; toggles showBaseButton and invokes the appropriate command.

New Files

  • lib/ui/pages/home/fav_clubs/widgets/selection_fav_clubs.dart Implements a SegmentedButton control bound to FavClubsPageEnum and notifies the parent when the user switches tabs.
  • supabase/migrations/20250610180909_update_clubs_table2.sql Adds schedule_string TEXT to public.clubs if it doesn’t exist.
  • test/domain/models/schedule_test.dart New unit test verifying that Schedule.toString() and Schedule.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() to currentPosition() for more reliable coordinates.
  • lib/data/services/database_service/database_service.dart
    • Imported the new wkbToWkt function from commom/functions.dart.
    • Replaced the in-class _wkbToWkt implementation with calls to wkbToWkt.
  • lib/data/services/functions/functions_service.dart
    • Imported wkbToWkt and ClubsTableColumns.location for consistent column referencing.
    • Transformed each club’s WKB location via wkbToWkt before mapping to Club.
  • lib/domain/models/coord_location.dart
    • Swapped the order in toPointString and fromPointString so that longitude is X and latitude is Y, matching WKT conventions.
  • 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 CoordLocation to use the absolute URI.

New Files

  • lib/data/services/commom/functions.dart Implements wkbToWkt(String), converting PostGIS WKB hex to a POINT(x y) WKT with endian, SRID, and type checks.
  • test/domain/models/coord_location_test.dart Unit test verifying that CoordLocation.toPointString() and fromPointString() 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_LOCATION and ACCESS_COARSE_LOCATION permissions 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 IGeolocatorService interface 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 fullAddress getter to include complement conditionally.
  • lib/domain/models/club.dart Added nullable addressString property; updated constructors, toMap, and fromMap to handle address_string; replaced old Location with CoordLocation.
  • lib/domain/models/coord_location.dart Renamed from location.dart; updated class name, factory constructors, JSON methods, and equality to CoordLocation.
  • lib/domain/use_cases/club_user_case.dart Injected IGeocodingRepository, added getCoordinatesFromAddress method, and wired it into club creation/update flows.
  • lib/domain/use_cases/fav_club_user_case.dart Injected IFunctionsRepository and exposed fetchNearbyClubs to user case.
  • lib/routing/router.dart Passed new geocodingRepository and functionsRepository into view models for relevant routes.
  • lib/ui/pages/clubs/clubs_view_model.dart Renamed internal field to _clubUserCase and updated all method calls accordingly.
  • lib/ui/pages/clubs/register_club/register_club_page.dart Changed _onSavePressed to async, set addressString and placeholder CoordLocation initially.
  • lib/ui/pages/clubs/register_club/register_club_view_model.dart Renamed to use _clubUserCase; added _updateCoordLocation helper 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 fetchNearbyClubs command 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.0 and crypto:^3.0.6; updated lockfile entries accordingly.

New Files

  • lib/data/repositories/geocoding/geocoding_repository.dart Implements IGeocodingRepository with MD5-based keying, two-layer cache (in-memory LRU capped at 20 and persistent), and fallback to IGeocodingService.
  • lib/data/repositories/geocoding/i_geocoding_repository.dart Defines the geocoding repository interface.
  • lib/data/services/geocoding/geocoding_service.dart Uses the geocoding package to resolve addresses into CoordLocation.
  • 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 TEXT in public.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.Properties and java.io.FileInputStream to load keystore properties from key.properties.
    • Created a keystorePropertiesFile and initialized a Properties instance to read keyAliaskeyPasswordstoreFile, and storePassword.
    • Added a signingConfigs block for “release” build that references values from the loaded Properties.
    • Defined debug and release buildTypes, assigning the appropriate signing configurations and enabling code minification and resource shrinking in the release build.
  • lib/data/repositories/address/address_repository.dart
    • Renamed _fetchAllFromLocal to _loadAllLocal and updated logic to always clear _addresses before loading.
    • Adjusted cache key handling: replaced retrieval of IDs with getKeysStartsWith, stripping the prefix when mapping entries.
    • Renamed _fetchAllFromDatabase to _loadAllDatabase and updated the call site in initialize.
    • Moved _cacheKey helper above _userId declaration for consistent ordering and removed redundant blank line.
  • lib/data/repositories/billinginfo/billinginfo_repository.dart
    • Corrected logger instantiation from Logger('RemoteProfileRepository') to Logger('BillingInfoRepository').
    • Enhanced initialize to call fetch(userId), then log success or warning depending on Result outcome, while still returning the Result.
  • lib/data/repositories/clubs/club_repository.dart
    • Moved the _cacheKey helper into the class body below the getters section.
    • Refactored _loadAllLocal to always clear _clubs before loading.
    • Replaced use of ids with keys from getKeysStartsWith, and strip the prefix when mapping entries.
    • Updated return value of _loadAllLocal to resultSuccess instead of constructing a new Result.success(null).
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Imported enums_declarations.dart to reference UserRole.
    • Renamed parameter person to user for consistency with UserInfo usage.
    • Updated MainDrawerHeader instantiation to pass user instead of person.
    • 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.
  • lib/ui/pages/address/address_page.dart
    • Corrected import path for show_simple_message.dart to use absolute URI (/ui/core/ui/messages/show_simple_message.dart).
    • Introduced a local List<Address> addresses field and assigned _viewModel.addresses to it before building the ListView.
  • lib/ui/pages/home/home_page.dart
    • Updated MainDrawer instantiation: replaced person: _viewModel.userInfo with user: _viewModel.userInfo to match renamed parameter.

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.
  • lib/data/repositories/auth/i_auth_repository.dart
    • Changed import 'package:sports/data/services/auth_service/i_auth_service.dart'; to import '/data/services/auth_service/i_auth_service.dart';.
  • lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
    • Changed import 'package:sports/utils/result.dart'; to import '/utils/result.dart';.
  • lib/data/repositories/viacep/i_viacep_repository.dart
    • Changed import 'package:sports/domain/models/viacep_address.dart'; and import 'package:sports/utils/result.dart'; to leading‐slash imports.
  • lib/data/services/auth_service/auth_service.dart
    • Normalized i_auth_service.dart import to import '/data/services/auth_service/i_auth_service.dart';.
  • lib/data/services/cache_database_service/i_cache_service.dart
    • Changed import 'package:sports/utils/result.dart'; to import '/utils/result.dart';.
  • lib/data/services/database_service/i_database_service.dart
    • Changed import 'package:sports/utils/result.dart'; to import '/utils/result.dart';.
  • lib/data/services/storage_service/i_storage_service.dart
    • Changed import 'package:sports/utils/result.dart'; to import '/utils/result.dart';.
  • lib/domain/enums/enums_sports.dart
    • Renamed enum value beachVolleybal to beachVolleyball.
  • lib/domain/enums/enums_sports_positions.dart
    • Updated the Sports.beachVoltagebal key to Sports.beachVolleyball so position mapping matches the corrected enum.
  • lib/domain/models/affiliate.dart
    • Adjusted the type‐mismatch check from (sport == Sports.beachVolleybal ...) to (sport == Sports.beachVolleyball ...).
  • lib/domain/models/fav_club.dart
    • Changed import of date_time_extensions.dart to import '/utils/extensions/date_time_extensions.dart';.
  • lib/domain/models/user_info.dart
    • Normalized enums_sports.dart import to import '/domain/enums/enums_sports.dart';.
    • Removed an extra blank line between imports.
  • lib/routing/app_extra_codec.dart
    • Reordered imports: moved import '/domain/models/address.dart'; before enums_declarations.dart, using leading‐slash paths.
  • lib/routing/router.dart
    • Normalized all imports to leading‐slash style (e.g. /data/repositories/... and /ui/pages/...).
  • lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
    • Changed package: imports to import '/domain/models/club.dart'; and import '/ui/core/ui/...'; using leading‐slash.
  • lib/ui/pages/home/home_page.dart
    • Added import '/ui/core/theme/dimens.dart';.
    • Wrapped the IndexedStack in Padding(padding: EdgeInsets.all(dimens.paddingScreenAll), ...).
    • Normalized FavClubsPage import to import 'fav_clubs/fav_clubs_page.dart';.
  • lib/ui/pages/sign_in/sign_in_page.dart
    • Changed import of botton_sheet_message.dart to import '/ui/core/ui/messages/botton_sheet_message.dart';.
  • lib/ui/pages/sign_in/sign_in_view_model.dart
    • Changed import 'package:sports/utils/result.dart'; to import '/utils/result.dart';.
  • lib/ui/pages/user_register/user_resister_page.dart
    • Added _viewModel.update.addListener(_onSaved); in initState().
    • Removed the corresponding listener in dispose()_viewModel.update.removeListener(_onSaved);.

New Files

  • lib/ui/pages/home/fav_clubs/fav_clubs_page.dart A new StatefulWidget FavClubsPage with a FavClubsViewmodel parameter. It builds a simple ListView of allClubs with Card/ListTile, displaying each club’s namedescription, and logo.

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.dart in 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.dart and fav_clubs_repository.dart.
    • Registered Provider<IFavClubsRepository> so that FavClubsRepository is injected with ICacheService and IDatabaseService.
  • lib/data/repositories/clubs/club_repository.dart
    • Replaced local variable name c with club in the myClubs getter for clarity.
  • lib/data/repositories/common/server_names.dart
    • Added a new FavClubsTableColumns class with constants for user_idclub_id, and created_at.
  • lib/data/repositories/fav_clubs/fav_clubs_repository.dart
    • Changed constructor parameters to use interfaces (ICacheService and IDatabaseService) instead of concrete service types.
    • Updated delete and fetchAll query conditions to use the new FavClubsTableColumns.clubId and FavClubsTableColumns.userId constants.
    • No change to overall logic; still adds/removes favorite-club rows and updates local cache.
  • lib/domain/models/fav_club.dart
    • Added a new createdAt field (defaulting to DateTime.now()) and updated copyWith.
    • Changed the toMap method to emit snake_case keys (user_idclub_idcreated_at).
    • Updated fromMap to read from those snake_case keys and parse created_at via DateTimeExtensions.fromMap.
  • lib/domain/use_cases/account_management_user_case.dart
    • Adjusted import paths to use leading-slash style (/data/repositories/...) consistently with the project.
  • lib/domain/use_cases/fav_club_user_case.dart
    • Removed the old clubsList getter and replaced it with two new getters: allClubs (all clubs) and otherClubs (clubs not managed by the current user).
    • In load, first fetch all favorite-club IDs from IFavClubsRepository. Then for each ID, call fetchClub(clubId) to load club details and schedule.
    • In fetchClub, after retrieving the Club and its Schedule, call IFavClubsRepository.add(clubId) to insert into the favorites table. Errors bubble up as needed.
  • lib/routing/router.dart
    • Imported i_fav_clubs_repository.dartfav_club_user_case.dart, and favorite_clubs_viewmodel.dart.
    • Renamed the route for managing a club: ManageClubPage → ManagerClubPage and updated its view-model import.
    • In the home route, added a FavClubsViewmodel to the HomePage constructor under a new favClubsViewModel parameter.
    • Renamed the “Manage Club” page component folder to manager_club and updated references.
  • 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 ManageClubPage to ManagerClubPage.
    • Updated constructor signature and createState() return type accordingly.
    • Adjusted state class from _ManageClubPageState to _ManagerClubPageState.
  • lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
    • Deleted (renamed functionality moved to manager_club/manager_club_view_model.dart).
  • lib/ui/pages/clubs/manager_club/manager_club_view_model.dart
    • New empty ManagerClubViewModel class to pair with the renamed “Manager” page.
  • lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
    • Renamed widget class from ClubsPage to FavClubsPage.
    • Added a FavClubsViewmodel viewModel constructor parameter and updated createState() to _FavClubsPageState.
  • lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
    • Renamed from FavoriteClubsViewmodel to FavClubsViewmodel.
    • Injected FavClubUserCase and wired Command0<void> load and Command1<Club?, String> fetchClub.
    • Exposed getters allClubs and otherClubs from the use case.
  • lib/ui/pages/home/home_page.dart
    • Added a new FavClubsViewmodel favClubsViewModel parameter to HomePage.
    • Replaced the previous ClubsPage tab (at index 1) with FavClubsPage(viewModel: widget.favClubsViewModel).
  • 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.

New Files

  • lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart Defines the IFavClubsRepository interface 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 IViaCepRepository with: • 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 calling IViaCepService when 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 ManagerClubViewModel class to pair with the renamed page.
  • supabase/migrations/20250605170147_create_fav_clubs.sql SQL migration to create the fav_clubs table 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.dartviacep_service.darti_viacep_repository.dart, and viacep_repository.dart.
    • Changed provider registration from Provider<ViaCepService> to Provider<IViaCepService>.
    • Added Provider<IViaCepRepository> binding that creates ViaCepRepository using IViaCepService.
  • lib/data/services/viacep_service/viacep_service.dart
    • Updated class signature to ViaCepService implements IViaCepService.
    • Added @override annotation on getLocationByCEP method to satisfy interface contract.
    • No change in internal logic—still performs HTTP lookup and parsing.
  • lib/domain/use_cases/address_user_user_case.dart
    • Changed constructor to depend on IViaCepRepository instead of ViaCepService.
    • Updated getLocationByCEP to call _viaCepRepository.getLocationByCEP(cep).
  • lib/domain/use_cases/fav_club_user_case.dart
    • Adjusted import paths to use leading slash style (/data/repositories/...) consistently with project conventions.
  • lib/routing/router.dart
    • Imported i_viacep_repository.dart so routing can access the repository.
    • Changed address route builders to call context.read<IViaCepRepository>() rather than ViaCepService.
  • pubspec.yaml
    • Bumped version from 0.22.04+71 to 0.22.04+72.

New Files

  • lib/data/repositories/viacep/i_viacep_repository.dart Defines IViaCepRepository interface with:
    • List<ViaCepAddress> get ceps to 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 IViaCepService to perform actual HTTP calls.
    • Caches results in a Map<String, ViaCepAddress> _cepCache.
    • Returns cached result if available; otherwise calls the service, caches, and returns.
  • lib/data/services/viacep_service/i_viacep_service.dart Defines IViaCepService interface 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.dart interface files instead of remote_* or concrete class names.
    • Changed provider bindings to use I*Repository types and new implementation class names without “Remote”.
  • lib/data/repositories/address/remote_address_repository.dart → lib/data/repositories/address/address_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteAddressRepository to AddressRepository.
    • Updated imports and implements clause to use IAddressRepository.
  • lib/data/repositories/address/address_repository.dart
    • (Previously remote_address_repository.dart) Implementation unchanged other than renaming.
  • lib/data/repositories/address/i_address_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IAddressRepository.
  • lib/data/repositories/auth/remote_auth_repository.dart → lib/data/repositories/auth/auth_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteAuthRepository to AuthRepository.
    • Updated imports and implements to use IAuthRepository.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Changed implements RemoteAuthRepository to implements IAuthRepository.
  • lib/data/repositories/auth/i_auth_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IAuthRepository.
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart → lib/data/repositories/billinginfo/billinginfo_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteBillingInfoRepository to BillingInfoRepository.
    • Updated imports and implements to use IBillingInfoRepository.
  • lib/data/repositories/billinginfo/i_billinginfo_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IBillingInfoRepository.
  • lib/data/repositories/clubs/remote_club_repository.dart → lib/data/repositories/clubs/club_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteClubRepository to ClubRepository.
    • Updated imports and implements to use IClubRepository.
  • lib/data/repositories/clubs/i_club_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IClubRepository.
  • 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 RemoteFavClubsRepository to FavClubsRepository.
    • Updated imports and implements to use IFavClubsRepository.
  • lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IFavClubsRepository.
  • lib/data/repositories/schedule/remote_schedule_repository.dart → lib/data/repositories/schedule/schedule_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteScheduleRepository to ScheduleRepository.
    • Updated imports and implements to use IScheduleRepository.
  • lib/data/repositories/schedule/i_schedule_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IScheduleRepository.
  • lib/data/repositories/storage/remote_storage_repository.dart → lib/data/repositories/storage/storage_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteStorageRepository to StorageRepository.
    • Updated imports and implements to use IStorageRepository.
  • lib/data/repositories/storage/i_storage_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IStorageRepository.
  • lib/data/repositories/user/remote_user_repository.dart → lib/data/repositories/user/user_repository.dart
    • Removed remote_ prefix from filename.
    • Renamed class from RemoteUserRepository to UserRepository.
    • Updated imports and implements to use IUserRepository.
  • lib/data/repositories/user/i_user_repository.dart
    • New interface file (added i_ prefix).
    • Interface renamed to IUserRepository.
  • lib/domain/use_cases/account_management_user_case.dart
    • Changed constructor types from concrete classes (AuthRepositoryUserRepositoryStorageRepository) to interfaces (IAuthRepositoryIUserRepositoryIStorageRepository).
  • lib/domain/use_cases/address_user_user_case.dart
    • Changed constructor parameter from AddressRepository to IAddressRepository.
  • lib/domain/use_cases/billinginfo_user_case.dart
    • Changed constructor parameters from AddressRepository and BillingInfoRepository to IAddressRepository and IBillingInfoRepository.
  • lib/domain/use_cases/club_user_case.dart
    • Changed constructor parameters from concrete repositories to their interface types (IAddressRepositoryIClubRepositoryIStorageRepositoryIScheduleRepository).
  • lib/domain/use_cases/fav_club_user_case.dart
    • Changed constructor parameters from concrete repositories to their interface types (IAddressRepositoryIFavClubsRepositoryIClubRepositoryIScheduleRepository).
  • lib/routing/router.dart
    • Updated all context.read<…>() calls: replaced concrete repository types (e.g. AuthRepositoryUserRepository, etc.) with interface types (IAuthRepositoryIUserRepository, etc.).
    • Adjusted use-case instantiations to pass interfaces instead of concrete classes.
  • lib/ui/pages/splash/splash_view_model.dart
    • Updated constructor’s dependency from AuthRepository to IAuthRepository.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Changed import from remote_address_repository.dart to address_repository.dart.
    • Updated test instantiation from RemoteAddressRepository to AddressRepository.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Changed import from remote_auth_repository.dart to auth_repository.dart.
    • Updated test instantiation from RemoteAuthRepository to AuthRepository.
  • test/data/repositories/clubs/remote_club_repository_test.dart
    • Changed imports:
      • From remote_address_repository.dart to address_repository.dart
      • From remote_club_repository.dart to club_repository.dart
      • From remote_user_repository.dart to user_repository.dart
    • Updated instantiations accordingly: RemoteClubRepository → ClubRepositoryRemoteUserRepository → UserRepositoryRemoteAddressRepository → AddressRepository.
  • 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
    • Updated instantiations: RemoteScheduleRepository → ScheduleRepositoryRemoteClubRepository → ClubRepository, etc.
  • test/data/repositories/storage/remote_storage_repository_test.dart
    • Changed import from remote_storage_repository.dart to storage_repository.dart.
    • Updated test instantiation from RemoteStorageRepository to StorageRepository.
  • test/data/repositories/user/remote_user_repository_test.dart
    • Changed import from remote_user_repository.dart to user_repository.dart.
    • Updated test instantiation from RemoteUserRepository to UserRepository.
  • test/domain/use_cases/address_club_user_case_test.dart
    • Updated imports:
      • remote_address_repository.dart → address_repository.dart
      • remote_club_repository.dart → club_repository.dart
      • remote_schedule_repository.dart → schedule_repository.dart
      • remote_storage_repository.dart → storage_repository.dart
      • remote_user_repository.dart → user_repository.dart
    • Adjusted instantiations to use new implementation names without Remote.

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.
  • doc/diagrama de classes Sports.drawio
    • Updated <diagram> metadata to reflect the current draw.io version and internal JSON changes.
  • lib/config/dependencies.dart
    • Added import for IStorageService and adjusted import paths to use absolute references (/data/services/...) for consistency.
    • Changed Provider<StorageService> to Provider<IStorageService> so that the RemoteStorageRepository is constructed from the interface.
    • Updated Provider<StorageRepository> to read from IStorageService instead of the concrete StorageService.
  • lib/data/repositories/fav_clubs/fav_clubs_repository.dart
    • Renamed the getter from favClubs to favClubIds to better reflect that it holds a set of IDs.
    • Expanded interface with initializeadddelete, and fetchAll methods, adding detailed documentation for each.
    • Removed the old “get-only” interface and replaced it with a fully documented CRUD-like API for favorite clubs.
  • lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
    • Updated the internal set from _favClubs to _favClubIds to match the renamed getter.
    • Changed repository constructor to import from absolute paths.
    • Modified adddelete, and fetchAll methods to operate on _favClubIds instead of the old field, adding guard clauses to return early if the ID is already present/absent.
    • Refactored local cache updates in _updateLocalCache to use Tables.favClubs and the new _favClubIds list.
  • lib/data/repositories/storage/remote_storage_repository.dart
    • Changed the constructor parameter from the concrete StorageService to the interface IStorageService.
    • Updated import to use i_storage_service.dart so that all storage operations go through the interface.
  • lib/data/services/storage_service/remote_storage_service.dart → lib/data/services/storage_service/storage_service.dart
    • Renamed RemoteStorageService to StorageService and moved under storage_service/.
    • Added implements IStorageService and annotated all methods (createBucketdeleteBucketaddupdatedelete) 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).
  • lib/domain/use_cases/address_billinginfo_user_case.dart → lib/domain/use_cases/billinginfo_user_case.dart
    • Renamed class from AddressBillingInfoUserCase to BillingInfoUserCase and updated constructor accordingly.
    • Changed file name and import references in router.dart and billinginfo_view_model.dart to use BillingInfoUserCase.
  • lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/club_user_case.dart
    • Renamed class from AddressClubUserCase to ClubUserCase and updated constructor and method calls.
    • Changed file name and updated all import references (in router.dartclubs_view_model.dart, and register_club_view_model.dart) to use the new ClubUserCase.
  • 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.
  • lib/main_app.dart
    • Updated import for ThemeUserCase from a relative path to domain/use_cases/theme_user_case.dart.
  • lib/routing/router.dart
    • Updated all imports of use cases to reflect their renamed paths (club_user_case.dart and billinginfo_user_case.dart).
    • Adjusted the construction of view models to use ClubUserCase and BillingInfoUserCase instead of the old classes.
  • lib/ui/pages/billinginfo/billinginfo_view_model.dart
    • Changed injection from AddressBillingInfoUserCase to BillingInfoUserCase and updated the import accordingly.
  • lib/ui/pages/clubs/clubs_view_model.dart
    • Replaced AddressClubUserCase with ClubUserCase in both the constructor and the import statement.
  • lib/ui/pages/clubs/register_club/register_club_view_model.dart
    • Updated import and constructor parameter from AddressClubUserCase to ClubUserCase.
  • lib/ui/pages/home/home_view_model.dart
    • Adjusted import path for ThemeUserCase to use a relative path under domain/use_cases.
  • test/data/repositories/storage/remote_storage_repository_test.dart
    • Updated import from remote_storage_service.dart to storage_service.dart so the test uses the new StorageService.
    • Ensured RemoteStorageRepository is constructed with StorageService through the IStorageService interface.
  • test/data/services/remote_storage_service_test.dart
    • Changed import of remote_storage_service.dart to storage_service.dart so tests reference the renamed class.
  • test/domain/use_cases/address_club_user_case_test.dart
    • Updated import from address_club_user_case.dart to club_user_case.dart.
    • Changed the instantiation from AddressClubUserCase to ClubUserCase.
    • Updated import for StorageService instead of remote_storage_service.dart.

New Files

  • lib/data/services/storage_service/i_storage_service.dart Defines the IStorageService interface with methods for creating/deleting buckets and uploading, updating, or deleting files. Each method returns a Result<T> to indicate success or failure, and method signatures (e.g., createBucketaddupdatedelete) include parameter documentation for error handling.
  • lib/domain/use_cases/fav_club_user_case.dart Introduces the FavClubUserCase class, which orchestrates the favorite clubs flow by:
    1. Initializing address, club, schedule, and favorite-clubs repositories for the given userId.
    2. Fetching all favorite clubs into local cache.
    3. Providing methods (loadfetchClub) to load favorite clubs and fetch a single club with its schedule.
    4. Uses Logger to emit fine-grained logs.

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 (IAuthServiceICacheServiceIDatabaseService), 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 mxGraphModel attributes (dxdy) to reflect updated drawing dimensions.
  • lib/config/dependencies.dart
    • Switched Provider<CacheDatabaseService> to Provider<ICacheService> and created CacheService implementation.
    • Changed Provider<AuthService> to Provider<IAuthService>.
    • Updated Provider<DatabaseService> to Provider<IDatabaseService>.
    • Updated constructor parameters for all repositories to read from interfaces instead of concrete services.
    • Fixed import paths for all relocated services (auth_servicecache_database_servicedatabase_servicestorage_serviceviacep_service).
  • lib/data/repositories/address/remote_address_repository.dart
    • Replaced CacheDatabaseService and DatabaseService fields with ICacheService and IDatabaseService.
    • Updated constructor to accept interface types.
  • lib/data/repositories/auth/auth_repository.dart
    • Imported IAuthService instead of AuthService.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Updated _authService type to IAuthService.
    • Adjusted getter to return IAuthService.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Changed _authService to IAuthService and _cacheService to CacheService?.
    • Updated constructor signature to accept IAuthService and CacheService.
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
    • Changed CacheDatabaseService and DatabaseService fields to ICacheService and IDatabaseService.
    • Updated constructor accordingly.
  • lib/data/repositories/clubs/club_repository.dart
    • Renamed clubList getter to allClubs and added myClubs getter.
    • Added new abstract methods: initializelogoutfetchAllfetch(id)addupdatedelete with detailed documentation in the interface.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Changed _cacheService and _databaseService fields to ICacheService and IDatabaseService.
    • Added implementation of myClubs and allClubs getters.
    • Updated delete logic to check ownership before deleting from database.
  • lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
    • Switched CacheDatabaseService to CacheService.
    • Changed DatabaseService to use direct class rather than interface (repository still references concrete type).
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Updated _cacheService and _databaseService fields to ICacheService and IDatabaseService.
    • Updated constructor signature accordingly.
  • lib/data/repositories/storage/remote_storage_repository.dart
    • Fixed import path for RemoteStorageService after relocating under storage_service folder.
  • lib/data/repositories/user/remote_user_repository.dart
    • Changed _localService and _databaseService to use ICacheService and IDatabaseService.
    • Adjusted import paths accordingly.
  • lib/data/services/auth_service/auth_service.dart
    • Moved AuthService into its own folder under data/services/auth_service.
    • Implemented IAuthService interface and annotated all service methods with @override.
    • Removed old enum AuthEvent and redefined it in i_auth_service.dart.
    • Simplified documentation by removing redundant comments in method implementations.
  • lib/data/services/cache_database_service/cache_service.dart
    • Renamed CacheDatabaseService to CacheService and implemented ICacheService.
    • Updated all method signatures to @override.
  • lib/data/services/viacep_service/viacep_service.dart
    • Kept content intact but updated file location under viacep_service folder.
  • lib/data/services/database_service/database_service.dart
    • Renamed RemoteDatabaseService to DatabaseService under database_service.
    • Implemented IDatabaseService interface and added @override annotations to all CRUD methods.
  • lib/data/services/storage_service/remote_storage_service.dart
    • Moved RemoteStorageService under storage_service folder without modifying logic.
  • lib/domain/use_cases/address_club_user_case.dart
    • Changed clubList reference to myClubs to reflect new interface in ClubRepository.
  • lib/domain/use_cases/address_user_user_case.dart
    • Updated import path for ViaCepService after relocating under viacep_service folder.
  • lib/domain/use_cases/theme_user_case.dart
    • Changed injection parameter from CacheDatabaseService to ICacheService.
  • lib/main.dart
    • Updated import for AuthService to new location under auth_service/auth_service.dart.
  • lib/routing/router.dart
    • Fixed all imports to use absolute paths (/ui/pages/...) instead of relative paths.
    • Updated import for ViaCepService to new path under viacep_service.
  • lib/ui/pages/home/home_page.dart
    • Changed context.read<CacheDatabaseService>() to context.read<CacheService>().
    • Updated import path for CacheService.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Updated imports to use AuthService from auth_service/auth_service.dartCacheService, and DatabaseService.
    • Renamed cache variable type from CacheDatabaseService to CacheService.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Updated import for AuthService to new location.
  • test/data/repositories/clubs/remote_club_repository_test.dart
    • Updated imports for AuthServiceCacheService, and DatabaseService.
    • Renamed cache variable type.
  • test/data/repositories/schedule/remote_schedule_repository_test.dart
    • Updated imports and cache variable type in setup.
  • test/data/repositories/storage/remote_storage_repository_test.dart
    • Adjusted imports to use AuthService and RemoteStorageService from new paths.
  • test/data/repositories/user/remote_user_repository_test.dart
    • Updated imports to use AuthServiceDatabaseService, and CacheService.
    • Changed FakeCache to implement CacheService instead of CacheDatabaseService.
  • test/data/services/remote_storage_service_test.dart
    • Updated imports to point to relocated AuthService and RemoteStorageService.
  • test/data/services/shared_preferences_service_test.dart
    • Renamed CacheDatabaseService to CacheService in imports and setup.
  • test/data/services/supabase_auth_service_test.dart
    • Changed import for AuthService to new path.
  • test/data/services/viacep_service_test.dart
    • Updated import path for ViaCepService.
  • test/domain/use_cases/address_club_user_case_test.dart
    • Updated imports for AuthServiceCacheServiceDatabaseService, and RemoteStorageService.
    • Renamed cache variable type.

New Files

  • lib/data/services/auth_service/i_auth_service.dart Defines the IAuthService interface with all authentication-related methods (signUpsignInsignOutfetchUsersendPasswordRecoveryresendConfirmationEmailupdatePasswordupdateUserPhone) and the AuthEvent enum.
  • lib/data/services/cache_database_service/i_cache_service.dart Declares the ICacheService interface for shared preferences operations (getKeysStartsWithsetStringsetStringListgetStringgetStringListremoveclear).
  • lib/data/services/database_service/i_database_service.dart Introduces the IDatabaseService interface for generic CRUD operations (fetchfetchListaddupdatedeletebulkDelete) 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 (dx and dy) to accommodate recent additions in the class diagram.
  • lib/data/repositories/address/remote_address_repository.dart
    • Changed addupdate, and delete calls on _databaseService to pass the data: or id: named parameters instead of positional arguments.
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
    • Updated _databaseService.add and _databaseService.update calls to use data: named parameter.
    • Changed delete invocation to use id: named parameter.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Refactored _databaseService.add and _databaseService.update to accept data: named argument.
    • Modified delete to use id: named parameter.
  • lib/data/repositories/common/server_names.dart
    • Added a new table name constant favClubs to support favorite clubs storage.
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Updated batch insert in add: each call to _databaseService.add now uses data: named parameter.
    • Changed bulkDelete to use conditions: named argument.
  • lib/data/repositories/user/remote_user_repository.dart
    • Standardized calls to _databaseService.addupdate, and delete with named data: and id: parameters.
  • lib/data/services/cache_database_service.dart
    • Introduced setStringList(String key, List<String>) to save a list of strings in shared preferences, returning a Result<void>.
    • Added getStringList(String key) to retrieve a List<String>? from shared preferences, wrapped in a Result<List<String>?>.
  • lib/data/services/remote_database_service.dart
    • Refactored addupdatedelete, and bulkDelete methods to accept named parameters (data: or id:conditions:) instead of positional arguments.
  • lib/domain/models/affiliate.dart
    • Extended the isMismatch logic to include additional sports (handballfootvolleybeachVolleybal) in the position-type validation.
  • lib/routing/router.dart
    • Changed import paths for club registration views from club_register to register_club.
    • Renamed ClubRegisterPage → RegisterClubPage and ClubRegisterViewModel → RegisterClubViewModel in the club-register route.
    • Updated the schedule widget import path under register_club/widgets.
  • lib/ui/pages/clubs/clubs_page.dart
    • Adjusted the import for DismissibleClubCard to use the new register_club/widgets location.
  • lib/ui/pages/clubs/manage_club/manage_club_page.dart
    • Modified imports to use absolute project paths.
    • Enhanced the page body to display a Card outlining 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 Column that includes explanatory text about favorite clubs and a wrapped ListView.builder.
  • lib/ui/pages/home/home_page.dart
    • Imported the new FavoriteClubsViewmodel.
    • No functional changes here beyond imports.
  • test/data/repositories/user/remote_user_repository_test.dart
    • Updated the FakeCache stub to include getStringList and setStringList overrides that currently throw UnimplementedError.

New Files

  • doc/MVVM.svg
    • Added an SVG illustrating the MVVM architecture for the application.
  • lib/domain/models/fav_club.dart
    • Introduced FavClub model with userId and clubId fields, along with toMap/fromMap for serialization.
  • lib/data/repositories/fav_clubs/fav_clubs_repository.dart
    • Defined FavClubsRepository interface with methods: favClubsinitializeadddelete, and fetchAll.
  • lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
    • Implemented RemoteFavClubsRepository to 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.
  • lib/ui/pages/clubs/register_club/register_club_page.dart
    • Added RegisterClubPage (renamed from ClubRegisterPage) that accepts an optional Club? and a RegisterClubViewModel.
  • lib/ui/pages/clubs/register_club/register_club_view_model.dart
    • Introduced RegisterClubViewModel (formerly ClubRegisterViewModel) handling load and addClub commands via AddressClubUserCase.
  • lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
    • Moved/renamed DismissibleClubCard into register_club/widgets, unchanged in logic.
  • lib/ui/pages/clubs/register_club/widgets/schedule_page.dart
    • Relocated SchedulePage under register_club/widgets without modification of contents.
  • lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
    • Added an empty FavoriteClubsViewmodel as a placeholder for future favorite-clubs logic.

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> dx and dy attributes to 1468 and 947 respectively, reflecting updated canvas dimensions.
  • 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.
  • lib/routing/router.dart
    • Replaced imports of club_manager pages with new clubs page classes:
      • Changed ClubManagerPage → ClubsPage and ClubManagerViewModel → ClubsViewModel.
      • Updated import paths for club_register and clubs_page under ui/pages/clubs.
    • Introduced a new route Routes.manageClub with path /manage_club, mapping to ManageClubPage and passing a Club object via extra.
    • Removed unused club_search routes and replaced bindings to ClubManager classes with the new clubs equivalents.
  • lib/routing/routes.dart
    • Added a new route constant manageClub = Route('manageClub', '/manage_club') at the end of the file.
  • 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 onTap callback to call the updated clubs handler.
  • 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_message to show_simple_message.
    • Changed the named parameter iconData to iconTitle throughout.
  • lib/ui/pages/address/address_page.dart
    • Updated import to show_simple_message.dart instead of the old filename.
    • Replaced iconData: usages with iconTitle: in all calls to showSimpleMessage.
  • 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.
  • 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_register folder. No code modifications.
  • lib/ui/pages/club_manager/club_register/widgets/schedule_page.dart → lib/ui/pages/clubs/club_register/widgets/schedule_page.dart
    • Moved schedule_page.dart into the clubs/club_register/widgets folder. Path only; content unchanged.
  • lib/ui/pages/club_manager/club_manager_page.dart → lib/ui/pages/clubs/clubs_page.dart
    • Renamed the page from ClubManagerPage to ClubsPage.
    • Replaced all references to ClubManagerViewModel with ClubsViewModel.
    • Removed inline Dismissible logic and replaced it with a DismissibleClubCard widget.
    • Updated routing callbacks:
      • Changed _navEditClub to push Routes.clubRegister.
      • Added _navManagerClub to push Routes.manageClub with a Club instance.
    • Replaced hardcoded “Editar”/“Remover” dismiss backgrounds with the new DismissibleClubCard component.
    • Updated calls to showSimpleMessage (renamed) when removing a club and checking for help messages.
  • lib/ui/pages/club_manager/club_manager_view_model.dart → lib/ui/pages/clubs/clubs_view_model.dart
    • Renamed ClubManagerViewModel to ClubsViewModel and moved it under ui/pages/clubs. No functional changes to commands or use cases.
  • lib/ui/pages/home/home_page.dart
    • Imported FavoriteClubsPage under home/favorite_clubs.
    • Changed bottom navigation destinations:
      • Replaced Home icon/label with Symbols.stadium_rounded and label “Eventos”.
      • Replaced Favorites icon/label with Symbols.local_police_rounded and label “Clubes”.
    • Updated the IndexedStack children array:
      • Index 0: placeholder Center(child: Text('Eventos')).
      • Index 1: ClubsPage() (formerly ClubManagerPage).
      • Index 2: placeholder Center(child: Text('Perfil')).
  • lib/ui/pages/home/home_view_model.dart
    • Fixed import path to use '/domain/models/user_info.dart' instead of a relative path.

New Files

  • lib/ui/pages/clubs/club_register/widgets/dismissible_club_card.dart
    • Introduces DismissibleClubCard widget to encapsulate the swipe-to-edit and swipe-to-delete UI.
    • Accepts callbacks: navManagerClubnavEditClub, and removeClub for handling respective actions.
  • lib/ui/pages/clubs/manage_club/manage_club_page.dart
    • Implements a stub ManageClubPage, which receives a ManageClubViewModel and a Club object via the route.
    • Displays the club’s name in the AppBar.
  • lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
    • Defines an empty ManageClubViewModel class as a placeholder for future club-management logic.
  • lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
    • A new FavoriteClubsPage that lists placeholder “Favorite Club” items.
    • Will serve as the view for the “Clubes” tab in the home navigation bar.

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 AffiliationStatus model 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_manager subdirectory instead of club.
    • Changed builder for Routes.clubs to instantiate ClubManagerPage with ClubManagerViewModel (formerly ClubPage/ClubViewModel).
  • lib/ui/pages/home/home_page.dart
    • Introduced an int currentPageIndex field to track active tab.
    • Added a NavigationBar at the bottom with three NavigationDestination entries: Home, Favoritos, Perfil.
    • Wrapped existing scaffold body in an IndexedStack keyed by currentPageIndex: placeholders for Home, Favoritos, and Perfil.
    • Wrapped setState on onDestinationSelected to switch tabs.
  • lib/ui/pages/club/club_page.dart → lib/ui/pages/club_manager/club_manager_page.dart
    • Renamed class from ClubPage to ClubManagerPage.
    • Updated constructor and state class to use ClubManagerViewModel instead of ClubViewModel.
  • lib/ui/pages/club/club_view_model.dart → lib/ui/pages/club_manager/club_manager_view_model.dart
    • Renamed ClubViewModel to ClubManagerViewModel.
    • Constructor and commands remain, but class and file path updated to reflect “club_manager”.
  • 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.
  • 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.

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 ClubSearch widget with a Scaffold and centered “Club Search” placeholder text. Serves as the starting point for club browsing features.
  • lib/ui/pages/club_search/club_search_view_model.dart
    • Placeholder view model file for ClubSearch (currently empty).

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 UserModel with UserInfo in import, fields, getters, method signatures, JSON mapping and caching logic.
  • lib/data/repositories/user/user_repository.dart
    • Updated repository interface to use UserInfo instead of UserModel for property, methods and documentation.
  • lib/domain/enums/enums_declarations.dart
    • Added factory UserRole.byName(String) for convenient lookup by name.
  • lib/domain/models/user_info.dart (formerly user.dart)
    • Renamed class UserModel to UserInfo.
    • Adjusted constructor, copyWithtoMapfromMapfromJsonString, equality and toString.
    • Simplified sports deserialization into a Set<Sports>.
  • lib/domain/use_cases/account_management_user_case.dart
    • Switched imports and use cases to UserInfo.
    • Renamed getters and addPerson/updatePerson return types to UserInfo.
  • lib/routing/app_extra_codec.dart
    • Imported enums_declarations.dart and address.dart.
    • Extended _AppExtraEncoder to JSON-encode Address (type: 'address') and UserRole (type: 'userRole').
  • lib/routing/router.dart
    • Imported UserRole.
    • Updated route names and paths: personRegister → userRegister.
    • Modified registration builder to accept extra as UserRole? and pass to RegistrationPage.
  • lib/routing/routes.dart
    • Renamed personRegister constant to userRegister.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Updated person parameter and import to UserInfo.
  • lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
    • Updated header to accept UserInfo instead of UserModel.
  • lib/ui/pages/address/address_page.dart
    • Replaced _navToAddressRegister with _addAddress that auto-selects first address when only one exists.
    • Simplified selection logic to always set _selectedAddressId and _selectedAddress to the tapped item.
  • lib/ui/pages/address/address_register/address_register_page.dart
    • Wrapped controller assignments for ViaCep lookup in setState.
    • Removed unused ViaCepAddress import.
  • lib/ui/pages/billinginfo/billinginfo_page.dart
    • Fixed type casting by using untyped value for billinginfo.
  • lib/ui/pages/home/home_page.dart
    • Introduced _navToRegistration and _navToUserRegister to replace person-centric navigation.
    • Updated drawer callbacks and icons to use userInfo and new registration handlers.
    • Adjusted completion sheet logic to reference userInfo.
  • lib/ui/pages/home/home_view_model.dart
    • Switched import and getter from UserModel/person to UserInfo/userInfo.
  • lib/ui/pages/registration/registration_page.dart
    • Added UserRole? role parameter and rolePermissions map.
    • Extended stepper with five steps, isActive flags and custom controls (icon buttons and “Execute” button).
    • Refactored _backPage_nextStep_setStep_executeStep and _goNext to manage role-driven flow.
  • 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 personRegisterViewModel to userResisterViewModel with UserInfo.
    • Adjusted state initialization, controllers, hint texts, back navigation returning UserInfo, and comparison logic in _setEdited.
  • lib/ui/pages/user_register/user_resister_view_model.dart
    • Renamed file and imports to UserInfo.
    • Updated command types for add and update to Command1<UserInfo, UserInfo>.
    • Renamed person getter to userInfo.
  • lib/ui/pages/user_register/widgets/select_sports.dart
    • Moved file path to user_register/widgets without content changes.
  • test/data/repositories/clubs/remote_club_repository_test.dart
    • Updated import and test user instantiation to UserInfo.
  • test/data/repositories/schedule/remote_schedule_repository_test.dart
    • Updated import and test user instantiation to UserInfo.
  • test/data/repositories/user/remote_user_repository_test.dart
    • Updated import, field types and test user creation to UserInfo.
  • test/domain/use_cases/address_club_user_case_test.dart
    • Updated import and test user instantiation to UserInfo.

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.
  • lib/config/dependencies.dart
    • Imported the new ThemeUserCase use case.
    • Replaced ChangeNotifierProvider<ThemeViewModel> with ChangeNotifierProvider<ThemeUserCase>.
    • Removed obsolete import of theme_view_model.dart.
  • lib/domain/models/user.dart
    • Added sports: Set<Sports> field with default empty set.
    • Updated constructor, copyWithtoMapfromMap, and == override to include sports.
    • Imported the Sports enum.
  • lib/domain/use_cases/theme_user_case.dart
    • Renamed and moved ThemeViewModel to ThemeUserCase under domain/use_cases.
    • Updated constructor class name and file path.
  • lib/main_app.dart
    • Updated import to point at ThemeUserCase instead of ThemeViewModel.
    • Changed context read to use ThemeUserCase.
  • lib/routing/router.dart
    • Updated all imports referencing ThemeViewModel to ThemeUserCase.
    • Added a new GoRoute for the registration page.
    • Inserted an empty placeholder class ThemeViewModel {} to maintain backward compatibility.
  • lib/routing/routes.dart
    • Added registration route constant.
  • lib/ui/core/theme/dimens.dart
    • Reduced default corner radius from 24.0 to 12.0.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Imported dart:async.
    • Introduced _showDescriptionDuration_isShowDescription, and _timer to control description display timing.
    • Added dispose() override to cancel the timer.
    • Wrapped description in AnimatedCrossFade for show/hide animation.
    • Extracted _fixedWidth helper widget and _timerCallback() logic.
  • lib/ui/pages/address/address_register/address_register_page.dart
    • Changed error check from _viewModel.getViaCep.error to _viewModel.getViaCep.isFailure.
  • lib/ui/pages/club/club_view_model.dart
    • Corrected import path for address_club_user_case.dart to use absolute import.
  • 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 ThemeViewModel to ThemeUserCase.
  • lib/ui/pages/home/user_register/user_resister_page.dart
    • Imported SelectSports widget and Sports enum.
    • Added _sportsController_selectedSports, and related dispose logic.
    • Inserted a read-only text field for “Esportes de Interesse” with tap handler.
    • Implemented _selectSports dialog, _setSports handler, and wired sports into the user model creation and populate logic.
  • lib/utils/commands.dart
    • Moved _result declaration above getters.
    • Renamed error/success getters to isFailure/isSuccess with updated comments.
    • Ensured notifyListeners() and _running = false occur in finally.
  • lib/utils/result.dart
    • Expanded class-level documentation to describe generic Result<T>.
    • Standardized getter signatures for value and error.
    • Refined fold callback variable names.
    • Updated Success and Failure subclass comments.

New Files

  • lib/ui/pages/home/user_register/widgets/select_sports.dart
    • A reusable SelectSports widget presenting a list of FilterChips for multi-sport selection, reporting changes via a Set<Sports> callback.
  • lib/ui/pages/registration/registration_page.dart
    • A new RegistrationPage implementing a three-step Stepper for user, address, and payment data capture.
  • supabase/migrations/20250527132735_alter_table_users.sql
    • Migration to create sports_enum type and add sports column as a non-null array of enums with default empty array.

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 addressesList to addressList
    • Added optional [bool forceRemote = false] parameter to initialize and fetch signatures
  • lib/data/repositories/address/remote_address_repository.dart
    • Updated getter from addressesList to addressList
    • Adjusted initialize and fetch method definitions to accept positional forceRemote flag
  • lib/data/repositories/clubs/club_repository.dart
    • Renamed clubs to clubList
    • Changed initialize signature to use optional positional forceRemote
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Updated getter from clubs to clubList
    • Refactored initialize to call _loadAllLocal and _loadAllRemote instead of legacy fetch methods
    • Renamed internal fetch helpers to _loadLocal(id) and _loadRemote(id)
    • Consolidated local cache operations _saveLocal_removeLocalCache_loadAllLocal, and _loadAllRemote
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Corrected bulkDelete parameter ordering for Supabase match API call
  • lib/data/services/remote_database_service.dart
    • Changed bulkDelete signature to accept positional conditions map
  • lib/domain/use_cases/address_billinginfo_user_case.dart
    • Renamed addressesList reference to addressList
  • lib/domain/use_cases/address_club_user_case.dart
    • Renamed class from AddressClubCase to AddressClubUserCase
    • Updated constructor field ordering and import paths
    • Adjusted parameter name from oldUrl to oldLogoUrl
  • lib/domain/use_cases/address_user_user_case.dart
    • Renamed class from AddressUserCase to AddressUserUserCase
    • Updated addresses getter to use addressList
  • lib/routing/router.dart
    • Updated imports for renamed use-case classes (AddressClubUserCaseAddressUserUserCase)
  • 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 positional fetch(addressId, true)
    • Updated test reference from addressesList to addressList
  • test/domain/use_cases/address_club_user_case_test.dart
    • Updated import and instantiation to use AddressClubUserCase

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 _fetchAllFromLocal and _fetchAllFromDatabase definitions at class end
    • Consolidated address-loading logic in the primary initialization flow
  • 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
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Removed stale FIXME comment about uncached club fetch
    • Preserved only the necessary _fetchFromRemote invocation
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Stripped out redundant _loadLocal_loadRemote, and _saveCache methods (now centralized)
    • Simplified add method to use direct database insert calls with payload mapping
    • Retained cache key and simple ID utilities at class bottom
  • 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 _validateFileAndGenerateName to explain its purpose and failure mode

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 parent attribute 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 _started to _initialized and updated guard conditions
    • Ensured repository only initializes once per user session
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
    • Renamed _started to _initialized across initialization and logout methods
    • Reset _initialized flag on logout
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Renamed _started to _initialized and refined initialization check
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Renamed _started to _initialized, replaced manual cache fetch with _loadLocal and _loadRemote helpers
    • Consolidated memory and device caching into _saveCache
    • Simplified fetch guard logic, improved error handling and orderBy usage
    • Adjusted delete sequence to remove from database before cache and memory
  • lib/data/services/cache_database_service.dart
    • Corrected key prefix matching from '$prefix.' to '${prefix}_'
    • Added info-level logging for key retrieval
  • lib/data/services/remote_database_service.dart
    • Inverted conditions null check to only apply when non-null
    • Upgraded error logging from warning to severe for Postgrest and generic exceptions
  • lib/utils/result.dart
    • Introduced resultSuccess constant for reusable Result.success(null)
  • lib/ui/core/ui/form_fields/address_form_field.dart
    • Removed commented-out decoration colors and added explicit contentPadding
  • lib/ui/pages/address/address_page.dart
    • Fixed import path for main_app_bar.dart
    • Extracted back-navigation into _backPage method
    • Split floating action button into two: back and add, each with distinct heroTag
  • lib/ui/pages/home/home_page.dart
    • Added provider imports and cache inspection button in app bar
    • Prints all keys starting with 'club' when tapped
  • test/data/repositories/schedule/remote_schedule_repository_test.dart
    • Updated test invocation of fetch(clubId, true) to include forceRemote parameter

New Files

  • lib/domain/models/affiliate.dart
    • Renamed model from Membership to Affiliate, updated constructor, copyWith, and factory methods
    • Adjusted imports and mapping logic to use Affiliate.fromMap

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 getKeysStatedWith to getKeysStartsWith for consistency.
  • lib/data/repositories/clubs/club_repository.dart
    • Renamed delete method parameter to clubId for improved clarity.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Refactored local cache update logic into _saveLocalCache helper.
    • Refactored local cache removal logic into _removeLocalCache helper.
    • Replaced deprecated toJsonString/fromJsonString with toJson/fromJson.
    • Fixed minor documentation formatting and removed obsolete comments.
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Renamed cache method to getKeysStartsWith.
    • Refactored caching logic into _saveCaching.
    • Modified add and _addToDatabase to standardize parameter order and avoid in-place list mutations.
  • lib/data/services/cache_database_service.dart
    • Renamed method getKeysStatedWith to getKeysStartsWith to improve semantic accuracy.
  • lib/domain/models/club.dart
    • Replaced toJsonString/fromJsonString with toJson/fromJson for standardization.
  • lib/domain/models/operating_day.dart
    • Fixed toMap logic to correctly serialize id and clubId fields.
  • lib/domain/models/schedule.dart
    • Changed addDay from returning a new Schedule to mutating the existing instance.
    • Added removeDay method for removing specific weekdays.
  • lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/address_club_case.dart
    • Renamed file and class from AddressClubUserCase to AddressClubCase for improved readability.
  • lib/routing/router.dart
    • Integrated AppExtraCodec as the extraCodec for GoRouter.
    • Updated imports and use case instantiations to AddressClubCase.
  • lib/ui/pages/club/club_register/club_register_view_model.dart
    • Updated use case reference to AddressClubCase.
  • lib/ui/pages/club/club_register/widgets/schedule_page.dart
    • Modified addDay usage to align with mutable API.
    • Added _resetSchedule method with corresponding button for clearing schedules.
    • Updated _selectDay to use removeDay when deselecting weekdays.
  • lib/ui/pages/club/club_view_model.dart
    • Updated use case reference to AddressClubCase.
  • test/data/repositories/schedule/remote_schedule_repository_test.dart
    • Updated test to align with new mutable addDay behavior.
    • Adjusted expectations to reflect updated API usage.
  • test/data/repositories/user/remote_user_repository_test.dart
    • Renamed fake cache method to getKeysStartsWith for consistency.
  • 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.

New Files

  • lib/routing/app_extra_codec.dart
    • Introduced AppExtraCodec for serializing and deserializing route extra parameters.
    • Supports ClubMap<String, dynamic>, and String types for routing data transport.

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 ScheduleRepository and its remote implementation in the dependency injection.
    • Adjusted imports to use consistent absolute paths.
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
    • Renamed constructor parameter from localService to cacheService for consistency.
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Exposed schedules map via getter.
    • Enhanced fetch to allow bypassing memory cache with a forceRemote parameter.
    • Corrected memory removal logic in delete.
  • lib/data/repositories/schedule/schedule_repository.dart
    • Added getter for schedules.
    • Modified fetch signature to include optional forceRemote parameter.
  • lib/domain/models/schedule.dart
    • Renamed copyWithDay method to addDay for improved semantic clarity.
  • lib/domain/use_cases/address_club_user_case.dart
    • Integrated ScheduleRepository into constructor and internal logic.
    • Updated clubs getter to combine clubs with their schedules.
    • Modified loadfetchClubaddClubupdateClub, and deleteClub to handle schedules accordingly.
  • lib/routing/router.dart
    • Passed ScheduleRepository dependency to AddressClubUserCase.
    • Minor import adjustments for consistency.
    • Formatted SchedulePage initialization for better readability.
  • lib/ui/pages/club/club_register/widgets/schedule_page.dart
    • Updated method calls from copyWithDay to addDay to reflect API change.
  • lib/ui/pages/club/club_view_model.dart
    • Adjusted clubs getter to clubsList to reflect combined data source with schedules.
  • test/data/repositories/clubs/remote_club_repository_test.dart
    • Added missing await to initialize method call for proper async handling.
  • 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 AddressClubUserCase with schedule CRUD operations.
    • Covers full flow: load, add club with schedule, fetch, update, delete, and post-deletion fetch.

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 status command to diff target for better workflow visibility.
  • 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 getKeysStatedWith for more precise cache key retrieval.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Replaced getKeys with getKeysStatedWith for consistent cache key handling.
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Added CacheDatabaseService dependency.
    • Implemented in-memory cache _schedules and _started initialization flag.
    • Introduced _fetchAllFromCache for device cache loading.
    • Updated fetchaddupdate, and delete methods to manage both memory and device cache.
    • Added _cacheSchedule and _deviceCaching helpers for consistent caching.
  • lib/data/repositories/schedule/schedule_repository.dart
    • Expanded interface with detailed documentation.
    • Added initialize method for pre-loading schedules.
  • lib/data/services/cache_database_service.dart
    • Renamed getKeys to getKeysStatedWith for semantic accuracy.
  • lib/data/services/remote_database_service.dart
    • Improved add method documentation to clarify semantics.
  • lib/domain/models/schedule.dart
    • Renamed constructor parameter to listODay for consistency.
    • Renamed listDays getter to listODays.
    • Removed redundant fromOperatingDays factory.
    • Simplified copyWithDay to use listODays.
  • 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 FakeCache implementation to match new getKeysStatedWith method signature.

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 formatter configuration to preserve trailing commas.
  • lib/config/dependencies.dart
    • Updated imports from person_repository to user_repository.
    • Standardized constructor parameter names (sharedPreferences → cacheService).
  • 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 _fetchFromRemote to return Result<BillingInfo?>.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Enhanced fetch method with explicit null-check.
    • Added removal of schedule field before database operations.
    • Added FIXME comments regarding caching.
  • lib/data/repositories/common/server_names.dart
    • Added new constants: schedule and location for ClubsTableColumns.
  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Added null-aware operator in fromOperatingDays.
  • 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 person to user.
  • lib/data/repositories/person/person_repository.dart → lib/data/repositories/user/user_repository.dart
    • Renamed file.
    • Updated documentation and method signatures from person to user.
  • lib/data/services/auth_service.dart
    • Added optional debug parameter to initialize.
  • lib/data/services/remote_database_service.dart
    • Added ClubsTableColumns import for location field handling.
    • Implemented _wkbToWkt method to convert spatial data.
    • Modified fetch and fetchList to use WKB-to-WKT conversion.
    • Simplified update and delete methods for consistency.
  • lib/domain/models/location.dart
    • Fixed duplicate fromMap constructor.
    • Minor code rearrangement for clarity.
  • lib/domain/models/schedule.dart
    • Refactored to use List<OperatingDay> for internal structure.
    • Added getter listDays.
    • Simplified copyWith and copyWithDay methods.
  • lib/domain/use_cases/account_management_user_case.dart
    • Updated import path for user_repository.
  • lib/domain/use_cases/address_billinginfo_user_case.dart
    • Changed fetchAddress return type to Result<Address?>.
  • lib/domain/use_cases/address_club_user_case.dart
    • Changed fetchAddress and fetchClub return types to nullable Result.
  • lib/domain/use_cases/address_user_case.dart
    • Changed fetch return type to Result<Address?>.
  • lib/routing/router.dart
    • Updated import path for user_repository.
  • lib/ui/pages/address/address_view_model.dart
    • Updated fetch return type to Future<Result<Address?>>.
  • lib/ui/pages/billinginfo/billinginfo_view_model.dart
    • Updated fetchAddress return type to Future<Result<Address?>>.
  • lib/ui/pages/club/club_register/club_register_view_model.dart
    • Updated fetchClub and fetchAddress types to nullable.
    • Adjusted _fetchClub method signature accordingly.
  • lib/ui/pages/club/club_view_model.dart
    • Updated fetchAddress return type to Future<Result<Address?>>.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Corrected parameter name for RemoteAddressRepository.
    • Improved test setup with Uuid for dynamic email generation.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Standardized test user creation with dynamic Uuid email.
    • Aligned test variable naming with refactor.
  • 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 Schedule instantiation to use List<OperatingDay>.
  • test/domain/models/schedule_test.dart
    • Refactored tests to accommodate new Schedule list-based constructor.

New Files

  • test/data/repositories/clubs/remote_club_repository_test.dart
    • Added comprehensive CRUD test for RemoteClubRepository.
  • test/data/repositories/schedule/remote_schedule_repository_test.dart
    • Placeholder for future RemoteScheduleRepository tests.

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/19 to 2025/05/20 for versions 0.22.01+54 and 0.22.01+55.
  • lib/ui/pages/address/address_register/address_register_page.dart
    • Renamed _onSave to _onSaved to better reflect its purpose as a completion handler.
    • Updated listeners for add and update operations to use the new method name.

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 (athletemanager) 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.
  • lib/domain/enums/enums_declarations.dart
    • Added a placeholder utility method byName (commented) for future use.
  • lib/domain/models/location.dart
    • Removed redundant toString() method for cleaner output.
  • lib/domain/models/schedule.dart
    • Introduced weekday-specific getters (e.g., mondaytuesday, etc.).
    • Updated toMap() to serialize days as a map keyed by weekday names.
    • Improved fromMap() to correctly parse nested weekday maps.
  • pubspec.yaml
    • Bumped version to 0.22.01+55.
  • supabase/migrations/20250417191646_create_users_table.sql
    • Added a new Supabase policy: "Allow users to delete their own users".
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Refactored .env file loading to a unified and centralized path.
  • test/data/repositories/storage/remote_storage_repository_test.dart
    • Standardized environment file path for consistency.
  • test/data/services/remote_storage_service_test.dart
    • Unified .env file path to use /test/.env_test_supabase.
  • test/data/services/supabase_auth_service_test.dart
    • Updated path to .env for consistency across all Supabase-related tests.
  • test/domain/models/club_test.dart
    • Fixed test expectation by aligning with toPointString() representation for Location.
  • test/domain/models/schedule_test.dart
    • Rewrote Schedule and OperatingDay tests to reflect new serialization logic.
    • Verified toMapfromMaptoJson, and fromJson round-trip integrity.
    • Added assertions for correct weekday serialization, deserialization, and structural consistency.

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 for Schedule.
    • Reduced height of the Schedule component to reflect simplified structure.
  • lib/data/repositories/address/remote_address_repository.dart
    • Internalized _userId and refactored _fetchAllFromDatabase to remove the parameter.
    • Updated fetch calls to match new named parameters.
  • lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
    • Updated call to fetch method to use named parameters.
  • 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_schedules to Tables and created ClubSchedulesTableColumns.
  • lib/data/repositories/person/remote_person_repository.dart
    • Updated call to fetch method to use named parameters.
  • lib/data/services/remote_database_service.dart
    • Refactored fetch and fetchList to use named parameters (idfromMapconditions).
    • Added bulkDelete method for deleting multiple entries by condition.
    • Improved logging for error handling.
  • lib/domain/models/club.dart
    • Changed schedule to nullable and updated serialization accordingly.
  • lib/domain/models/operating_day.dart
    • Introduced idclubId, and weekday.
    • Replaced open and close with openAt and closeAt.
    • Moved TimeOfDay extension to a separate file.
    • Enhanced JSON and map support.
  • lib/domain/models/schedule.dart
    • Simplified internal structure to use Map<Weekday, OperatingDay>.
    • Added fromOperatingDays factory.
    • Improved toString and JSON serialization.
  • lib/ui/pages/club/club_register/widgets/schedule_page.dart
    • Updated UI logic to match new field names (openAtcloseAt).
    • Adjusted _pickTimeFromWeek and checkbox logic accordingly.
  • supabase/config.toml
    • Disabled email confirmation for sign-in to simplify testing.
  • supabase/migrations/20250514180524_create_clubs_table.sql
    • Commented out old schedule column in clubs.
  • supabase/migrations/20250519171604_create_club_schedules.sql
    • Added clarification comment on weekday field constraint.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Centralized environment configuration loading.
    • Used values from .env_test_supabase instead 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.
  • test/domain/models/club_test.dart
    • Updated tests to use new OperatingDay structure.
    • Adjusted serialization checks for Schedule.
  • test/domain/models/schedule_test.dart
    • Refactored all tests to use weekdayopenAtcloseAt.
    • Updated serialization and deserialization expectations.

New Files

  • lib/data/repositories/schedule/remote_schedule_repository.dart
    • Repository implementation to fetch, add, update, and delete schedules using the normalized club_schedules table.
  • 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 TimeOfDay to convert to/from HH:MM and HH:MM:SS formats.

Assets and Test Data

  • test/.env_test_supabase
    • Moved .env_test_supabase to root test/ folder for consistent loading across integration tests.

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 profile to billinginfo across methods and properties.
  • lib/data/repositories/billinginfo/remote_profile_repository.dart → remote_billinginfo_repository.dart
    • File renamed and all internal references updated to billinginfo.
  • lib/data/services/remote_database_service.dart
    • Removed dependency on uuid package.
    • Replaced client-side UUID generation with server-side gen_random_uuid().
    • Enhanced update to optionally update updated_at.
  • lib/domain/enums/enums_declarations.dart
    • Reordered Weekday enum entries.
    • Removed all embedded position enums.
  • lib/domain/enums/enums_sports.dart
    • Removed Position abstraction and all position-specific enums.
    • Introduced new sports: footvolleybeachVolleybal.
  • lib/domain/enums/enums_sports_positions.dart
    • Created new file encapsulating Position interface and related enums for each sport.
    • Added FootvolleyPosition and BeachVolleybalPosition.
  • lib/domain/models/club.dart
    • Updated location to use toPointString().
    • Changed schedule from JSON string to structured map.
  • lib/domain/models/location.dart
    • Added support for PostGIS-compatible POINT string conversion.
  • lib/domain/models/sportman.dart → membership.dart
    • Renamed class Sportsman to Membership.
    • Aligned terminology (joinedAtathleteId, etc.) and improved field consistency.
  • lib/domain/models/schedule.dart
    • Replaced hardcoded weekday fields with a Map<Weekday, OperatingDay>.
    • Updated serialization/deserialization methods accordingly.
  • 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 profile to billinginfo throughout.
  • 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 profiles to billinginfo.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Renamed profile callback to billinginfo.
  • lib/ui/pages/profile/profile_page.dart → billinginfo/profile_page.dart
    • Relocated and renamed to BillingInfoPage.
    • Refactored to align with new BillingInfoViewModel.
  • 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 Profile to BillingInfo.
  • lib/ui/pages/club/club_register/widgets/schedule_page.dart
    • Updated references to new Schedule implementation with map-based structure.
  • lib/ui/pages/home/home_page.dart
    • Updated navigation and callback references from profile to billinginfo.
  • 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 Schedule structure using Map<Weekday, OperatingDay>.
  • 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_schedules table with RLS policies and index.
    • Supports fine-grained control over schedule per weekday.

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 (personprofile, and address) have been renamed to usersbilling_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 UserRepository and BillingInfoRepository.
  • lib/data/repositories/address/remote_address_repository.dart
    • Renamed table and column references from address to addresses.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Updated filter field to use ClubsTableColumns.
  • lib/data/repositories/common/server_names.dart
    • Renamed constants for TablesAddressesTableColumns, and ClubsTableColumns.
  • lib/data/repositories/person/person_repository.dart
    • Replaced Person with UserModel throughout the interface.
  • lib/data/repositories/person/remote_person_repository.dart
    • Replaced all internal references of Person with UserModel.
    • Renamed RemotePersonRepository to RemoteUserRepository.
  • lib/domain/use_cases/account_management_user_case.dart
    • Replaced Person with UserModel and PersonRepository with UserRepository.
  • lib/domain/use_cases/address_profile_user_case.dart
    • Replaced Profile with BillingInfo.
  • 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 UserModel instead of Person.
  • lib/ui/pages/home/home_view_model.dart
    • Updated to reflect new naming for UserModel.
  • lib/ui/pages/home/person_register/person_resister_page.dart
    • Replaced Person with UserModel and related logic.
  • lib/ui/pages/home/person_register/person_resister_view_model.dart
    • Updated view model to manage UserModel data.
  • lib/ui/pages/profile/profile_page.dart
    • Replaced Profile with BillingInfo.
  • lib/ui/pages/profile/profile_view_model.dart
    • Refactored to work with BillingInfo as the domain model.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Updated table name from address to addresses.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Refactored test setup, assertions, and cleanup to use UserModel and users table.

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, implementing BillingInfoRepository.
  • lib/domain/models/billinginfo.dart
    • Refactored from profile.dart to represent billing-related user data.
  • supabase/migrations/20250512192942_create_billing_info_table.sql
    • SQL script to create the new billing_info table, with appropriate indexes and policies.

Deleted Files

  • lib/data/repositories/profiles/profile_repository.dart
    • Removed legacy profile repository interface.
  • lib/domain/models/profile.dart
    • Superseded by billinginfo.dart.
  • supabase/migrations/20250512192942_create_profile_table.sql
    • Removed obsolete migration for profile table.
  • supabase/migrations/20250417191646_create_person_table.sql
    • Renamed to create_users_table.sql.

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.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Integrated remote implementations for sendPasswordRecovery and resendConfirmationEmail.
  • 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: showSnackError and showSnackSuccess.
  • 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.
  • 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.

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.dart to reflect its new location.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Converted relative import from package: to / style for cache_database_service.dart.
  • lib/domain/models/schedule.dart
    • Replaced package: import with relative / path.
  • lib/domain/models/sportman.dart
    • Adjusted import path to use a relative / reference for extensions.
  • lib/domain/use_cases/address_club_user_case.dart
    • Updated import to use relative path for server_names.dart.
  • lib/main_app.dart
    • Adjusted import for theme_view_model.dart due to file relocation.
  • lib/routing/router.dart
    • Updated all UI-related imports from features/ to pages/.
    • Ensured consistency in the routing setup to reflect new structure.
  • lib/ui/core/ui/... files
    • Updated various package: style imports to relative / references to improve maintainability and uniformity.

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 (loginlogoutsignUp, 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 updatePerson to include internal photo processing via _processPhoto.
    • Added _processPhoto method to manage avatar uploads or updates with storage fallback.
  • 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 Club as extra when navigating to ClubRegisterPage.
    • Reordered constructor parameters to reflect logical dependency flow.
    • Applied naming consistency (viewModelauthenticationUserCase).
  • 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 isDark boolean for drawer rendering.
  • lib/ui/core/ui/images/avatar_image.dart
    • Renamed imagePath to image for consistency and clarity.
  • lib/ui/core/ui/images/select_avatar_image.dart
    • Updated property reference from imagePath to image.
  • lib/ui/core/ui/others/main_app_bar.dart
    • Replaced actionWidget with a full actions list to support multiple actions.
    • Removed theme toggle logic from within the component.
  • lib/ui/features/address/address_page.dart
    • Updated MainAppBar to use new actions format.
  • lib/ui/features/address/widgets/dismissible_address.dart
    • Wrapped Dismissible widget in a Padding to provide vertical spacing.
  • lib/ui/features/club/club_page.dart
    • Implemented Dismissible for each club in the list with edit and remove actions.
    • Added visual polish with spacing and card color.
    • Added _removeClub method to handle removal with feedback.
  • lib/ui/features/club/club_register/club_register_page.dart
    • Added _initialize() to populate form when editing an existing club.
    • Ensured consistent assignment of id and createdAt during form submission.
  • lib/ui/features/club/club_register/club_register_view_model.dart
    • Replaced Command1 for fetchAddress with direct access to the use case method.
  • lib/ui/features/club/club_view_model.dart
    • Implemented deleteClub method with success/failure logging.
  • 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 ThemeViewModel into HomeViewModel to centralize theme logic.
    • Added toggleTheme command and isDark getter.

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 RemoteDatabaseService and RemoteStorageService with DatabaseService and StorageService.
    • Updated dependency injection for repositories.
  • lib/data/repositories/address/remote_address_repository.dart
    • Replaced RemoteDatabaseService with the new DatabaseService.
  • lib/data/repositories/clubs/club_repository.dart
    • Added optional forceRemote parameter to initialize.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Replaced service class names.
    • Enhanced initialize with local/remote fallback.
    • Fixed incorrect cache key prefix (from address to clubs).
    • Improved exception handling and added logs.
  • lib/data/repositories/common/server_names.dart
    • Added clubLogos constant to the Buckets class.
  • lib/data/repositories/person/remote_person_repository.dart
    • Updated service references to use DatabaseService.
  • lib/data/repositories/profiles/remote_profile_repository.dart
    • Updated service references to use DatabaseService.
  • lib/data/repositories/storage/remote_storage_repository.dart
    • Replaced RemoteStorageService with StorageService.
    • Updated addupdate, and delete methods to explicitly require bucket and url.
    • Removed fixed references to the avatars bucket.
  • lib/data/repositories/storage/storage_repository.dart
    • Updated interface methods to support configurable bucket and url parameters.
  • lib/data/services/remote_database_service.dart
    • Renamed class from RemoteDatabaseService to DatabaseService.
  • lib/data/services/remote_storage_service.dart
    • Renamed class from RemoteStorageService to StorageService.
    • Updated parameters in add and update methods to filePath.
  • lib/domain/enums/enums_sports.dart
    • Added byLabel static method for retrieving Sports by their label.
  • lib/domain/use_cases/account_management_user_case.dart
    • Refactored _processPhoto to use new StorageRepository interface with bucket and filePath.
  • lib/domain/use_cases/address_club_user_case.dart
    • Injected StorageRepository.
    • Added full lifecycle management for club logo:
      • _processLogo for upload/delete.
      • Logo management integrated into addClubupdateClub, and deleteClub.
  • lib/domain/use_cases/address_profile_user_case.dart
    • Updated import paths to use project-relative style.
  • lib/routing/router.dart
    • Updated AddressClubUserCase injection to include StorageRepository.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Added unfocus() call to close keyboard before showing enum labels.
  • lib/ui/features/club/club_page.dart
    • Refactored ListView building to avoid usage of stale child builder.
  • lib/ui/features/club/club_register/club_register_page.dart
    • Added validation to all fields.
    • Injected logo processing into save logic.
    • Used merged Listenable for save button state.
    • Enhanced feedback with AppSnackBar on success and failure.
  • lib/ui/features/club/club_register/widgets/schedule_page.dart
    • Fixed typo in AppBar title.
    • Applied AppFontsStyle to time text.
  • lib/ui/features/profile/profile_page.dart
    • Added success snackbar after updating profile.
  • lib/utils/validates/generics_validate.dart
    • Renamed notEmpty to isNotEmpty for clarity and consistency.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Replaced RemoteDatabaseService with DatabaseService.
  • 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.
  • test/data/repositories/storage/remote_storage_repository_test.dart
    • Refactored to support new bucket and filePath parameters.
  • 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_logos bucket in Supabase with public access.
    • Adds RLS policies for INSERTUPDATEDELETE, and SELECT to allow only authenticated users to manage their own files.

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.club to Tables.clubs.
    • Ensured consistency with updated table name across fetch, add, update, and delete operations.
  • lib/data/repositories/common/server_names.dart
    • Renamed club → clubs in the Tables class for plural consistency.
  • lib/domain/enums/enums_declarations.dart
    • Removed commented-out AddressType enum for cleanup.
  • lib/domain/enums/enums_sports.dart
    • Added static method byName() to convert from string to enum value.
  • lib/domain/models/club.dart
    • Made id optional to support creation flows before persistence.
  • lib/domain/models/operating_day.dart
    • Added method toHHMM() to format operating times.
  • lib/domain/models/schedule.dart
    • Introduced scheduleMapcopyWithDay, and improved toString() formatting for display and mutation.
  • lib/routing/router.dart
    • Added routing support for /schedule using SchedulePage, passing current schedule and onSave callback via extra.
  • lib/routing/routes.dart
    • Declared the /schedule route as a constant.
  • lib/ui/core/ui/others/main_app_bar.dart
    • Added onBack optional callback to override default navigation behavior.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Improved customization by supporting prefixIcon as a widget.
  • lib/ui/features/club/club_register/club_register_page.dart
    • Finalized the UI for club registration.
    • Integrated AvatarFormFieldSchedulePage, and CurrencyEditingController.
    • Added full form validation, edit support, and submission logic.
  • lib/ui/features/club/club_register/club_register_view_model.dart
    • Added userId getter to simplify access to the current user.
  • lib/ui/features/home/person_register/person_resister_page.dart
    • Simplified image validator by using centralized GenericsValidate.image.
  • lib/ui/features/profile/profile_page.dart
    • Adapted to new SelectTextField customization.
  • lib/utils/validates/generics_validate.dart
    • Added image validator method to ensure photo input isn’t null or empty.

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 TimeOfDay for arithmetic and display formatting.
  • lib/ui/core/ui/editing_controllers/currency_editing_controller.dart
    • Custom TextEditingController for currency input with formatting and parsing.
  • supabase/migrations/20250514180524_create_clubs_table.sql
    • Migration script to create the clubs table with required fields and constraints.
    • Includes row-level security policies for insert, select, update, and delete.
    • Indexes created on manager_id and created_at.

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.collaborator to clarify its purpose.
  • lib/domain/enums/enums_sports.dart
    • Added labels and descriptions accessors for UI binding.
  • lib/domain/use_cases/address_user_case.dart
    • Added a new fetch method to retrieve full address data by ID.
  • lib/ui/core/ui/form_fields/address_form_field.dart
    • Updated the selectAddress callback to work with Address? instead of String?.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Changed iconData to prefixIcon to allow greater customization of input decorations.
    • Made hintText optional.
  • lib/ui/features/address/address_page.dart
    • Refactored address selection to use Address objects directly.
    • Address lookup by ID on page initialization now returns the full object.
  • lib/ui/features/address/address_view_model.dart
    • Exposed fetch function to allow address fetching by ID.
  • lib/ui/features/address/widgets/dismissible_address.dart
    • Updated address selection callback to return the Address object.
  • 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 prefixIcon for SelectTextField.
  • lib/ui/features/profile/profile_page.dart
    • Refactored address handling to work with full Address objects.
    • Removed dependency on Command1 for fetchAddress, using direct function call instead.
    • Simplified the state handling during profile initialization.
  • lib/ui/features/profile/profile_view_model.dart
    • Replaced Command1 with a plain function for fetchAddress to align with other use cases.

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 AccountManagementUseCase provider.
    • Registered the new RemoteClubRepository with the DI container.
    • Renamed parameters for consistency (service → databaseService).
  • lib/data/repositories/address/remote_address_repository.dart
    • Renamed constructor parameter service to databaseService for clarity.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Standardized constructor parameters (cacheServicedatabaseService).
    • Changed _userId to nullable.
    • Cleared _userId on logout.
  • lib/data/repositories/profiles/remote_profile_repository.dart
    • Renamed parameter remoteService to databaseService.
  • lib/domain/use_cases/address_profile_user_case.dart
    • Renamed fetch to fetchAddress for consistency with new use cases.
  • lib/routing/router.dart
    • Injected AccountManagementUseCase inline into the respective view models.
    • Added routes for clubs and clubRegister, initializing view models with AddressClubUserCase.
  • lib/routing/routes.dart
    • Added two new routes: clubs and clubRegister.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Added a menu entry for Clubes that is shown when the user is logged in.
  • 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.dart to its new location (core/ui/others).
    • Adjusted ViewModel usage patterns for consistency.
    • Ensured creation timestamps fall back to existing values when editing.
  • lib/ui/features/profile/profile_view_model.dart
    • Updated reference to renamed method fetchAddress.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Updated parameter name to databaseService in RemoteAddressRepository.

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.
  • 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 _manager to _profile for consistency and clarity across internal state.
    • Updated all related references and assignments accordingly.
    • Maintained functional behavior while improving semantic accuracy.
  • lib/ui/features/profile/profile_page.dart
    • Added _createProfile() method to encapsulate profile creation logic.
    • Included support for additional document types (RGCNHCNPJ) 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.
  • supabase/config.toml
    • Strengthened password requirements by setting password_requirements to "lower_upper_letters_digits_symbols".
  • supabase/migrations/20250512192942_create_profile_table.sql
    • Fixed incorrect policy reference by changing ON person to ON profile in select_own_profile.

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 (AddressProfileAuth) and renames/reorganizes profile-related files for better modularity.

Modified Files

  • lib/config/dependencies.dart
    • Adjusted imports for ProfileRepository.
    • Injected CacheDatabaseService into RemoteAuthRepository.
  • lib/data/repositories/address/address_repository.dart
    • Added logout() method to clear local address data.
  • 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.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Added optional injection of CacheDatabaseService.
    • Cleared cache on login and logout events.
  • lib/data/repositories/common/server_names.dart
    • Added club table constant.
    • Introduced ClubTableColumns definition.
  • 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 _cacheService across all methods.
  • lib/data/services/cache_database_service.dart
    • Added clear() method to reset shared preferences storage.
  • lib/domain/models/club.dart
    • Made id field nullable.
    • Renamed toJson() to toJsonString() and fromJson() to fromJsonString().
    • Removed unused toString, equality, and hashCode overrides.
  • lib/domain/use_cases/address_profile_user_case.dart
    • Adjusted import path for ProfileRepository.
  • 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 1 to maxLines.
  • lib/ui/features/profile/profile_page.dart
    • Ensures _isEditing is set to true after successful profile load.
  • 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 the FakeCache class.
  • test/domain/models/club_test.dart
    • Updated calls to use toJsonString and fromJsonString.

New Files

  • lib/data/repositories/clubs/club_repository.dart
    • Defines the ClubRepository interface with standard CRUD and session-related methods.
  • lib/data/repositories/clubs/remote_club_repository.dart
    • Implements the ClubRepository with support for memory caching, local storage, and remote fetch using Supabase.

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 (AthleteProfileManagerRole, 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 ProfileRepository and RemoteProfileRepository.
    • Aligned providers for AuthRepositoryStorageRepository, and others.
  • lib/data/repositories/auth/auth_repository.dart
    • AuthRepository now extends ChangeNotifier.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Updated implementation to extend ChangeNotifier.
  • lib/data/repositories/common/server_names.dart
    • Added new constant Tables.profile.
  • lib/data/repositories/person/remote_person_repository.dart
    • Improved error handling and consistency in delete and logout.
  • lib/domain/enums/enums_declarations.dart
    • Adjusted role label (“Presidente” → “Gerente”).
    • Added static method byName to Sex enum for safer parsing.
  • lib/domain/models/document.dart
    • Added named constructors for each document type (cpfrg, etc.).
  • lib/domain/use_cases/account_management_user_case.dart
    • Refactored to use interface StorageRepository.
  • lib/domain/use_cases/address_profile_user_case.dart
    • Integrated ProfileRepository and exposed profileaddProfile, and updateProfile.
  • lib/routing/router.dart
    • Updated route setup for ProfilePage to include PersonRepository.role.
    • Injected ProfileRepository into AddressProfileUserCase.
  • 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 addProfileupdateProfileuserId, and current profile.

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 ProfileRepository using Supabase and local caching.
    • Handles fetchaddupdatedelete, and initialization logic.
  • lib/domain/models/profile.dart
    • Unified Profile model supporting all role data (sex, cpf, guardian, etc.).
    • Includes serialization and equality methods.

Deleted Files

  • lib/domain/models/profiles/*.dart
    • Removed separate profile models: athlete_profile.dartmanager_profile.dart, etc.
    • Superseded by the unified Profile class.

Assets and Test Data

  • supabase/migrations/20250512192942_create_profile_table.sql
    • Created profile table with fields for address, sex, CPF, guardian, etc.
    • Enabled RLS with policies for select, insert, update, and delete.
    • Added indexes on address_id and sex.

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 class to abstract interface class.
  • lib/data/repositories/auth/auth_repository.dart
    • Changed to abstract interface class for consistency.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Explicitly implemented AuthRepository using implements.
  • lib/data/repositories/person/person_repository.dart
    • Updated to abstract interface class.
  • lib/data/repositories/storage/storage_repository.dart
    • Converted to abstract interface class.
  • lib/domain/enums/enums_declarations.dart
    • Introduced EnumLabel interface to support custom labeled enums.
    • Sex enum now implements EnumLabel.
  • lib/domain/enums/enums_sports.dart
    • Changed Position to an abstract interface class.
  • lib/domain/models/person.dart
    • Simplified toMap() method using direct assignments.
    • Cleaned up import statements.
  • lib/domain/models/profiles/*.dart
    • Refactored all user profile classes (AthleteProfileEnthusiastRoleHeadHunterRoleManagerRole) to extend UserProfile as a base class.
    • Centralized common fields (id, addressId, sex, createdAt, updatedAt) in UserProfile.
  • lib/main_app.dart
    • Commented out unnecessary labelStyle configurations in InputDecorationTheme.
  • lib/routing/router.dart
    • Updated route for address selection to accept addressId via state.extra.
    • Added new route for /profile mapped to ProfilePage.
  • lib/routing/routes.dart
    • Declared new route constant Routes.profile.
  • lib/ui/features/address/address_page.dart
    • Supports pre-selection of address using widget.addressId.
  • lib/ui/features/address/widgets/dismissible_address.dart
    • Replaced inline ListTile with new reusable AddressCard.
  • lib/ui/features/home/home_page.dart
    • Added _navToProfile() method and integrated it with the drawer.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Added new menu item for “Perfil” with callback profile.
  • lib/ui/core/ui/text_fields/basic_text_field.dart
    • Added support for maxLines and minLines.
  • lib/utils/commands.dart
    • Updated Command class declaration to use interface.

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.
  • lib/ui/core/ui/form_fields/sex_form_field.dart
    • Custom FormField<Sex> widget with toggle button interface.
  • lib/ui/core/ui/text_fields/toggle_buttons_text.dart
    • Helper widget to style labeled buttons inside a ToggleButtons widget.
  • 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.
  • lib/domain/models/club.dart
    • Replaced verbose addAll usage in toMap() with clean key-value assignments.
  • lib/domain/models/document.dart
    • Simplified toMap() logic.
  • lib/domain/models/location.dart
    • Improved toMap() structure with direct map key assignments.
  • lib/domain/models/operating_day.dart
    • Refactored toMap() to avoid intermediate result map.
  • lib/domain/models/person.dart
    • Refactored toMap() using addAll only once and removed unnecessary intermediate variable.
  • lib/domain/models/schedule.dart
    • Rewrote toMap() to conditionally include fields using concise if statements.
  • lib/domain/models/sportman.dart
    • Applied a cleaner, more direct mapping approach in toMap() for better performance and clarity.
  • lib/domain/models/viacep_address.dart
    • Modernized toMap() method using direct key assignments.

New Files

  • lib/domain/models/profiles/athlete_profile.dart
    • Defines AthleteProfile as a concrete implementation of UserProfile, encapsulating athlete-specific fields.
  • lib/domain/models/profiles/enthusiast_profile.dart
    • Defines EnthusiastRole as a user profile for casual participants with minimal fields.
  • lib/domain/models/profiles/head_hunter_profile.dart
    • Implements HeadHunterRole for scout-style users with cpfDoc and address fields.
  • 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.
  • lib/domain/models/profiles/user_profile.dart
    • Declares the UserProfile abstract class used to standardize role-specific user profiles.

Deleted Files

  • lib/domain/models/athlete.dart
    • Removed the outdated Athlete class in favor of the new AthleteProfile under the profile-based architecture.

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.
  • lib/ui/features/home/home_page.dart
    • Passed explicit theme toggling parameters (onToggleTheme and isDarkMode) to MainAppBar.
    • Enabled the drawer by setting useDrawer: true for the home page AppBar.
  • lib/ui/features/home/widgets/main_app_bar.dart
    • Refactored MainAppBar to:
      • Accept onToggleTheme and isDarkMode as parameters instead of a ThemeViewModel.
      • Conditionally show a drawer button or back navigation icon based on useDrawer and leading.
      • Simplify and decouple logic for theme toggle icon rendering.

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 Acougue to specific domain models (ManagerAthleteEnthusiastHeadhunter) to reflect actual model responsibilities.
    • Adjusted graph model dimensions.
  • lib/data/repositories/auth/auth_repository.dart
    • Renamed userAuth getter to user for cleaner access to authenticated user.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Updated implementation to match new user getter.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Replaced userAuth with user, aligning with new AuthRepository interface.
  • lib/domain/models/athlete.dart
    • Replaced manual date parsing with DateTimeMapper.
    • Refactored field initialization order for better clarity.
  • lib/domain/models/club.dart
    • Unified date serialization using DateTimeMapper.
  • lib/domain/models/manager.dart
    • Made sex optional.
    • Replaced manual toUtc().toIso8601String() with DateTimeMapper.
    • Removed unused toJsonfromJsontoString==, and hashCode methods.
  • lib/domain/models/person.dart
    • Unified date serialization/deserialization via DateTimeMapper.
  • lib/domain/models/sportman.dart
    • Made updatedAt required with fallback initialization.
    • Replaced raw date handling with DateTimeMapper.
  • lib/domain/use_cases/account_management_user_case.dart
    • Updated all usages of userAuth to new user getter.
  • lib/routing/router.dart
    • Simplified route builders to avoid explicit passing of userId via state.extra.
    • Used RemoteAuthRepository context to fetch authenticated userId.
  • lib/ui/features/address/address_page.dart
    • Added a back button to AppBar.
    • Simplified navigation by removing extra argument passing.
  • 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.
  • lib/ui/features/home/home_page.dart
    • Refactored _navToAddresses to use async navigation and print selected address ID on return.
  • lib/ui/features/home/widgets/main_app_bar.dart
    • Added optional leading parameter to allow custom back buttons in AppBar.
  • lib/utils/extensions/date_time_extensions.dart
    • Added DateTimeMapper helper class to unify date parsing and formatting throughout the codebase.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Updated tests to reflect renamed userAuth getter as user.

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.
  • lib/domain/models/address.dart
    • Added fullAddress computed property to format a complete address string.
  • lib/domain/use_cases/address_user_case.dart
    • Extended use case to support addupdate, and delete methods for address operations.
  • lib/ui/core/ui/messages/app_snack_bar.dart
    • Added isError flag to differentiate success and error snackbars with distinct color schemes.
  • lib/ui/core/ui/messages/show_simple_floating_message.dart
    • Enhanced to support custom iconData, return bool? result, and more flexible layout.
  • lib/ui/core/ui/texts/parse_rich_text.dart
    • Ensured color consistency for bold/italic text segments using onSurface.
  • lib/ui/features/address/address_page.dart
    • Connected dismissible UI to editdelete, and select handlers.
    • Improved help message presentation with contextual icons.
  • 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 AppSnackBar and showSimpleMessage.
  • lib/ui/features/address/address_register/address_register_view_model.dart
    • Refactored to include add and update commands.
    • Removed internal method wrappers in favor of direct use case delegation.
  • lib/ui/features/address/address_view_model.dart
    • Added delete command using AddressUserCase.

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 Dismissible behavior for address cards with swipe actions for edit and delete.

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.
  • lib/domain/models/viacep_address.dart
    • Removed unused toJson() and fromJson() methods to reduce unnecessary code.
  • lib/main_app.dart
    • Customized InputDecorationTheme for both light and dark themes to ensure consistent label/hint styling.
  • 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 nextFocusNode to facilitate keyboard navigation between fields.
  • lib/ui/core/ui/text_fields/sugestions_text_field.dart
    • Integrated nextFocusNode to auto-focus the next field upon selection.
  • 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 FocusNode usage.
    • Improved input flow and validation UX for address registration.
  • 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 RemoteAddressRepository and ViaCepService in the dependency graph.
  • lib/data/repositories/address/remote_address_repository.dart
    • Refactored to use RemoteDatabaseService instead 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.
  • lib/data/repositories/common/server_names.dart
    • Added constants for AddressTableColumns.
  • 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.
  • lib/domain/models/person.dart
    • Changed default role from athlete to none.
  • 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 Route class.
  • 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 → labelsenumDescriptions → descriptions).
  • 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 UserRole and updated prop names in SelectTextField.
  • 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.
  • test/data/repositories/address/remote_address_repository_test.dart
    • Updated tests to use RemoteDatabaseService instead of SupabaseClient.

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 AddressUserCase abstraction.
  • 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.

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 LocalDatabaseService to CacheDatabaseService in dependency injection.
  • lib/data/repositories/address/remote_address_repository.dart
    • Updated constructor and field types to use CacheDatabaseService.
  • lib/data/repositories/person/remote_person_repository.dart
    • Replaced usage of LocalDatabaseService with CacheDatabaseService.
  • lib/data/services/local_database_service.dart → lib/data/services/cache_database_service.dart
    • Renamed the file and class to CacheDatabaseService to clarify its role.
  • lib/ui/features/app/view_model/theme_view_model.dart
    • Updated class dependency from LocalDatabaseService to CacheDatabaseService.
  • 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 FakeCache to implement CacheDatabaseService.
  • 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.

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 .env to ignore list to avoid committing environment-specific secrets.
  • 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.

Deleted Files

  • .env
    • Removed from version control due to security risks and inclusion in .gitignore.

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 _started flag is reset on logout.
  • lib/domain/models/person.dart
    • Updated the == operator to ignore createdAt and updatedAt fields.
  • lib/domain/use_cases/account_management_user_case.dart
    • Added login() and signUp() methods to centralize authentication logic.
    • Removed commented legacy _uploadAvatar code.
    • Improved logging of login/signup events.
  • lib/routing/router.dart
    • Switched dependency injection from RemoteAuthRepository to AccountManagementUseCase.
  • lib/ui/core/ui/buttons/big_button.dart
    • Made onPressed optional.
    • Adjusted icon color depending on whether the button is enabled.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Added support for Person object and myAccount callback.
    • Updated parameters to handle nullability and improve routing logic.
  • lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
    • Displayed Person.photo as CircleAvatar if available.
    • Prioritized Person.nickname as fallback when userName is null.
  • lib/ui/core/ui/images/avatar_form_field.dart
    • Added onChanged callback for real-time updates to image selection.
  • lib/ui/core/ui/text_fields/date_text_field.dart
    • Added onChanged callback to notify on date selection.
    • Used a centralized date formatting via extension method.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Introduced onChanged support for tracking selection changes.
  • lib/ui/features/home/home_page.dart
    • Passed PersononTap, and myAccount to MainDrawer.
  • 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.
  • lib/ui/features/sign_up/sign_up_view_model.dart
    • Replaced direct call to AuthRepository with AccountManagementUseCase.

New Files

  • lib/utils/extensions/date_time_extensions.dart
    • Provides a toDDMMYYYY() extension for consistent date formatting.

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_splash target to generate splash screens using flutter_native_splash.
  • 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 AppTheme to include splash-specific attributes like fullscreen and cutout behavior.
  • 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 _processPhoto method used by addPerson and updatePerson.
  • lib/ui/core/ui/images/avatar_form_field.dart
    • Fixed onSaved not being triggered by wiring FormField.didChange correctly.
  • lib/ui/core/ui/images/select_avatar_image.dart
    • Updated property names to match FormField usage; renamed photoPath → value and setImagePath → didChange.
  • lib/ui/core/ui/text_fields/basic_text_field.dart
    • Added support for the readOnly parameter.
  • lib/ui/core/ui/text_fields/select_text_field.dart
    • Added focusNode support and enforced readOnly mode to ensure proper dropdown-like behavior.
  • lib/ui/features/home/person_register/person_resister_page.dart
    • Replaced deprecated save command with add, and fixed avatar field onSaved logic.
    • Improved focus behavior between fields after date selection.
    • Handled role parsing with fallback in case of invalid label.
  • lib/ui/features/home/person_register/person_resister_view_model.dart
    • Renamed command from save to add for clarity and consistency.
  • lib/ui/features/sign_in/sign_in_view_model.dart
    • Cleaned up import statement formatting.
  • lib/utils/commands.dart
    • Renamed completed getter to success for clearer semantics.
  • 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.

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.

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 AuthenticationUserCase with AccountManagementUseCase in provider bindings.
    • Registered new dependencies for RemoteStorageRepository and RemoteStorageService.
    • Renamed ThemeNotifier to ThemeViewModel.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Adjusted import path for AuthService using absolute path.
  • lib/data/repositories/person/person_repository.dart
    • Added abstract method logout() to clear local user data.
  • lib/data/repositories/person/remote_person_repository.dart
    • Implemented the new logout() method to remove local person data and clear cached instance.
  • lib/main_app.dart
    • Replaced ThemeNotifier with ThemeViewModel in dependency access.
  • lib/routing/router.dart
    • Updated all usages of AuthenticationUserCase to AccountManagementUseCase.
    • Replaced ThemeNotifier with ThemeViewModel.
  • lib/ui/core/ui/drawer/main_drawer.dart
    • Conditionally renders account and logout options based on login status.
    • Renamed ThemeNotifier reference to ThemeViewModel.
  • lib/ui/features/app/view_model/theme_notifier.dart → lib/ui/features/app/view_model/theme_view_model.dart
    • Renamed class ThemeNotifier to ThemeViewModel and updated constructor name.
  • lib/ui/features/home/home_page.dart
    • Updated references to ThemeNotifier to use ThemeViewModel.
    • Passed isLoggedIn to MainDrawer.
  • lib/ui/features/home/home_view_model.dart
    • Switched dependency from AuthenticationUserCase to AccountManagementUseCase.
    • Exposed isLoggedIn flag from the use case.
  • lib/ui/features/home/person_register/person_resister_page.dart
    • Replaced usage of SelectAvatarImage with the new AvatarFormField.
    • Adjusted image validation and form integration.
  • lib/ui/features/home/person_register/person_resister_view_model.dart
    • Updated dependency type to AccountManagementUseCase.
    • Adjusted getter names for user and person.
  • lib/ui/features/home/widgets/main_app_bar.dart
    • Updated to use ThemeViewModel instead of ThemeNotifier.

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.

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.dart to renamed file server_names.dart.
  • lib/data/repositories/common/tables.dart → server_names.dart
    • Renamed file for clarity.
    • Split constants into separate Tables and Buckets classes.
  • lib/data/repositories/person/remote_person_repository.dart
    • Adjusted import to match renamed file (server_names.dart).
  • 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.
  • lib/data/repositories/storage/storage_repository.dart
    • Changed all method signatures to accept named parameters.
    • Updated documentation to reflect URL-based design.
    • Modified fetch to 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 createBucket and deleteBucket utilities.
    • 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 setUpAll to setUp to isolate test cases.
    • Replaced legacy import with updated server_names.dart.
  • 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 avatars bucket: insert, update, delete, and optional select metadata for authenticated users.
  • 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.

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 LocalStorageService to LocalDatabaseService.
    • Renamed RemoteStorageService to RemoteDatabaseService.
    • Updated dependency injection accordingly.
  • lib/data/repositories/address/remote_address_repository.dart
    • Renamed internal dependency from LocalStorageService to LocalDatabaseService.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Renamed field from userId to uid in test mock return.
  • lib/data/repositories/common/tables.dart
    • Added avatars as a new storage table constant.
  • lib/data/repositories/person/remote_person_repository.dart
    • Updated constructor and field names to use new LocalDatabaseService and RemoteDatabaseService.
  • lib/data/services/auth_service.dart
    • Replaced references to userId with uid to standardize user identification fields.
  • lib/domain/models/person.dart
    • Made nickname field optional in Person model.
  • lib/domain/models/user_auth.dart
    • Renamed userId to uid in UserAuthLoggedUser, and NotLoggedUser.
  • lib/domain/use_cases/authentication_user_case.dart
    • Updated usage of userAuth.userId to userAuth.uid.
  • lib/ui/features/app/view_model/theme_notifier.dart
    • Updated injected dependency to LocalDatabaseService.
  • lib/ui/features/home/person_register/person_resister_page.dart
    • Integrated success and error feedback using AppSnackBar.
    • Updated field names for uid.
    • Added _onSaved method with feedback and navigation.
  • 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 birthdate column as NOT NULL.
  • test/data/repositories/address/remote_address_repository_integration_test.dart
    • Refactored mock service to implement LocalDatabaseService.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Switched service from RemoteStorageService to RemoteDatabaseService.
    • Updated mocks and setup accordingly.
  • test/data/services/shared_preferences_service_test.dart
    • Renamed tested service to LocalDatabaseService.

New Files

  • lib/data/repositories/storage/remote_storage_repository.dart
    • Implements StorageRepository interface to handle avatar uploads, downloads, updates, and deletions.
  • lib/data/repositories/storage/storage_repository.dart
    • Defines the contract for remote file storage operations using Result types.
  • 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 avatars bucket on Supabase.
  • 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.

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 UCropActivity for image cropping with a custom theme.
  • android/app/src/main/res/values/styles.xml
    • Added a new style Ucrop.CropTheme using AppCompat.Light.NoActionBar.
  • 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 enthusiast role.
    • Added labels and descriptions getters for UI rendering and validation.
  • lib/routing/router.dart
    • Fixed parameter naming from viewModel to personRegisterViewModel.
  • lib/ui/core/ui/images/avatar_image.dart
    • Switched to InkWell for better ripple effect and visual consistency.
    • Added comments clarifying image source (network or local file).
  • lib/ui/core/ui/text_fields/date_text_field.dart
    • Added labelTexthintTextvalidator, and onDatePicked to increase customization.
    • Called onDatePicked when the date is selected.
  • 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 SelectTextField for user role input.
    • Validated all fields and created a Person instance 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.CropTheme with windowOptOutEdgeToEdgeEnforcement to enhance compatibility.
  • lib/ui/core/ui/images/select_avatar_image.dart
    • Implements interactive avatar selection using image_picker and image_cropper.
    • Provides options for selecting an image from the gallery or camera.
  • 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 RemoteStorageServicePersonRepository, and AuthenticationUserCase.
  • lib/data/repositories/auth/auth_repository.dart
    • Renamed getter user to userAuth to better reflect its purpose.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Aligned with userAuth naming convention.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Updated getter from user to userAuth.
    • Assigned fetched user in fetchUser() for consistency.
  • lib/data/repositories/person/remote_person_repository.dart
    • Simplified the initialize method to delegate to fetch.
  • lib/routing/router.dart
    • Injected AuthenticationUserCase into HomeViewModel.
    • Added route for PersonResisterPage.
  • lib/routing/routes.dart
    • Declared route path for /person_register.
  • 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 imagePath parameter optional to support fallback usage.
  • lib/ui/features/home/home_page.dart
    • Replaced signOut with logout command.
    • Implemented logic to prompt person registration via a bottom sheet when missing.
  • lib/ui/features/home/home_view_model.dart
    • Rewritten to use AuthenticationUserCase.
    • Removed direct reference to AuthRepository.
  • lib/ui/features/home/widgets/custom_app_bar.dart → main_app_bar.dart
    • Renamed and refactored to make themeMode optional and safer to use.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Adapted test suite to reflect changes in property naming (userAuth).

New Files

  • lib/domain/use_cases/authentication_user_case.dart
    • Encapsulates logic for login, logout, load, add and update of Person objects.
  • lib/ui/core/ui/editing_controllers/masked_editing_controller.dart
    • TextEditingController subclass that formats input using a digit mask.
  • 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
    • TextField widget for date picking using native platform dialogs.
  • 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_pickerimage_cropper for image selection and cropping.
      • Updated versions of several existing packages (go_routerprovider, etc).
    • Added platform-specific plugins (file_selector_*image_picker_*, etc).

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 Sportsman model.
    • Adjusted entity associations accordingly.
  • lib/domain/enums/enums_declarations.dart
    • Removed sports and affiliation-related enums.
    • Simplified general enums by removing LabeledEnum interface.
    • Kept only non-sports enums like DocTypeUserRoleSex, and Weekday.
  • lib/domain/models/athlete.dart
    • Added a clarifying comment indicating that id corresponds to userId.
  • lib/domain/models/club.dart
    • Migrated the sport field from SportType to the new Sports enum.
    • Adjusted imports to reference the new enums_sports.dart.
  • lib/domain/models/document.dart
    • Removed old local definition of DocType (now centralized in enums_declarations.dart).
  • lib/domain/models/manager.dart
    • Added a clarifying comment indicating that id corresponds to userId.
  • lib/domain/models/person.dart
    • Added a clarifying comment indicating that id corresponds to userId.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Updated the default user role in test data from admin to manager.
  • test/domain/models/club_test.dart
    • Adjusted test imports and values to use the new Sports enum instead of SportType.

New Files

  • lib/domain/enums/enums_sports.dart
    • Created a new file dedicated to sports-related enums.
    • Added a Position abstraction with a byLabel factory constructor.
    • Introduced the SportsAffiliationStatusSoccerPositionBasketballPositionVolleyballPosition, and HandballPosition enums.
  • lib/domain/models/sportman.dart
    • Added the new Sportsman model to represent an athlete’s affiliation to a club, validating sport-position consistency.
  • test/domain/enums/enums_sports_test.dart
    • Added unit tests for Position.byLabel to ensure correct mapping between labels and sports.
  • 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 ChangeNotifier inheritance from AuthRepository to decouple UI reactivity.
    • Removed authService getter to enforce access through composition rather than inheritance.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Removed override and authService property, aligning with updated AuthRepository abstraction.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Now extends ChangeNotifier and implements AuthRepository directly to handle event changes and notify listeners.
    • Added internal AuthEvent state and listener on AuthService events.
    • Implemented dispose method to cancel subscriptions and avoid memory leaks.
  • lib/data/repositories/person/remote_person_repository.dart
    • Fixed typo in constructor parameter from reoteService to remoteService.
    • Updated _person cache after remote update to maintain consistency.
  • lib/data/services/auth_service.dart
    • Removed ChangeNotifier inheritance, shifting to a stream-based reactivity model.
    • Introduced a StreamController to emit AuthEvents to interested subscribers.
    • Updated _onAuthStateChange to dispatch events via StreamController instead of using notifyListeners().
    • Improved resource cleanup in the new asynchronous dispose() method.
  • lib/ui/features/home/home_view_model.dart
    • Removed the authService getter, relying solely on the event property from the repository interface.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Added RemoteService instantiation and usage in the test setup.
    • Updated RemotePersonRepository constructor to match new parameter name and structure.

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 ChangeNotifier inheritance from AuthRepository to decouple UI reactivity.
    • Removed authService getter to enforce access through composition rather than inheritance.
  • lib/data/repositories/auth/dev_auth_repository.dart
    • Removed override and authService property, aligning with updated AuthRepository abstraction.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Now extends ChangeNotifier and implements AuthRepository directly to handle event changes and notify listeners.
    • Added internal AuthEvent state and listener on AuthService events.
    • Implemented dispose method to cancel subscriptions and avoid memory leaks.
  • lib/data/repositories/person/remote_person_repository.dart
    • Fixed typo in constructor parameter from reoteService to remoteService.
    • Updated _person cache after remote update to maintain consistency.
  • lib/data/services/auth_service.dart
    • Removed ChangeNotifier inheritance, shifting to a stream-based reactivity model.
    • Introduced a StreamController to emit AuthEvents to interested subscribers.
    • Updated _onAuthStateChange to dispatch events via StreamController instead of using notifyListeners().
    • Improved resource cleanup in the new asynchronous dispose() method.
  • lib/ui/features/home/home_view_model.dart
    • Removed the authService getter, relying solely on the event property from the repository interface.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Added RemoteService instantiation and usage in the test setup.
    • Updated RemotePersonRepository constructor to match new parameter name and structure.

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 SupabaseClient with the new RemoteService abstraction.
    • Refactored _fetchFromSupabase into _fetchFromRemote using RemoteService.fetch.
    • Updated addupdate, and delete methods to delegate operations to RemoteService.
    • Renamed internal fields to _remoteService and _localService for consistency.

New Files

  • lib/data/services/remote_service.dart
    • Introduced RemoteService, a general-purpose service for interacting with Supabase.
    • Provides methods: fetchfetchListaddupdate, and delete.
    • Includes centralized error handling and logging using Logger.
    • Enhances testability by separating concerns between data access and business logic.

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 ThemeNotifier and logout callback.
    • Included a MainDrawerHeader and a logout ListTile.
  • lib/ui/features/home/home_page.dart
    • Added MainDrawer to the Scaffold using drawer: property.
  • pubspec.yaml
    • Added cached_network_image as a dependency.
  • pubspec.lock
    • Added dependency entries for cached_network_image and its transitive dependencies.
    • Includes additional packages like flutter_cache_managerocto_image, and sqflite, likely required by cached_network_image.

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
    • AvatarImage widget 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 @latest for dynamic version usage.
  • analysis_options.yaml
    • Enabled prefer_const_constructors and prefer_const_literals_to_create_immutables for better performance and consistency.
  • lib/config/dependencies.dart
    • Replaced synchronous dependencies list with asynchronous createDependencies() function.
    • Registered ThemeNotifier and LocalStorageService in the provider tree.
  • lib/data/repositories/*
    • Updated references from SharedPreferencesService to LocalStorageService.
    • Renamed parameters and fields accordingly across multiple repository classes.
    • Introduced const usage for Result wrappers and UUID constructor.
  • lib/data/services/auth_service.dart
    • Standardized usage of const Result.success(null).
  • 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 ThemeNotifier with ListenableBuilder to dynamically switch between light and dark themes.
  • lib/routing/router.dart
    • Passed ThemeNotifier to HomePage.
  • lib/ui/core/theme/fonts.dart
    • Made all TextStyle declarations const.
  • lib/ui/core/ui/buttons/
    • Applied const constructors where applicable.
  • lib/ui/core/ui/messages/app_snack_bar.dart
    • Made the Divider constant.
  • lib/ui/features/home/home_page.dart
    • Replaced AppBar with a reusable CustomAppBar widget.
    • Included ThemeNotifier in the constructor.
  • lib/ui/features/sign_in/sign_in_page.dart
    • Added const to AppBar and Icon.
  • lib/ui/features/sign_up/sign_up_page.dart
    • Updated AppBar title to use const.
  • test/data/repositories/*
    • Updated test implementations to use LocalStorageService in place of SharedPreferencesService.
  • test/domain/models/club_test.dart & schedule_test.dart
    • Made TimeOfDay constructors const.

New Files

  • lib/ui/features/app/view_model/theme_notifier.dart
    • Implements a ChangeNotifier that manages the theme state using a key-value storage.
  • 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 AppBar with dynamic icon for theme toggling using ThemeNotifier.

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 addressesList in UnmodifiableListView to enforce immutability.
    • Enhanced initialize to optionally force remote fetch even if local data is available.
    • Enhanced fetch to support the forceRemote flag.
    • Improved internal logic for more consistent and flexible address data retrieval.
  • lib/data/services/shared_preferences_service.dart
    • Documented the getKeys method to clarify its purpose and expected usage.
  • lib/domain/models/address.dart
    • Corrected field mapping in fromMap from person_id to user_id to match the actual database schema.
  • test/data/repositories/address/remote_address_repository_integration_test.dart
    • Updated userId used in tests to reflect active Supabase records.
    • Expanded the existing test to cover the entire lifecycle:
      • add an address
      • fetch from cache
      • fetch from Supabase with forceRemote
      • update address and verify persisted values
      • delete and verify deletion
    • Added placeholder for future test on initialize() logic.
  • test/data/repositories/person/remote_person_repository_integration_test.dart
    • Aligned test userId with new sample data used across tests for consistency.

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 get to fetch for consistency across all repositories.
    • Added a new class diagram for RemotePersonRepository and the Address model.
  • lib/data/repositories/common/tables.dart
    • Added the address table constant.
  • lib/data/repositories/person/person_repository.dart
    • Added documentation for all CRUD operations and introduced the new initialize method.
  • lib/data/repositories/person/remote_person_repository.dart
    • Added initialization logic via initialize.
    • Implemented local cache fallback with _fetchFromLocal and _fetchFromSupabase.
    • Added and documented _cachePerson helper for shared preferences.
    • Improved error handling and internal state consistency using _started flag.
  • lib/data/services/shared_preferences_service.dart
    • Introduced getKeys(String prefix) to retrieve all keys under a namespace.
  • lib/domain/models/address.dart
    • Replaced personId with userId to align with Supabase schema.
    • Updated field names to snake_case to match Supabase column names.
    • Added toJsonString() and fromJsonString() methods for local caching.
  • pubspec.lock & pubspec.yaml
    • Added the uuid package to support ID generation for addresses.
    • Included new transitive dependencies fixnum and sprintf.
  • supabase/migrations/20250416131951_create_person_table.sql → 20250417191646_create_person_table.sql
    • Renamed and updated person table migration to explicitly reference auth.users(id).

New Files

  • lib/data/repositories/address/address_repository.dart
    • Declares the AddressRepository abstract class with methods for initialize, fetch, add, update, and delete.
  • lib/data/repositories/address/remote_address_repository.dart
    • Implements RemoteAddressRepository using Supabase and SharedPreferences.
    • Provides full address lifecycle management with local cache fallback.
  • supabase/migrations/20250417191633_create_address_table.sql
    • Creates the address table with RLS and policies to restrict access by auth.uid().
  • 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.

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.
  • 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.dart with person_repository.dart.
  • lib/ui/features/home/home_view_model.dart
    • Updated import path to use auth_repository.dart.
  • lib/ui/features/sign_in/sign_in_view_model.dart
    • Updated dependency from abstract_auth_repository.dart to auth_repository.dart.
  • 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 Club class:
      • Verifies correct field mapping in toMap.
      • Ensures accurate reconstruction via fromMap.
      • Validates JSON round-trip behavior with toJson and fromJson.
  • test/domain/models/schedule_test.dart
    • Introduced tests for both OperatingDay and Schedule:
      • Confirms correct map serialization and deserialization.
      • Ensures JSON round-trip reliability for OperatingDay.
      • Tests selective inclusion of non-null days in Schedule.

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.
  • Makefile
    • Prevented push and push_branch on main or master branches.
    • Updated test_coverage to run with --concurrency=1.
    • Added test_serial task aliasing test_coverage.
  • lib/domain/enums/enums_declarations.dart
    • Replaced SportType.rugby with SportType.handball.
  • lib/domain/models/athlete.dart
    • Replaced personIddocument, and sports with a unified cpfDoc field using the new Document class.
    • Updated serialization methods to use snake_case and ISO strings.
    • Added toJson(), equality operator, and hashCode.
  • lib/domain/models/manager.dart
    • Replaced multiple document fields with cpfDoc and secondDoc.
    • Refactored serialization to align with new structure and snake_case keys.
    • Implemented toJson(), equality operator, and hashCode.
  • 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() and fromJson() to toJsonString() and fromJsonString() for consistency.
  • lib/ui/features/sign_in/sign_in_page.dart
    • Updated validation import path from utils/validate.dart to utils/validates/sign_validate.dart.
  • 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), and delete() with verification.

New Files

  • lib/domain/models/club.dart
    • Created the Club class with properties such as manager, sport type, address, location, schedule, and monthly fee.
    • Includes full serialization, equality, and copy support.
  • lib/domain/models/document.dart
    • Introduced Document class with enum DocType for CPF, RG, CNPJ, and CNH.
    • Supports validation, serialization, and equality.
  • 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_restart command for quick CLI server restarts.
  • lib/data/repositories/person/abstract_person_repository.dart
    • Renamed method get() to fetch() for consistency with repository terminology.
  • lib/data/repositories/person/remote_person_repository.dart
    • Implemented caching logic via SharedPreferencesService.
    • Rewrote fetchaddupdate, and delete to incorporate local cache handling.
    • Added logging and improved error traceability.
    • Created private method _cachePerson().
  • lib/data/services/auth_service.dart
    • Renamed internal variable _supabase to _supabaseClient for clarity.
    • Updated all usage accordingly.
  • lib/data/services/shared_preferences_service.dart
    • Redesigned with setStringgetString, and remove methods using consistent Result wrappers.
    • Enhanced logging and error handling.
  • 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() to toJsonString()/fromJsonString() for consistency.
  • lib/domain/models/schedule.dart
    • Updated import to match renamed operating_day.dart.
  • pubspec.yaml
    • Bumped version to 0.10.02+12.
    • Added mocktail and test dependencies for unit testing.
  • supabase/migrations/20250416131951_create_person_table.sql
    • Fixed column names: createdAt → created_atupdatedAt → updated_at to match Dart model changes.

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.
  • test/data/services/shared_preferences_service_test.dart
    • Unit tests for SharedPreferencesService:
      • Validates setStringgetStringremove.
      • Tests retrieval of non-existent keys.

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 .gitignoreREADME.md, and Makefile have been updated for improved workflow and documentation.

Modified Files

  • .gitignore
    • Added .secrets and backup files for .drawio to avoid committing sensitive and temporary data.
  • Makefile
    • Pinned supabase CLI commands to version 2.20.12 to ensure consistency across environments.
  • 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 collaborator role (commented out for now).
    • Adjusted none role description for clarity.
  • lib/domain/models/person.dart
    • Fully implemented the Person model with:
      • Additional fields (phonerole)
      • Serialization methods (toMapfromMaptoJsonfromJson)
      • copyWithtoString, equality and hash overrides for robust model handling.

New Files

  • lib/data/repositories/common/tables.dart
    • Centralized table name definitions; currently includes 'person'.
  • lib/data/repositories/person/abstract_person_repository.dart
    • Interface definition for the PersonRepository.
  • lib/data/repositories/person/remote_person_repository.dart
    • Concrete implementation of PersonRepository using Supabase client for CRUD operations.
    • Includes logging and error handling.
  • supabase/migrations/20250416131951_create_person_table.sql
    • Supabase SQL migration to:
      • Create the person table with appropriate fields and constraints.
      • Enable row-level security.
      • Define RLS policies for read, insert, and update access tied to authenticated users.

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 id with userId to match UserAuth class refactor.
  • lib/data/repositories/auth/remote_auth_repository.dart
    • Updated method call from signInWithPassword() to signIn() to match new method naming.
  • lib/data/services/auth_service.dart
    • Renamed start() to initialize() for clearer intent.
    • Renamed method signInWithPassword() to signIn().
    • Updated LoggedUser instantiation to use userId instead of id.
  • lib/domain/models/user_auth.dart
    • Replaced id field with userId to clarify user identifier semantics.
    • Updated constructors, copyWith methods, and toString accordingly for LoggedUser and NotLoggedUser.
  • lib/main.dart
    • Adjusted call from AuthService.start() to AuthService.initialize().
  • lib/ui/features/home/home_page.darthome_view_model.dartsign_in_page.dart
    • Minor formatting and removal of commented-out code.
  • lib/utils/commands.dart
    • Commented out notifyListeners() in clearResult() method.
  • test/data/repositories/auth/remote_auth_repository_test.dart
    • Updated test call from start() to initialize() to reflect method rename.
  • test/data/services/supabase_auth_service_test.dart
    • Updated usage of signInWithPassword() to signIn().
    • Renamed AuthService.start() to initialize().

New Files

  • lib/domain/models/operatingDay
    • Defines the OperatingDay class representing a single day’s open and close time using TimeOfDay.
    • Includes extension and utility functions to convert to/from seconds.
  • lib/domain/models/schedule.dart
    • Introduces the Schedule class to manage weekly business hours via optional OperatingDay fields for each weekday.
    • Includes methods for serialization, deserialization, and deep copy.

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:

  1. lib/config/dependencies.dart:
    • Replaced SupabaseAuthService with the renamed AuthService.
    • Updated provider registration to reflect the new service name.
  2. lib/data/repositories/auth/abstract_auth_repository.dart:
    • Added authService and event getters to the abstract repository to expose authentication state and service.
  3. lib/data/repositories/auth/dev_auth_repository.dart:
    • Injected AuthService into the DevAuthRepository and implemented the new required getters.
  4. lib/data/repositories/auth/remote_auth_repository.dart:
    • Updated to use AuthService instead of SupabaseAuthService.
    • Removed internal fetchUser call from constructor.
    • Added support for authService and event properties.
  5. lib/data/services/supabase_auth_service.dart → lib/data/services/auth_service.dart:
    • Renamed file and class from SupabaseAuthService to AuthService.
    • Refactored event logging for better clarity.
    • Improved session handling by printing ‘opened’ or ‘closed’ instead of raw session.
  6. lib/main.dart:
    • Updated import and initialization call from SupabaseAuthService to AuthService.
  7. lib/ui/core/theme/dimens.dart:
    • Added paddingScreenAll to encapsulate consistent edge spacing.
    • Applied new spacing in mobile and desktop implementations.
  8. 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.
  9. lib/ui/features/home/home_page.dart:
    • Added disposal of listener in dispose() to avoid memory leaks.
  10. lib/ui/features/home/home_view_model.dart:
    • Exposed authService and event via the view model for external access.
  11. lib/ui/features/sign_in/sign_in_page.dart:
    • Applied AppSnackBar for user feedback on failed sign-in.
    • Updated error message logic to differentiate known from unknown errors.
    • Cleaned up padding and interaction logic using Dimens constants.
  12. lib/ui/features/sign_up/sign_up_page.dart:
    • Replaced raw SnackBar with AppSnackBar for better consistency.
    • Enhanced error handling with contextual messages.
    • Adjusted onEditingComplete and validation flow for improved UX.
  13. pubspec.yaml:
    • Updated version from 0.0.1+08 to 0.01.00+09.
  14. test/data/repositories/auth/remote_auth_repository_test.dart:
    • Replaced SupabaseAuthService with AuthService in test setup and logic.
  15. test/data/services/supabase_auth_service_test.dart:
    • Renamed imports and instantiations to use AuthService throughout the integration tests.

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:

  1. assets/images/sports_logo.png:
    • Added new image asset for the sports logo.
  2. assets/images/sports_splash.png:
    • Added new image asset for the splash screen.
  3. lib/config/dependencies.dart:
    • Created a new dependency injection file using Provider for SupabaseAuthService and RemoteAuthRepository.
  4. lib/data/repositories/auth/abstract_auth_repository.dart:
    • Added a new abstract method fetchUser to retrieve the authenticated user.
  5. lib/data/repositories/auth/dev_auth_repository.dart:
    • Implemented the new fetchUser method returning a mocked LoggedUser.
  6. lib/data/repositories/auth/remote_auth_repository.dart:
    • Implemented fetchUser using the SupabaseAuthService.
  7. 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 fetchUser to Result<LoggedUser>.
    • Added validation for initialized session in fetchUser.
  8. lib/main.dart:
    • Wrapped MainApp in a MultiProvider using the new dependencies list.
  9. lib/main_app.dart:
    • Changed app theme from light to dark.
  10. lib/routing/router.dart:
    • Replaced manual repository instantiations with context.read() using Provider.
    • Updated initial route to the splash screen.
    • Injected SplashViewModel with dependency.
  11. lib/ui/core/theme/dimens.dart:
    • Added radius getter to unify border radius access.
    • Refactored borderRadius getters in both mobile and desktop classes to use radius.
  12. lib/ui/core/ui/buttons/big_button.dart:
    • Removed hardcoded icon dependency.
    • Simplified icon rendering using the widget’s iconData.
  13. lib/ui/core/ui/messages/app_snack_bar.dart:
    • Introduced a reusable AppSnackBar utility for showing stylized SnackBars.
  14. lib/ui/features/home/home_page.dart:
    • Replaced dummy sign-out logic with actual sign-out result handling using AppSnackBar for error feedback.
  15. lib/ui/features/sign_in/sign_in_page.dart:
    • Refactored _onLogin to use result.fold() for better control and feedback handling.
  16. lib/ui/features/sign_up/sign_up_page.dart:
    • Renamed passwordFocusNode and confirmPasswordFocusNode to _passwordFocusNode and _confirmPasswordFocusNode for encapsulation.
    • Adjusted focus handling logic accordingly.
    • Extended SnackBar display duration on successful sign-up.
  17. lib/ui/features/splash/splash_page.dart:
    • Converted SplashPage from StatelessWidget to StatefulWidget.
    • Added logic to fetch user on init and navigate accordingly to home or sign-in.
    • Improved visual design with logo and themed text.
  18. lib/ui/features/splash/splash_view_model.dart:
    • Refactored SplashViewModel to include a command-based fetchUser method.
    • Added logging for success and error cases in fetchUser.
  19. pubspec.yaml:
    • Added provider as a dependency.
    • Declared assets/images/ in the Flutter assets section.

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:

  1. lib/data/repositories/auth/abstract_auth_repository.dart:
    • Refactored import statements to use relative paths for consistency.
  2. lib/data/repositories/auth/dev_auth_repository.dart:
    • Updated import statements to relative paths.
  3. lib/data/services/supabase_auth_service.dart:
    • Added artificial delays (Future.delayed) in signUpsignInWithPasswordsignOutupdatePassword, and updateUserPhone methods to simulate realistic request latency.
  4. lib/routing/router.dart:
    • Injected HomeViewModel into the HomePage using RemoteAuthRepository and SupabaseAuthService.
  5. lib/ui/core/ui/buttons/big_button.dart:
    • Converted BigButton from StatelessWidget to StatefulWidget.
    • Replaced the optional icon parameter with iconData and isRunning.
    • Added a dynamic internal icon that switches between loading indicator and an icon based on isRunning.
  6. lib/ui/features/home/home_page.dart:
    • Injected HomeViewModel through constructor.
    • Added logout logic using signOut command.
    • Connected the logout button to execute signOut.
  7. lib/ui/features/home/home_view_model.dart:
    • Created HomeViewModel class.
    • Implemented signOut command with logging on success and failure.
  8. lib/ui/features/sign_in/sign_in_page.dart:
    • Added form key to enable validation.
    • Updated BigButton to use the new iconData and isRunning parameters via ListenableBuilder.
    • Wrapped _signIn logic with validation and running checks to avoid multiple submissions.
  9. lib/ui/features/sign_in/sign_in_view_model.dart:
    • Marked signIn as final and ensured immutability.
  10. lib/ui/features/sign_up/sign_up_page.dart:
    • Updated validation to use SignValidate.
    • Replaced direct icon widget in BigButton with iconData and isRunning, using ListenableBuilder.
    • Wrapped _signUp method with validation and running checks.
  11. lib/ui/features/sign_up/sign_up_view_model.dart:
    • Marked signUp as final for consistency.
  12. lib/utils/validate.dart:
    • Renamed Validate class to SignValidate to improve clarity and avoid future naming conflicts.

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:

  1. .env:
    • Updated the Supabase URL from 127.0.0.1 to a local network IP 192.168.0.22.
  2. lib/routing/router.dart:
    • Refactored imports for better readability.
    • Injected SignUpViewModel into the SignUpPage using RemoteAuthRepository and SupabaseAuthService.
  3. lib/ui/features/sign_in/sign_in_page.dart:
    • Refactored import of sign_in_view_model.dart to a relative path.
    • Updated SignInViewModel usage: replaced login with signIn in listeners and method calls to reflect updated naming.
    • Minor formatting fix in BasicTextField props order.
  4. lib/ui/features/sign_in/sign_in_view_model.dart:
    • Renamed command from login to signIn to improve clarity.
    • Renamed internal method _login to _signIn.
    • Updated logger name from LoginViewModel to SignInViewModel.
  5. lib/ui/features/sign_up/sign_up_page.dart:
    • Injected SignUpViewModel into 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 SignUpViewModel via listener.
    • Implemented input validation using Validate.
    • Added logic to show a SnackBar and navigate after successful sign-up.
    • Refactored BigButton to show a loading indicator when the command is running.
    • Improved UX with password match validation and async flow control.
  6. lib/ui/features/sign_up/sign_up_view_model.dart:
    • Created a new SignUpViewModel class.
    • Implemented signUp command using Command1 to encapsulate sign-up logic and handle result logging.
  7. lib/utils/validate.dart:
    • Added a new method confirmPassword to check if confirmation matches the original password.

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:

  1. devtools_options.yaml:
    • Created a new configuration file to store Dart & Flutter DevTools settings.
  2. lib/data/repositories/auth/remote_auth_repository.dart:
    • Changed the return type of the login method from Result<void> to Result<LoggedUser>.
    • Refactored the login logic using fold to handle success and failure cases more explicitly.
  3. lib/main_app.dart:
    • Changed the app theme from theme.dark() to theme.light() in MaterialApp.router.
  4. lib/routing/router.dart:
    • Corrected typo in route paths from singIn and singUp to signIn and signUp.
    • Modified the sign-in route to provide a SignInViewModel with an injected RemoteAuthRepository.
    • Updated the sign-up route to render the correct SignUpPage.
  5. lib/routing/routes.dart:
    • Corrected route constants from singIn and singUp to signIn and signUp.
  6. lib/ui/core/theme/dimens.dart:
    • Increased the default border radius from 12 to 50 in _DimensMobile.
  7. lib/ui/core/ui/buttons/big_button.dart:
    • Simplified the button layout by removing unnecessary padding.
    • Adjusted alpha value in backgroundColor for better visual emphasis.
    • Used dimens.spacingHorizontal for spacing between elements.
  8. lib/ui/core/ui/buttons/text_row_button.dart:
    • Added a new TextRowButton widget to align text and a text button in a row, with optional action.
  9. lib/ui/core/ui/text_fields/basic_text_field.dart:
    • Created a reusable BasicTextField widget encapsulating common TextFormField configurations.
    • Added automatic validation mode activation when text is entered.
  10. lib/ui/core/ui/text_fields/secret_text_field.dart:
    • Added a SecretTextField widget based on BasicTextField, with a visibility toggle icon for password input.
  11. lib/ui/features/home/home_page.dart:
    • Updated the AppBar icon to use Symbols.dark_mode_rounded.
  12. lib/ui/features/sign_in/sign_in_page.dart:
    • Refactored to use SignInViewModel with reactive command execution.
    • Replaced raw TextFormField usage with BasicTextField and SecretTextField.
    • Added new UI components: fingerprint authentication icon, route navigation to sign-up, and password recovery.
    • Enhanced styling using colorScheme and Dimens.
  13. lib/ui/features/sign_in/sign_in_view_model.dart:
    • Added SignInViewModel class with Command1 to execute the login process.
    • Implemented detailed logging for success and failure scenarios.
  14. lib/ui/features/sign_up/sign_up_page.dart:
    • Implemented the complete sign-up UI using BasicTextField and SecretTextField.
    • Added navigation to login page and basic layout structure.
  15. lib/utils/commands.dart:
    • Fixed typo in method name from excute to execute in Command1.
  16. lib/utils/validate.dart:
    • Added email and password validation logic using regular expressions.
    • Created a Validate utility class to encapsulate form validation rules.
  17. pubspec.lock:
    • Updated lockfile with new dependencies including material_symbols_iconsargschalkdart, and glob.
  18. pubspec.yaml:
    • Added material_symbols_icons package to dependencies.

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:

  1. android/app/build.gradle.kts
    • Set ndkVersion explicitly to "27.0.12077973" for compatibility and stability across environments.
  2. lib/main.dart
    • Removed MainApp widget from main.dart, delegating it to its own file main_app.dart.
  3. lib/main_app.dart (new)
    • Introduced MainApp widget as a StatefulWidget with custom theming.
    • Dynamically applies dark mode theme with custom MaterialTheme.
  4. lib/routing/router.dart
    • Changed initialLocation to Routes.singIn (presumably a login screen).
    • Cleaned up import paths using relative imports.
  5. 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 (Quicksand and Assistant).
      • dimens.dart: responsive paddings, spacings and radius for mobile and desktop.
      • util.dart: generates TextTheme from Google Fonts dynamically.
  6. lib/ui/core/ui/buttons/big_button.dart (new)
    • Introduced a reusable BigButton component with custom color, shape, and optional icon.
  7. lib/ui/features/sign_in/sign_in_page.dart
    • Replaced Placeholder with a fully implemented sign-in form using Dimens and BigButton.
    • Styled input fields and button using the new theme system.
  8. pubspec.yaml
    • Added dependency on google_fonts: ^6.2.1.
  9. pubspec.lock
    • Updated lockfile to reflect new dependency on google_fonts.

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:

  1. lib/data/repositories/auth/abstract_auth_repository.dart:
    • Renamed from auth_repository.dart to reflect its role as an abstract base class.
  2. lib/data/repositories/auth/dev_auth_repository.dart:
    • Updated import path to reference the renamed abstract_auth_repository.dart.
  3. lib/data/repositories/auth/remote_auth_repository.dart:
    • Updated import path to reference the renamed abstract_auth_repository.dart.
  4. lib/domain/enums/enums_declarations.dart:
    • Created a new file defining multiple domain enums:
      • DocumentTypeUserRoleSexSoccerPositionAffiliationStatusWeekdaySportType, and MessageCategories.
    • Included LabeledEnum interface and extension EnumExtension for utility mapping.
  5. lib/domain/models/address.dart:
    • Introduced Address model with full toMap/fromMap serialization support and copyWith method.
  6. lib/domain/models/athlete.dart:
    • Created Athlete model with personal details, document, sports list, and address relation.
    • Includes serialization and copy functionality.
  7. lib/domain/models/manager.dart:
    • Created Manager model similar to Athlete, with two documents and sport tracking.
  8. lib/domain/models/person.dart:
    • Defined Person model representing a general user with profile and address references.
  9. lib/domain/models/user_auth.dart:
    • Extended UserAuth base class to include optional phone field.
    • Preserved backward compatibility via default parameters.
  10. lib/utils/result.dart:
    • Annotated Success.value and Failure.error with @override to clarify their behavior from the abstract base.

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:

  1. .env:
    • Added commented environment variables for the hosted Supabase instance to support multiple environments.
  2. Makefile:
    • Added rebuild command to clean and restore Flutter dependencies.
    • Added test_coverage command to run tests and generate coverage report.
  3. coverage/lcov.info:
    • Added test coverage data file generated from unit tests.
  4. lib/data/services/supabase_auth_service.dart:
    • Introduced SupabaseAuthService to replace SupabaseService.
    • Implemented full authentication flow: initialization, sign up, sign in, sign out, password recovery, and user updates.
    • Added internal auth state listener and custom AuthEvent enum.
  5. lib/data/services/supabase_service.dart:
    • Deleted legacy SupabaseService, which is now fully replaced by SupabaseAuthService.
  6. lib/main.dart:
    • Updated to load environment variables using flutter_dotenv.
    • Replaced SupabaseService with SupabaseAuthService.
    • Added example authentication flow with debug prints for success and failure cases.
  7. lib/utils/result.dart:
    • Extended Result<T> with value and error getters for easier access to result contents.
  8. test/data/services/.env_test_supabase:
    • Added a separate environment file for local Supabase CLI testing.
  9. 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.

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:

  1. .env:
    • Added environment variables for local Supabase CLI usage, including URL and AnonKey.
  2. .vscode/extensions.json:
    • Added VSCode extension recommendation for denoland.vscode-deno.
  3. .vscode/settings.json:
    • Configured Deno support and linting for supabase/functions.
  4. Makefile:
    • Added custom Makefile commands to start/stop Supabase CLI, generate diffs, and push commits.
  5. android/app/src/main/AndroidManifest.xml:
    • Added permission to allow internet access in the Android application.
  6. lib/data/repositories/auth/auth_repository.dart:
    • Created abstract class AuthRepository with methods for authentication logic: loginlogoutsignUp, and isAuthenticated.
  7. lib/data/repositories/auth/dev_auth_repository.dart:
    • Implemented DevAuthRepository, a mock implementation of AuthRepository for development purposes.
  8. lib/data/repositories/auth/remote_auth_repository.dart:
    • Created RemoteAuthRepository as a stubbed implementation of AuthRepository for future remote integration.
  9. lib/data/services/shared_preferences_service.dart:
    • Added SharedPreferencesService to handle storing and retrieving tokens using shared preferences.
  10. lib/data/services/supabase_service.dart:
    • Created SupabaseService with methods for initialization, user sign-up, sign-in with password, and sign-out.
  11. lib/domain/dto/credentials.dart:
    • Introduced Credentials class to encapsulate email and password used for authentication.
  12. lib/domain/models/user_auth.dart:
    • Created a sealed class UserAuth with two implementations: LoggedUser and NotLoggedUser, to represent authentication states.
  13. lib/main.dart:
    • Modified main function to initialize SupabaseService before running the app.
    • Added call to sign out the user during app initialization.
  14. linux/flutter/generated_plugin_registrant.cc:
    • Registered new plugins: GtkPlugin and UrlLauncherPlugin.
  15. linux/flutter/generated_plugins.cmake:
    • Included gtk and url_launcher_linux in the plugin list.
  16. pubspec.yaml:
    • Simplified and cleaned up comments.
    • Set version to 0.0.1+1.
    • Added new dependencies: shared_preferencesloggingsupabase_flutter, and flutter_dotenv.
    • Included .env file in asset list.
  17. supabase/.gitignore:
    • Added ignore rules for Supabase-generated files and dotenv local environment files.
  18. 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.