Sports Changelog
2025/06/12 branch club_section-02
Add URL Schemes, Enhance Club Details UI, and Display Distances in Favorites
This commit enables SMS, telephone, and custom tab queries on Android and iOS, integrates url_launcher
for opening club addresses in maps, refactors the Club Details view into a stateful widget with improved layout and actions, and augments the Favorites screen to show distance for each club. It also exposes club-distance data in the ViewModel and adds the url_launcher
dependency.
Modified Files
- android/app/src/main/AndroidManifest.xml
- added
<queries>
entries forsms
,tel
, andandroid.support.customtabs.action.CustomTabsService
- added
- ios/Runner/Info.plist
- added
LSApplicationQueriesSchemes
array containingsms
andtel
- added
- lib/domain/use_cases/fav_club_user_case.dart
- replaced
_nearbyClubIds
list with_clubDisList
ofClubDistance
- exposed
clubDisList
andnearbyClubsIds
getters - updated
nearbyClubs
to usenearbyClubsIds
- cleared
_clubDisList
at start offetchNearbyClubs
- populated
_clubDisList
with distances from repository
- replaced
- 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
andDimens
- converted to
- lib/ui/view/home/fav_clubs/fav_clubs_view.dart
- imported GoRouter for navigation
- calculated distance in kilometers using
viewModel.clubDistanceOf
- appended distance text under each club’s description
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
- imported
ClubDistance
DTO - exposed
clubDisList
andclubDistanceOf(String)
helper
- imported
- pubspec.yaml
- added
url_launcher: ^6.3.1
under dependencies
- added
- pubspec.lock
- marked
url_launcher
as a direct main dependency
- marked
Conclusion
All platforms now support SMS, phone, and in-app browser queries, club address links open in maps, and the UI presents club distances clearly in the favorites list.
2025/06/12 branch club_section-01
Standardize Service Imports and Extend ClubRepository with Bulk Fetch
This commit reorganizes import paths for consistency, replacing service folder references to use the new data/services/...
structure. It also enhances ClubRepository
by introducing a fetchByIds
method for bulk retrieval and caching of clubs by ID.
Modified Files
- lib/config/dependencies.dart
- updated import paths for database, storage, cache, and viacep services to reflect relocated service directories
- lib/data/repositories/address/address_repository.dart
- adjusted cache and database service imports to
../../services/...
- adjusted cache and database service imports to
- lib/data/repositories/auth/auth_repository.dart
- fixed cache service import path
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- corrected database and cache service import paths
- lib/data/repositories/clubs/club_repository.dart
- changed service imports to the new
../../services/...
layout - added
fetchByIds(List<String> ids)
to load and cache multiple clubs from remote database - renamed internal
cacheClubList
to_cacheClubList
and made it private
- changed service imports to the new
- lib/data/repositories/clubs/i_club_repository.dart
- removed
cacheClubList
from interface - declared
Future<Result<void>> fetchByIds(List<String> ids)
in interface
- removed
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- updated service import paths
- lib/data/repositories/functions/functions_repository.dart
- replaced inline
LastSearched
DTO with import of/domain/dto/last_search.dart
and/domain/dto/club_distance.dart
- changed
fetchNearbyClubs
to returnClubDistance
list and updated caching logic accordingly
- replaced inline
- lib/data/repositories/functions/i_functions_repository.dart
- updated return type to
Result<List<ClubDistance>>
and clarified method docs
- updated return type to
- lib/data/repositories/geocoding/geocoding_repository.dart
- adjusted cache service import path
- lib/data/repositories/schedule/schedule_repository.dart
- updated database and cache service import paths
- lib/data/repositories/storage/storage_repository.dart
- fixed storage service import path
- lib/data/repositories/user/user_repository.dart
- corrected database and cache service import paths
- lib/data/repositories/viacep/viacep_repository.dart
- updated viacep service import path
- lib/data/services/cache_database/cache_service.dart
- moved
cache_service
and updated import to locali_cache_service.dart
- moved
- lib/data/services/cache_database/i_cache_service.dart
- path unchanged, now under
cache_database
- path unchanged, now under
- lib/data/services/database/database_service.dart
- renamed and relocated file, updated
i_database_service.dart
import - implemented
fetchByIds<T>
method that queries byid in [...]
, converts WKB to WKT, and maps results
- renamed and relocated file, updated
- lib/data/services/database/i_database_service.dart
- declared
Future<Result<List<T>>> fetchByIds<T>(...)
in interface
- declared
- lib/data/services/functions/functions_service.dart
- adjusted imports, replaced manual WKB mapping with
ClubDistance.fromMap
for function results
- adjusted imports, replaced manual WKB mapping with
- lib/data/services/functions/i_functions_service.dart
- updated return type to
Result<List<ClubDistance>>
forfetchNearbyClubs
- updated return type to
- lib/data/services/storage/storage_service.dart
- relocated and updated import for
i_storage_service.dart
- relocated and updated import for
- lib/data/services/viacep/i_viacep_service.dart
- moved interface file under
viacep
directory
- moved interface file under
- lib/data/services/viacep/viacep_service.dart
- relocated service implementation and updated import
New Files
- lib/domain/dto/club_distance.dart Data-transfer object representing a club ID and its distance in meters
- lib/domain/dto/last_search.dart DTO capturing the last searched location and radius for caching
- test/ All repository and service tests updated import paths; no new test files added
Conclusion
Import paths are now consistent and ClubRepository
supports efficient bulk fetching and caching of clubs by ID. All services and interfaces have been updated accordingly.
2025/06/11 version: 0.22.05+80
Refactor Club Caching, Location Services, and Favorite Clubs Workflows
This commit enhances club data caching, streamlines geolocation handling, and refactors the favorite clubs feature. It replaces string-based schedules with JSON serialization, introduces CoordLocation
for coordinates, adds in-memory caching for nearby searches, and updates the UI to leverage the new view model methods.
Modified Files
- lib/data/repositories/clubs/club_repository.dart
- removed deprecated schedule handling and
_saveLocal
in favor of_cacheClub
- introduced
clubFromCacheById
andcacheClubList
methods for direct cache access - replaced local cache updates to use
_cacheClub
consistently in add/update flows - simplified cache deserialization to drop
Schedule.fromString
- removed deprecated schedule handling and
- lib/data/repositories/clubs/i_club_repository.dart
- added
cacheClubList
andclubFromCacheById
to the interface
- added
- 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
- created
- 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
- switched to accept
- lib/data/services/functions/i_functions_service.dart
- updated method signature to require
CoordLocation
- updated method signature to require
- lib/data/services/geolocator/geolocator_service.dart
- changed
currentPosition
to returnCoordLocation
instead ofPosition
- changed
- lib/data/services/geolocator/i_geolocator_service.dart
- updated interface to reflect
CoordLocation
return type
- updated interface to reflect
- lib/domain/models/club.dart
- removed
scheduleString
field and legacy parsing logic - adjusted
toMap
/fromMap
to use JSON-serialized schedule
- removed
- lib/domain/models/coord_location.dart
- added model for geographic coordinates with
copyWith
- added model for geographic coordinates with
- lib/domain/models/schedule.dart
- eliminated
fromString
factory and obsolete code - retained
toJson
/fromJson
for schedule serialization
- eliminated
- lib/domain/use_cases/fav_club_user_case.dart
- dropped schedule repository dependency and related calls
- added
_nearbyClubIds
tracking andnearbyClubs
getter - invoked
cacheClubList
and populated_nearbyClubIds
after fetch
- lib/routing/router.dart
- removed unused
scheduleRepository
injection
- removed unused
- lib/ui/view/clubs/register_club/register_club_view.dart
- removed obsolete
scheduleString
assignment when registering a club
- removed obsolete
- 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
- bound view to new
- lib/ui/view/home/fav_clubs/fav_clubs_viewmodel.dart
- exposed
nearbyClubs
getter from user case
- exposed
- test/domain/models/club_test.dart
- updated test to include Thursday in
Schedule
and verify JSON round-trip
- updated test to include Thursday in
- test/domain/models/schedule_test.dart
- commented out obsolete
fromString
tests
- commented out obsolete
New Files
- lib/ui/view/home/fav_clubs/widgets/select_distance.dart dialog widget to choose maximum search distance for nearby clubs
- supabase/migrations/20250611203353_update_clubs_table3.sql renames
schedule_string
column toschedule
inpublic.clubs
- supabase/migrations/20250611204108_update_clubs_function_update.sql rebuilds
get_clubs_within_radius
function to returnschedule
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/...
tolib/ui/view/...
forFavClubsViewModel
, 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.
- Changed all imports from
Conclusion
All page components now reside under ui/view
, and the router is aligned with these paths—navigation should work seamlessly with the reorganized structure.
2025/06/11 version: 0.22.05+80
Replace FavClubsPage with FavClubsView in HomeView
This commit updates the HomeView to use the new FavClubsView component instead of the deprecated FavClubsPage. The changes streamline the navigation logic and align the home screen implementation with the latest component naming conventions.
Modified Files
- lib/ui/view/home/home_view.dart
- added import for the new
fav_clubs_view.dart
- removed import of the obsolete
fav_clubs_page.dart
- updated the
children
list to instantiateFavClubsView
with the existing viewModel, replacingFavClubsPage
- added import for the new
Conclusion
All updates are complete and the HomeView now correctly utilizes the FavClubsView component.
2025/06/10 version: 0.22.05+79
Add schedule_string
support, simplify caching, and implement favorites UI selector
This commit extends the clubs
model and database with a schedule_string
field for human-readable schedules, removes the now-redundant local cache in ScheduleRepository
, and enhances the “Favorites” page with a segmented control to switch between My Clubs, Nearby, and Selected lists. It also adds parsing logic to reconstruct schedules from strings, updates the club repository to merge cached JSON with Schedule.fromString
, and includes a migration and unit test for the new schedule_string
column and parsing.
Modified Files
- doc/images/Estudo de Interface para o App.excalidraw
- Updated the Excalidraw asset to reflect new UI segments for favorites.
- lib/data/repositories/clubs/club_repository.dart
- Imported
Schedule
and, when loading from cache, used each club’sscheduleString
to rebuild itsSchedule
viaSchedule.fromString
.
- Imported
- lib/data/repositories/schedule/schedule_repository.dart
- Removed all local-device caching logic (
_loadLocal
,_loadRemote
,_saveCache
) and now always returnsResult.voidSuccess
frominitialize
.
- Removed all local-device caching logic (
- lib/domain/enums/enums_declarations.dart
- Added
FavClubsPageEnum
with labels formyClubs
,nearby
, andselected
.
- Added
- lib/domain/models/club.dart
- Added nullable
scheduleString
property; updated constructors,toMap
, andfromMap
to serialize/deserializeschedule_string
and fallback toSchedule.fromString
when needed.
- Added nullable
- lib/domain/models/operating_day.dart
- Introduced
OperatingDay.fromHHMMRange(weekday, range)
to parse a"08:00 às 18:00"
string into anOperatingDay
.
- Introduced
- lib/domain/models/schedule.dart
- Added
Schedule.fromString(str)
factory to parse a comma-separated“Day: HH:MM às HH:MM”
string into aSchedule
object.
- Added
- lib/domain/use_cases/club_user_case.dart
- Modified
fetchClubWithSchedule
flow: only fetches schedule from repository ifclub.schedule == null
, then merges it viacopyWith
.
- Modified
- lib/ui/pages/clubs/register_club/register_club_page.dart
- Assigned
_scheduleController.text
toscheduleString
when constructing a newClub
.
- Assigned
- lib/ui/pages/home/fav_clubs/fav_clubs_page.dart
- Replaced static text with a
SelectionFavClubs
widget and conditional buttons for eachFavClubsPageEnum
mode; togglesshowBaseButton
and invokes the appropriate command.
- Replaced static text with a
New Files
- lib/ui/pages/home/fav_clubs/widgets/selection_fav_clubs.dart Implements a
SegmentedButton
control bound toFavClubsPageEnum
and notifies the parent when the user switches tabs. - supabase/migrations/20250610180909_update_clubs_table2.sql Adds
schedule_string TEXT
topublic.clubs
if it doesn’t exist. - test/domain/models/schedule_test.dart New unit test verifying that
Schedule.toString()
andSchedule.fromString()
round-trip correctly for multiple days and time ranges.
Conclusion
Schedules can now be stored and reconstructed from text, and the Favorites page offers a clean segmented interface. The migration and tests ensure backward compatibility and correct parsing for existing data.
2025/06/10 version: 0.22.05+78
Use currentPosition
, extract WKB→WKT converter, and correct coordinate parsing
This commit switches geolocation calls to currentPosition
, extracts the WKB-to-WKT conversion into a shared utility, updates database and functions services to use the new converter, fixes CoordLocation
parsing order, adds logging for nearby-club counts, and includes a round-trip WKT unit test.
Modified Files
- lib/data/repositories/functions/functions_repository.dart
- Changed geolocation lookup from
lastKnownPosition()
tocurrentPosition()
for more reliable coordinates.
- Changed geolocation lookup from
- lib/data/services/database_service/database_service.dart
- Imported the new
wkbToWkt
function fromcommom/functions.dart
. - Replaced the in-class
_wkbToWkt
implementation with calls towkbToWkt
.
- Imported the new
- lib/data/services/functions/functions_service.dart
- Imported
wkbToWkt
andClubsTableColumns.location
for consistent column referencing. - Transformed each club’s WKB location via
wkbToWkt
before mapping toClub
.
- Imported
- lib/domain/models/coord_location.dart
- Swapped the order in
toPointString
andfromPointString
so that longitude is X and latitude is Y, matching WKT conventions.
- Swapped the order in
- lib/domain/use_cases/fav_club_user_case.dart
- Added a warning log reporting how many nearby clubs were found within the given radius.
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Updated import path for
CoordLocation
to use the absolute URI.
- Updated import path for
New Files
- lib/data/services/commom/functions.dart Implements
wkbToWkt(String)
, converting PostGIS WKB hex to aPOINT(x y)
WKT with endian, SRID, and type checks. - test/domain/models/coord_location_test.dart Unit test verifying that
CoordLocation.toPointString()
andfromPointString()
round-trip correctly with latitude and longitude.
Conclusion
Shared utility extraction and coordinate corrections are complete, geolocation now uses fresh readings, and the new unit test ensures correct WKT handling.
2025/06/10 version: 0.22.05+77
Add geocoding feature, address string support, and wire new dependencies
This commit integrates a full geocoding workflow—service, repository, and UI wiring—so the app can resolve addresses to coordinates and cache results. It also adds an addressString
field to Club
, updates the Android manifest for permissions, and adjusts dependency injection, use cases, view models, routing, and tests to support the new functionality.
Modified Files
- android/app/src/main/AndroidManifest.xml Declared
ACCESS_FINE_LOCATION
andACCESS_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 includecomplement
conditionally. - lib/domain/models/club.dart Added nullable
addressString
property; updated constructors,toMap
, andfromMap
to handleaddress_string
; replaced oldLocation
withCoordLocation
. - lib/domain/models/coord_location.dart Renamed from
location.dart
; updated class name, factory constructors, JSON methods, and equality toCoordLocation
. - lib/domain/use_cases/club_user_case.dart Injected
IGeocodingRepository
, addedgetCoordinatesFromAddress
method, and wired it into club creation/update flows. - lib/domain/use_cases/fav_club_user_case.dart Injected
IFunctionsRepository
and exposedfetchNearbyClubs
to user case. - lib/routing/router.dart Passed new
geocodingRepository
andfunctionsRepository
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, setaddressString
and placeholderCoordLocation
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
andcrypto:^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 toIGeocodingService
. - 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 intoCoordLocation
. - lib/data/services/geocoding/i_geocoding_service.dart Interface for high-level geocoding operations.
- supabase/migrations/20250609163759_update_clubs_table.sql Migration to
ADD COLUMN IF NOT EXISTS address_string TEXT
inpublic.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
andjava.io.FileInputStream
to load keystore properties fromkey.properties
. - Created a
keystorePropertiesFile
and initialized aProperties
instance to readkeyAlias
,keyPassword
,storeFile
, andstorePassword
. - Added a
signingConfigs
block for “release” build that references values from the loadedProperties
. - Defined
debug
andrelease
buildTypes, assigning the appropriate signing configurations and enabling code minification and resource shrinking in the release build.
- Imported
- lib/data/repositories/address/address_repository.dart
- Renamed
_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 ininitialize
. - Moved
_cacheKey
helper above_userId
declaration for consistent ordering and removed redundant blank line.
- Renamed
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Corrected logger instantiation from
Logger('RemoteProfileRepository')
toLogger('BillingInfoRepository')
. - Enhanced
initialize
to callfetch(userId)
, then log success or warning depending onResult
outcome, while still returning theResult
.
- Corrected logger instantiation from
- 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
withkeys
fromgetKeysStartsWith
, and strip the prefix when mapping entries. - Updated return value of
_loadAllLocal
toresultSuccess
instead of constructing a newResult.success(null)
.
- Moved the
- lib/ui/core/ui/drawer/main_drawer.dart
- Imported
enums_declarations.dart
to referenceUserRole
. - Renamed parameter
person
touser
for consistency withUserInfo
usage. - Updated
MainDrawerHeader
instantiation to passuser
instead ofperson
. - Changed menu item labels: “Endereços” to “Gerenciamento de Endereços” and “Perfil” to “Dados Financeiros”.
- Wrapped the “manager”-only menu item with
if (isLoggedIn && user?.role == UserRole.manager)
to restrict visibility.
- Imported
- lib/ui/pages/address/address_page.dart
- Corrected import path for
show_simple_message.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 theListView
.
- Corrected import path for
- lib/ui/pages/home/home_page.dart
- Updated
MainDrawer
instantiation: replacedperson: _viewModel.userInfo
withuser: _viewModel.userInfo
to match renamed parameter.
- Updated
Conclusion
All changes are complete and the application should build and run successfully.
2025/06/06 version: 0.22.05+74
Normalize import paths, fix enum typo, adjust UI padding, and add FavClubsPage
This commit standardizes all import statements to use absolute (leading‐slash) paths, corrects the beachVolleybal
enum to beachVolleyball
, updates mapping logic in enums_sports_positions.dart
and Affiliate
to match, wraps the HomePage body in a padding using Dimens
, adds a listener for update
in UserResisterPage
, and introduces a new FavClubsPage
under lib/ui/pages/home/fav_clubs
. The pubspec version is bumped to 0.22.05+74
.
Modified Files
- lib/config/dependencies.dart
- Reordered and normalized imports with leading‐slash paths instead of
package:sports/...
. - Removed redundant blank line before
package:supabase_flutter/supabase_flutter.dart
.
- Reordered and normalized imports with leading‐slash paths instead of
- lib/data/repositories/auth/i_auth_repository.dart
- Changed
import 'package:sports/data/services/auth_service/i_auth_service.dart';
toimport '/data/services/auth_service/i_auth_service.dart';
.
- Changed
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
- Changed
import 'package:sports/utils/result.dart';
toimport '/utils/result.dart';
.
- Changed
- lib/data/repositories/viacep/i_viacep_repository.dart
- Changed
import 'package:sports/domain/models/viacep_address.dart';
andimport 'package:sports/utils/result.dart';
to leading‐slash imports.
- Changed
- lib/data/services/auth_service/auth_service.dart
- Normalized
i_auth_service.dart
import toimport '/data/services/auth_service/i_auth_service.dart';
.
- Normalized
- lib/data/services/cache_database_service/i_cache_service.dart
- Changed
import 'package:sports/utils/result.dart';
toimport '/utils/result.dart';
.
- Changed
- lib/data/services/database_service/i_database_service.dart
- Changed
import 'package:sports/utils/result.dart';
toimport '/utils/result.dart';
.
- Changed
- lib/data/services/storage_service/i_storage_service.dart
- Changed
import 'package:sports/utils/result.dart';
toimport '/utils/result.dart';
.
- Changed
- lib/domain/enums/enums_sports.dart
- Renamed enum value
beachVolleybal
tobeachVolleyball
.
- Renamed enum value
- lib/domain/enums/enums_sports_positions.dart
- Updated the
Sports.beachVoltagebal
key toSports.beachVolleyball
so position mapping matches the corrected enum.
- Updated the
- lib/domain/models/affiliate.dart
- Adjusted the type‐mismatch check from
(sport == Sports.beachVolleybal ...)
to(sport == Sports.beachVolleyball ...)
.
- Adjusted the type‐mismatch check from
- lib/domain/models/fav_club.dart
- Changed import of
date_time_extensions.dart
toimport '/utils/extensions/date_time_extensions.dart';
.
- Changed import of
- lib/domain/models/user_info.dart
- Normalized
enums_sports.dart
import toimport '/domain/enums/enums_sports.dart';
. - Removed an extra blank line between imports.
- Normalized
- lib/routing/app_extra_codec.dart
- Reordered imports: moved
import '/domain/models/address.dart';
beforeenums_declarations.dart
, using leading‐slash paths.
- Reordered imports: moved
- lib/routing/router.dart
- Normalized all imports to leading‐slash style (e.g.
/data/repositories/...
and/ui/pages/...
).
- Normalized all imports to leading‐slash style (e.g.
- lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
- Changed
package:
imports toimport '/domain/models/club.dart';
andimport '/ui/core/ui/...';
using leading‐slash.
- Changed
- lib/ui/pages/home/home_page.dart
- Added
import '/ui/core/theme/dimens.dart';
. - Wrapped the
IndexedStack
inPadding(padding: EdgeInsets.all(dimens.paddingScreenAll), ...)
. - Normalized
FavClubsPage
import toimport 'fav_clubs/fav_clubs_page.dart';
.
- Added
- lib/ui/pages/sign_in/sign_in_page.dart
- Changed import of
botton_sheet_message.dart
toimport '/ui/core/ui/messages/botton_sheet_message.dart';
.
- Changed import of
- lib/ui/pages/sign_in/sign_in_view_model.dart
- Changed
import 'package:sports/utils/result.dart';
toimport '/utils/result.dart';
.
- Changed
- lib/ui/pages/user_register/user_resister_page.dart
- Added
_viewModel.update.addListener(_onSaved);
ininitState()
. - Removed the corresponding listener in
dispose()
:_viewModel.update.removeListener(_onSaved);
.
- Added
New Files
- lib/ui/pages/home/fav_clubs/fav_clubs_page.dart A new StatefulWidget
FavClubsPage
with aFavClubsViewmodel
parameter. It builds a simpleListView
ofallClubs
withCard
/ListTile
, displaying each club’sname
,description
, andlogo
.
Deleted Files
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart Moved/renamed into
lib/ui/pages/home/fav_clubs/fav_clubs_page.dart
. - lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart Renamed to
lib/ui/pages/home/fav_clubs/fav_clubs_viewmodel.dart
. - lib/ui/pages/clubs/manage_club/manage_club_view_model.dart Removed because it was replaced by
manager_club/manager_club_view_model.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
andfav_clubs_repository.dart
. - Registered
Provider<IFavClubsRepository>
so thatFavClubsRepository
is injected withICacheService
andIDatabaseService
.
- Imported
- lib/data/repositories/clubs/club_repository.dart
- Replaced local variable name
c
withclub
in themyClubs
getter for clarity.
- Replaced local variable name
- lib/data/repositories/common/server_names.dart
- Added a new
FavClubsTableColumns
class with constants foruser_id
,club_id
, andcreated_at
.
- Added a new
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Changed constructor parameters to use interfaces (
ICacheService
andIDatabaseService
) instead of concrete service types. - Updated
delete
andfetchAll
query conditions to use the newFavClubsTableColumns.clubId
andFavClubsTableColumns.userId
constants. - No change to overall logic; still adds/removes favorite-club rows and updates local cache.
- Changed constructor parameters to use interfaces (
- lib/domain/models/fav_club.dart
- Added a new
createdAt
field (defaulting toDateTime.now()
) and updatedcopyWith
. - Changed the
toMap
method to emit snake_case keys (user_id
,club_id
,created_at
). - Updated
fromMap
to read from those snake_case keys and parsecreated_at
viaDateTimeExtensions.fromMap
.
- Added a new
- lib/domain/use_cases/account_management_user_case.dart
- Adjusted import paths to use leading-slash style (
/data/repositories/...
) consistently with the project.
- Adjusted import paths to use leading-slash style (
- lib/domain/use_cases/fav_club_user_case.dart
- Removed the old
clubsList
getter and replaced it with two new getters:allClubs
(all clubs) andotherClubs
(clubs not managed by the current user). - In
load
, first fetch all favorite-club IDs fromIFavClubsRepository
. Then for each ID, callfetchClub(clubId)
to load club details and schedule. - In
fetchClub
, after retrieving theClub
and itsSchedule
, callIFavClubsRepository.add(clubId)
to insert into the favorites table. Errors bubble up as needed.
- Removed the old
- lib/routing/router.dart
- Imported
i_fav_clubs_repository.dart
,fav_club_user_case.dart
, andfavorite_clubs_viewmodel.dart
. - Renamed the route for managing a club:
ManageClubPage
→ManagerClubPage
and updated its view-model import. - In the home route, added a
FavClubsViewmodel
to theHomePage
constructor under a newfavClubsViewModel
parameter. - Renamed the “Manage Club” page component folder to
manager_club
and updated references.
- Imported
- lib/ui/pages/clubs/manage_club/manage_club_page.dart → lib/ui/pages/clubs/manager_club/manager_club_page.dart
- Renamed file and class from
ManageClubPage
toManagerClubPage
. - Updated constructor signature and
createState()
return type accordingly. - Adjusted state class from
_ManageClubPageState
to_ManagerClubPageState
.
- Renamed file and class from
- lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
- Deleted (renamed functionality moved to
manager_club/manager_club_view_model.dart
).
- Deleted (renamed functionality moved to
- lib/ui/pages/clubs/manager_club/manager_club_view_model.dart
- New empty
ManagerClubViewModel
class to pair with the renamed “Manager” page.
- New empty
- lib/ui/pages/home/favorite_clubs/favorite_clubs_page.dart
- Renamed widget class from
ClubsPage
toFavClubsPage
. - Added a
FavClubsViewmodel viewModel
constructor parameter and updatedcreateState()
to_FavClubsPageState
.
- Renamed widget class from
- lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
- Renamed from
FavoriteClubsViewmodel
toFavClubsViewmodel
. - Injected
FavClubUserCase
and wiredCommand0<void> load
andCommand1<Club?, String> fetchClub
. - Exposed getters
allClubs
andotherClubs
from the use case.
- Renamed from
- lib/ui/pages/home/home_page.dart
- Added a new
FavClubsViewmodel favClubsViewModel
parameter toHomePage
. - Replaced the previous
ClubsPage
tab (at index 1) withFavClubsPage(viewModel: widget.favClubsViewModel)
.
- Added a new
- lib/utils/extensions/date_time_extensions.dart
- Added two methods: •
String toMap()
to produce a UTC ISO8601 string. •static DateTime fromMap(String map)
to parse that ISO string back to local time.
- Added two methods: •
New Files
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart Defines the
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 callingIViaCepService
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.dart
,viacep_service.dart
,i_viacep_repository.dart
, andviacep_repository.dart
. - Changed provider registration from
Provider<ViaCepService>
toProvider<IViaCepService>
. - Added
Provider<IViaCepRepository>
binding that createsViaCepRepository
usingIViaCepService
.
- Imported
- lib/data/services/viacep_service/viacep_service.dart
- Updated class signature to
ViaCepService implements IViaCepService
. - Added
@override
annotation ongetLocationByCEP
method to satisfy interface contract. - No change in internal logic—still performs HTTP lookup and parsing.
- Updated class signature to
- lib/domain/use_cases/address_user_user_case.dart
- Changed constructor to depend on
IViaCepRepository
instead ofViaCepService
. - Updated
getLocationByCEP
to call_viaCepRepository.getLocationByCEP(cep)
.
- Changed constructor to depend on
- lib/domain/use_cases/fav_club_user_case.dart
- Adjusted import paths to use leading slash style (
/data/repositories/...
) consistently with project conventions.
- Adjusted import paths to use leading slash style (
- lib/routing/router.dart
- Imported
i_viacep_repository.dart
so routing can access the repository. - Changed address route builders to call
context.read<IViaCepRepository>()
rather thanViaCepService
.
- Imported
- pubspec.yaml
- Bumped version from
0.22.04+71
to0.22.04+72
.
- Bumped version from
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.
- Injects
- 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 ofremote_*
or concrete class names. - Changed provider bindings to use
I*Repository
types and new implementation class names without “Remote”.
- Updated import paths to reference
- lib/data/repositories/address/remote_address_repository.dart → lib/data/repositories/address/address_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteAddressRepository
toAddressRepository
. - Updated imports and
implements
clause to useIAddressRepository
.
- Removed
- lib/data/repositories/address/address_repository.dart
- (Previously
remote_address_repository.dart
) Implementation unchanged other than renaming.
- (Previously
- lib/data/repositories/address/i_address_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IAddressRepository
.
- New interface file (added
- lib/data/repositories/auth/remote_auth_repository.dart → lib/data/repositories/auth/auth_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteAuthRepository
toAuthRepository
. - Updated imports and
implements
to useIAuthRepository
.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Changed
implements RemoteAuthRepository
toimplements IAuthRepository
.
- Changed
- lib/data/repositories/auth/i_auth_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IAuthRepository
.
- New interface file (added
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart → lib/data/repositories/billinginfo/billinginfo_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteBillingInfoRepository
toBillingInfoRepository
. - Updated imports and
implements
to useIBillingInfoRepository
.
- Removed
- lib/data/repositories/billinginfo/i_billinginfo_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IBillingInfoRepository
.
- New interface file (added
- lib/data/repositories/clubs/remote_club_repository.dart → lib/data/repositories/clubs/club_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteClubRepository
toClubRepository
. - Updated imports and
implements
to useIClubRepository
.
- Removed
- lib/data/repositories/clubs/i_club_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IClubRepository
.
- New interface file (added
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart → lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteFavClubsRepository
toFavClubsRepository
. - Updated imports and
implements
to useIFavClubsRepository
.
- Removed
- lib/data/repositories/fav_clubs/i_fav_clubs_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IFavClubsRepository
.
- New interface file (added
- lib/data/repositories/schedule/remote_schedule_repository.dart → lib/data/repositories/schedule/schedule_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteScheduleRepository
toScheduleRepository
. - Updated imports and
implements
to useIScheduleRepository
.
- Removed
- lib/data/repositories/schedule/i_schedule_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IScheduleRepository
.
- New interface file (added
- lib/data/repositories/storage/remote_storage_repository.dart → lib/data/repositories/storage/storage_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteStorageRepository
toStorageRepository
. - Updated imports and
implements
to useIStorageRepository
.
- Removed
- lib/data/repositories/storage/i_storage_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IStorageRepository
.
- New interface file (added
- lib/data/repositories/user/remote_user_repository.dart → lib/data/repositories/user/user_repository.dart
- Removed
remote_
prefix from filename. - Renamed class from
RemoteUserRepository
toUserRepository
. - Updated imports and
implements
to useIUserRepository
.
- Removed
- lib/data/repositories/user/i_user_repository.dart
- New interface file (added
i_
prefix). - Interface renamed to
IUserRepository
.
- New interface file (added
- lib/domain/use_cases/account_management_user_case.dart
- Changed constructor types from concrete classes (
AuthRepository
,UserRepository
,StorageRepository
) to interfaces (IAuthRepository
,IUserRepository
,IStorageRepository
).
- Changed constructor types from concrete classes (
- lib/domain/use_cases/address_user_user_case.dart
- Changed constructor parameter from
AddressRepository
toIAddressRepository
.
- Changed constructor parameter from
- lib/domain/use_cases/billinginfo_user_case.dart
- Changed constructor parameters from
AddressRepository
andBillingInfoRepository
toIAddressRepository
andIBillingInfoRepository
.
- Changed constructor parameters from
- lib/domain/use_cases/club_user_case.dart
- Changed constructor parameters from concrete repositories to their interface types (
IAddressRepository
,IClubRepository
,IStorageRepository
,IScheduleRepository
).
- Changed constructor parameters from concrete repositories to their interface types (
- lib/domain/use_cases/fav_club_user_case.dart
- Changed constructor parameters from concrete repositories to their interface types (
IAddressRepository
,IFavClubsRepository
,IClubRepository
,IScheduleRepository
).
- Changed constructor parameters from concrete repositories to their interface types (
- lib/routing/router.dart
- Updated all
context.read<…>()
calls: replaced concrete repository types (e.g.AuthRepository
,UserRepository
, etc.) with interface types (IAuthRepository
,IUserRepository
, etc.). - Adjusted use-case instantiations to pass interfaces instead of concrete classes.
- Updated all
- lib/ui/pages/splash/splash_view_model.dart
- Updated constructor’s dependency from
AuthRepository
toIAuthRepository
.
- Updated constructor’s dependency from
- test/data/repositories/address/remote_address_repository_test.dart
- Changed import from
remote_address_repository.dart
toaddress_repository.dart
. - Updated test instantiation from
RemoteAddressRepository
toAddressRepository
.
- Changed import from
- test/data/repositories/auth/remote_auth_repository_test.dart
- Changed import from
remote_auth_repository.dart
toauth_repository.dart
. - Updated test instantiation from
RemoteAuthRepository
toAuthRepository
.
- Changed import from
- test/data/repositories/clubs/remote_club_repository_test.dart
- Changed imports:
- From
remote_address_repository.dart
toaddress_repository.dart
- From
remote_club_repository.dart
toclub_repository.dart
- From
remote_user_repository.dart
touser_repository.dart
- From
- Updated instantiations accordingly:
RemoteClubRepository
→ClubRepository
,RemoteUserRepository
→UserRepository
,RemoteAddressRepository
→AddressRepository
.
- Changed imports:
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Changed imports:
- From
remote_address_repository.dart
→address_repository.dart
- From
remote_club_repository.dart
→club_repository.dart
- From
remote_schedule_repository.dart
→schedule_repository.dart
- From
remote_user_repository.dart
→user_repository.dart
- From
- Updated instantiations:
RemoteScheduleRepository
→ScheduleRepository
,RemoteClubRepository
→ClubRepository
, etc.
- Changed imports:
- test/data/repositories/storage/remote_storage_repository_test.dart
- Changed import from
remote_storage_repository.dart
tostorage_repository.dart
. - Updated test instantiation from
RemoteStorageRepository
toStorageRepository
.
- Changed import from
- test/data/repositories/user/remote_user_repository_test.dart
- Changed import from
remote_user_repository.dart
touser_repository.dart
. - Updated test instantiation from
RemoteUserRepository
toUserRepository
.
- Changed import from
- 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
.
- Updated imports:
Conclusion
All repository classes and their interface names have been updated for improved clarity: interfaces start with I
and use an i_
prefix in filenames, and concrete implementations no longer include the “Remote” prefix. All import paths, provider registrations, and tests have been updated accordingly.
2025/06/04 version: 0.22.04+70
Refactor favorite clubs feature and storage service to use interfaces; rename and reorganize use cases
This commit introduces a new IStorageService
interface for storage operations and refactors the favorite clubs feature to follow a more consistent naming and interface-based approach. Key changes include renaming and restructuring several domain use case files, updating dependency wiring in dependencies.dart
, and modifying repository and view model classes to use the newly introduced IStorageService
and updated use case types. Tests have been updated accordingly.
Modified Files
- doc/Estudo de Interface para o App.excalidraw
- Adjusted internal JSON metadata (e.g.,
"versionNonce"
) to reflect the latest export version.
- Adjusted internal JSON metadata (e.g.,
- doc/diagrama de classes Sports.drawio
- Updated
<diagram>
metadata to reflect the current draw.io version and internal JSON changes.
- Updated
- lib/config/dependencies.dart
- Added import for
IStorageService
and adjusted import paths to use absolute references (/data/services/...
) for consistency. - Changed
Provider<StorageService>
toProvider<IStorageService>
so that theRemoteStorageRepository
is constructed from the interface. - Updated
Provider<StorageRepository>
to read fromIStorageService
instead of the concreteStorageService
.
- Added import for
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Renamed the getter from
favClubs
tofavClubIds
to better reflect that it holds a set of IDs. - Expanded interface with
initialize
,add
,delete
, andfetchAll
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.
- Renamed the getter from
- 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
add
,delete
, andfetchAll
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 useTables.favClubs
and the new_favClubIds
list.
- Updated the internal set from
- lib/data/repositories/storage/remote_storage_repository.dart
- Changed the constructor parameter from the concrete
StorageService
to the interfaceIStorageService
. - Updated import to use
i_storage_service.dart
so that all storage operations go through the interface.
- Changed the constructor parameter from the concrete
- lib/data/services/storage_service/remote_storage_service.dart → lib/data/services/storage_service/storage_service.dart
- Renamed
RemoteStorageService
toStorageService
and moved understorage_service/
. - Added
implements IStorageService
and annotated all methods (createBucket
,deleteBucket
,add
,update
,delete
) with@override
. - Removed redundant documentation comments from method bodies; the interface now holds the official API doc.
- Updated import paths to be absolute (e.g.,
/data/services/storage_service/i_storage_service.dart
).
- Renamed
- lib/domain/use_cases/address_billinginfo_user_case.dart → lib/domain/use_cases/billinginfo_user_case.dart
- Renamed class from
AddressBillingInfoUserCase
toBillingInfoUserCase
and updated constructor accordingly. - Changed file name and import references in
router.dart
andbillinginfo_view_model.dart
to useBillingInfoUserCase
.
- Renamed class from
- lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/club_user_case.dart
- Renamed class from
AddressClubUserCase
toClubUserCase
and updated constructor and method calls. - Changed file name and updated all import references (in
router.dart
,clubs_view_model.dart
, andregister_club_view_model.dart
) to use the newClubUserCase
.
- Renamed class from
- lib/domain/use_cases/theme_user_case.dart
- Adjusted import path to use absolute reference (
../../../data/services/...
) to maintain consistency with other use case files.
- Adjusted import path to use absolute reference (
- lib/main_app.dart
- Updated import for
ThemeUserCase
from a relative path todomain/use_cases/theme_user_case.dart
.
- Updated import for
- lib/routing/router.dart
- Updated all imports of use cases to reflect their renamed paths (
club_user_case.dart
andbillinginfo_user_case.dart
). - Adjusted the construction of view models to use
ClubUserCase
andBillingInfoUserCase
instead of the old classes.
- Updated all imports of use cases to reflect their renamed paths (
- lib/ui/pages/billinginfo/billinginfo_view_model.dart
- Changed injection from
AddressBillingInfoUserCase
toBillingInfoUserCase
and updated the import accordingly.
- Changed injection from
- lib/ui/pages/clubs/clubs_view_model.dart
- Replaced
AddressClubUserCase
withClubUserCase
in both the constructor and the import statement.
- Replaced
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Updated import and constructor parameter from
AddressClubUserCase
toClubUserCase
.
- Updated import and constructor parameter from
- lib/ui/pages/home/home_view_model.dart
- Adjusted import path for
ThemeUserCase
to use a relative path underdomain/use_cases
.
- Adjusted import path for
- test/data/repositories/storage/remote_storage_repository_test.dart
- Updated import from
remote_storage_service.dart
tostorage_service.dart
so the test uses the newStorageService
. - Ensured
RemoteStorageRepository
is constructed withStorageService
through theIStorageService
interface.
- Updated import from
- test/data/services/remote_storage_service_test.dart
- Changed import of
remote_storage_service.dart
tostorage_service.dart
so tests reference the renamed class.
- Changed import of
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import from
address_club_user_case.dart
toclub_user_case.dart
. - Changed the instantiation from
AddressClubUserCase
toClubUserCase
. - Updated import for
StorageService
instead ofremote_storage_service.dart
.
- Updated import from
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 aResult<T>
to indicate success or failure, and method signatures (e.g.,createBucket
,add
,update
,delete
) include parameter documentation for error handling. - lib/domain/use_cases/fav_club_user_case.dart Introduces the
FavClubUserCase
class, which orchestrates the favorite clubs flow by:- Initializing address, club, schedule, and favorite-clubs repositories for the given
userId
. - Fetching all favorite clubs into local cache.
- Providing methods (
load
,fetchClub
) to load favorite clubs and fetch a single club with its schedule. - Uses
Logger
to emit fine-grained logs.
- Initializing address, club, schedule, and favorite-clubs repositories for the given
Conclusion
The favorite clubs feature and storage service are now fully interface-driven, use cases have been renamed for clarity, and dependency wiring in both production code and tests has been updated. All changes have been incorporated successfully, and the application compiles and runs as expected.
2025/06/03 version: 0.22.04+69
Refactor dependency injections to use interfaces and reorganize service implementations
This commit introduces major refactoring of service layers and dependency wiring by replacing concrete service types with abstract interfaces. Key changes include renaming and relocating service classes, updating repository constructors to depend on interfaces (IAuthService
, ICacheService
, IDatabaseService
), and adjusting all import paths accordingly. Tests have also been updated to reflect these interface-based injections.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted
mxGraphModel
attributes (dx
,dy
) to reflect updated drawing dimensions.
- Adjusted
- lib/config/dependencies.dart
- Switched
Provider<CacheDatabaseService>
toProvider<ICacheService>
and createdCacheService
implementation. - Changed
Provider<AuthService>
toProvider<IAuthService>
. - Updated
Provider<DatabaseService>
toProvider<IDatabaseService>
. - Updated constructor parameters for all repositories to read from interfaces instead of concrete services.
- Fixed import paths for all relocated services (
auth_service
,cache_database_service
,database_service
,storage_service
,viacep_service
).
- Switched
- lib/data/repositories/address/remote_address_repository.dart
- Replaced
CacheDatabaseService
andDatabaseService
fields withICacheService
andIDatabaseService
. - Updated constructor to accept interface types.
- Replaced
- lib/data/repositories/auth/auth_repository.dart
- Imported
IAuthService
instead ofAuthService
.
- Imported
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated
_authService
type toIAuthService
. - Adjusted getter to return
IAuthService
.
- Updated
- lib/data/repositories/auth/remote_auth_repository.dart
- Changed
_authService
toIAuthService
and_cacheService
toCacheService?
. - Updated constructor signature to accept
IAuthService
andCacheService
.
- Changed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Changed
CacheDatabaseService
andDatabaseService
fields toICacheService
andIDatabaseService
. - Updated constructor accordingly.
- Changed
- lib/data/repositories/clubs/club_repository.dart
- Renamed
clubList
getter toallClubs
and addedmyClubs
getter. - Added new abstract methods:
initialize
,logout
,fetchAll
,fetch(id)
,add
,update
,delete
with detailed documentation in the interface.
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Changed
_cacheService
and_databaseService
fields toICacheService
andIDatabaseService
. - Added implementation of
myClubs
andallClubs
getters. - Updated
delete
logic to check ownership before deleting from database.
- Changed
- lib/data/repositories/fav_clubs/remote_fav_clubs_repository.dart
- Switched
CacheDatabaseService
toCacheService
. - Changed
DatabaseService
to use direct class rather than interface (repository still references concrete type).
- Switched
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Updated
_cacheService
and_databaseService
fields toICacheService
andIDatabaseService
. - Updated constructor signature accordingly.
- Updated
- lib/data/repositories/storage/remote_storage_repository.dart
- Fixed import path for
RemoteStorageService
after relocating understorage_service
folder.
- Fixed import path for
- lib/data/repositories/user/remote_user_repository.dart
- Changed
_localService
and_databaseService
to useICacheService
andIDatabaseService
. - Adjusted import paths accordingly.
- Changed
- lib/data/services/auth_service/auth_service.dart
- Moved
AuthService
into its own folder underdata/services/auth_service
. - Implemented
IAuthService
interface and annotated all service methods with@override
. - Removed old
enum AuthEvent
and redefined it ini_auth_service.dart
. - Simplified documentation by removing redundant comments in method implementations.
- Moved
- lib/data/services/cache_database_service/cache_service.dart
- Renamed
CacheDatabaseService
toCacheService
and implementedICacheService
. - Updated all method signatures to
@override
.
- Renamed
- lib/data/services/viacep_service/viacep_service.dart
- Kept content intact but updated file location under
viacep_service
folder.
- Kept content intact but updated file location under
- lib/data/services/database_service/database_service.dart
- Renamed
RemoteDatabaseService
toDatabaseService
underdatabase_service
. - Implemented
IDatabaseService
interface and added@override
annotations to all CRUD methods.
- Renamed
- lib/data/services/storage_service/remote_storage_service.dart
- Moved
RemoteStorageService
understorage_service
folder without modifying logic.
- Moved
- lib/domain/use_cases/address_club_user_case.dart
- Changed
clubList
reference tomyClubs
to reflect new interface inClubRepository
.
- Changed
- lib/domain/use_cases/address_user_user_case.dart
- Updated import path for
ViaCepService
after relocating underviacep_service
folder.
- Updated import path for
- lib/domain/use_cases/theme_user_case.dart
- Changed injection parameter from
CacheDatabaseService
toICacheService
.
- Changed injection parameter from
- lib/main.dart
- Updated import for
AuthService
to new location underauth_service/auth_service.dart
.
- Updated import for
- lib/routing/router.dart
- Fixed all imports to use absolute paths (
/ui/pages/...
) instead of relative paths. - Updated import for
ViaCepService
to new path underviacep_service
.
- Fixed all imports to use absolute paths (
- lib/ui/pages/home/home_page.dart
- Changed
context.read<CacheDatabaseService>()
tocontext.read<CacheService>()
. - Updated import path for
CacheService
.
- Changed
- test/data/repositories/address/remote_address_repository_test.dart
- Updated imports to use
AuthService
fromauth_service/auth_service.dart
,CacheService
, andDatabaseService
. - Renamed
cache
variable type fromCacheDatabaseService
toCacheService
.
- Updated imports to use
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated import for
AuthService
to new location.
- Updated import for
- test/data/repositories/clubs/remote_club_repository_test.dart
- Updated imports for
AuthService
,CacheService
, andDatabaseService
. - Renamed
cache
variable type.
- Updated imports for
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated imports and
cache
variable type in setup.
- Updated imports and
- test/data/repositories/storage/remote_storage_repository_test.dart
- Adjusted imports to use
AuthService
andRemoteStorageService
from new paths.
- Adjusted imports to use
- test/data/repositories/user/remote_user_repository_test.dart
- Updated imports to use
AuthService
,DatabaseService
, andCacheService
. - Changed
FakeCache
to implementCacheService
instead ofCacheDatabaseService
.
- Updated imports to use
- test/data/services/remote_storage_service_test.dart
- Updated imports to point to relocated
AuthService
andRemoteStorageService
.
- Updated imports to point to relocated
- test/data/services/shared_preferences_service_test.dart
- Renamed
CacheDatabaseService
toCacheService
in imports and setup.
- Renamed
- test/data/services/supabase_auth_service_test.dart
- Changed import for
AuthService
to new path.
- Changed import for
- test/data/services/viacep_service_test.dart
- Updated import path for
ViaCepService
.
- Updated import path for
- test/domain/use_cases/address_club_user_case_test.dart
- Updated imports for
AuthService
,CacheService
,DatabaseService
, andRemoteStorageService
. - Renamed
cache
variable type.
- Updated imports for
New Files
- lib/data/services/auth_service/i_auth_service.dart Defines the
IAuthService
interface with all authentication-related methods (signUp
,signIn
,signOut
,fetchUser
,sendPasswordRecovery
,resendConfirmationEmail
,updatePassword
,updateUserPhone
) and theAuthEvent
enum. - lib/data/services/cache_database_service/i_cache_service.dart Declares the
ICacheService
interface for shared preferences operations (getKeysStartsWith
,setString
,setStringList
,getString
,getStringList
,remove
,clear
). - lib/data/services/database_service/i_database_service.dart Introduces the
IDatabaseService
interface for generic CRUD operations (fetch
,fetchList
,add
,update
,delete
,bulkDelete
) with full method signatures and documentation.
Conclusion
All interface-based refactorings are complete and dependency injections now rely on abstractions, ensuring a more modular and testable codebase.
2025/06/03 version: 0.22.04+68
Add Favorites Feature, Standardize DB Calls, and Update Club Registration Paths
This commit introduces a new favorites repository for managing user favorite clubs, refactors all remote repository methods to use named data
/id
parameters for consistency, reorganizes club registration pages under register_club
, enhances the “Manage Club” page content, updates the favorites UI and viewmodel, and adds MVVM and interface study diagrams to the doc
folder.
Modified Files
- doc/Estudo de Interface para o App.excalidraw
- Extended the Excalidraw interface study with new elements (index metadata updated to reflect added shapes and text).
- doc/diagrama de classes Sports.drawio
- Updated the
<mxGraphModel>
canvas dimensions (dx
anddy
) to accommodate recent additions in the class diagram.
- Updated the
- lib/data/repositories/address/remote_address_repository.dart
- Changed
add
,update
, anddelete
calls on_databaseService
to pass thedata:
orid:
named parameters instead of positional arguments.
- Changed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Updated
_databaseService.add
and_databaseService.update
calls to usedata:
named parameter. - Changed
delete
invocation to useid:
named parameter.
- Updated
- lib/data/repositories/clubs/remote_club_repository.dart
- Refactored
_databaseService.add
and_databaseService.update
to acceptdata:
named argument. - Modified
delete
to useid:
named parameter.
- Refactored
- lib/data/repositories/common/server_names.dart
- Added a new table name constant
favClubs
to support favorite clubs storage.
- Added a new table name constant
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Updated batch insert in
add
: each call to_databaseService.add
now usesdata:
named parameter. - Changed
bulkDelete
to useconditions:
named argument.
- Updated batch insert in
- lib/data/repositories/user/remote_user_repository.dart
- Standardized calls to
_databaseService.add
,update
, anddelete
with nameddata:
andid:
parameters.
- Standardized calls to
- lib/data/services/cache_database_service.dart
- Introduced
setStringList(String key, List<String>)
to save a list of strings in shared preferences, returning aResult<void>
. - Added
getStringList(String key)
to retrieve aList<String>?
from shared preferences, wrapped in aResult<List<String>?>
.
- Introduced
- lib/data/services/remote_database_service.dart
- Refactored
add
,update
,delete
, andbulkDelete
methods to accept named parameters (data:
orid:
,conditions:
) instead of positional arguments.
- Refactored
- lib/domain/models/affiliate.dart
- Extended the
isMismatch
logic to include additional sports (handball
,footvolley
,beachVolleybal
) in the position-type validation.
- Extended the
- lib/routing/router.dart
- Changed import paths for club registration views from
club_register
toregister_club
. - Renamed
ClubRegisterPage
→RegisterClubPage
andClubRegisterViewModel
→RegisterClubViewModel
in the club-register route. - Updated the schedule widget import path under
register_club/widgets
.
- Changed import paths for club registration views from
- lib/ui/pages/clubs/clubs_page.dart
- Adjusted the import for
DismissibleClubCard
to use the newregister_club/widgets
location.
- Adjusted the import for
- lib/ui/pages/clubs/manage_club/manage_club_page.dart
- Modified imports to use absolute project paths.
- Enhanced the page body to display a
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 wrappedListView.builder
.
- Replaced the simple list of 5 placeholder items with a
- lib/ui/pages/home/home_page.dart
- Imported the new
FavoriteClubsViewmodel
. - No functional changes here beyond imports.
- Imported the new
- test/data/repositories/user/remote_user_repository_test.dart
- Updated the
FakeCache
stub to includegetStringList
andsetStringList
overrides that currently throwUnimplementedError
.
- Updated the
New Files
- doc/MVVM.svg
- Added an SVG illustrating the MVVM architecture for the application.
- lib/domain/models/fav_club.dart
- Introduced
FavClub
model withuserId
andclubId
fields, along withtoMap
/fromMap
for serialization.
- Introduced
- lib/data/repositories/fav_clubs/fav_clubs_repository.dart
- Defined
FavClubsRepository
interface with methods:favClubs
,initialize
,add
,delete
, andfetchAll
.
- Defined
- 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.
- Caches favorite club IDs in
- Implemented
- lib/ui/pages/clubs/register_club/register_club_page.dart
- Added
RegisterClubPage
(renamed fromClubRegisterPage
) that accepts an optionalClub?
and aRegisterClubViewModel
.
- Added
- lib/ui/pages/clubs/register_club/register_club_view_model.dart
- Introduced
RegisterClubViewModel
(formerlyClubRegisterViewModel
) handlingload
andaddClub
commands viaAddressClubUserCase
.
- Introduced
- lib/ui/pages/clubs/register_club/widgets/dismissible_club_card.dart
- Moved/renamed
DismissibleClubCard
intoregister_club/widgets
, unchanged in logic.
- Moved/renamed
- lib/ui/pages/clubs/register_club/widgets/schedule_page.dart
- Relocated
SchedulePage
underregister_club/widgets
without modification of contents.
- Relocated
- lib/ui/pages/home/favorite_clubs/favorite_clubs_viewmodel.dart
- Added an empty
FavoriteClubsViewmodel
as a placeholder for future favorite-clubs logic.
- Added an empty
Conclusion
All remote repository methods now use consistent named parameters, the new favorites feature is fully scaffolded (model, repository, and UI), club registration has been reorganized under register_club
, and documentation diagrams (Excalidraw & MVVM) have been added—the app is updated and ready for the next development cycle.
2025/06/02 version: 0.22.04+67
Restructure Club Management and Update Navigation/UI
This commit reorganizes all club-related pages into a new clubs
directory, replaces the former club_manager
structure, and adds a dedicated “Manage Club” page. The bottom navigation bar has been updated to include “Eventos” and “Clubes” tabs, with a new FavoriteClubs
view. UI message widgets have been renamed for consistency, and routing has been adjusted to support these changes. Additionally, the class diagram XML metadata in Sports.drawio
has been tweaked for updated dimensions.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted the
<mxGraphModel>
dx
anddy
attributes to1468
and947
respectively, reflecting updated canvas dimensions.
- Adjusted the
- lib/domain/use_cases/account_management_user_case.dart
- Changed import paths to use absolute project references (
'/data/repositories/user/user_repository.dart'
and'/domain/models/user_info.dart'
), replacing the previous relative imports.
- Changed import paths to use absolute project references (
- lib/routing/router.dart
- Replaced imports of
club_manager
pages with newclubs
page classes:- Changed
ClubManagerPage
→ClubsPage
andClubManagerViewModel
→ClubsViewModel
. - Updated import paths for
club_register
andclubs_page
underui/pages/clubs
.
- Changed
- Introduced a new route
Routes.manageClub
with path/manage_club
, mapping toManageClubPage
and passing aClub
object viaextra
. - Removed unused
club_search
routes and replaced bindings toClubManager
classes with the newclubs
equivalents.
- Replaced imports of
- lib/routing/routes.dart
- Added a new route constant
manageClub = Route('manageClub', '/manage_club')
at the end of the file.
- Added a new route constant
- lib/ui/core/ui/drawer/main_drawer.dart
- Renamed the “Clubes” list tile to “Gerenciar Clubes” with a new icon (
Symbols.person_shield
). - Updated the
onTap
callback to call the updatedclubs
handler.
- Renamed the “Clubes” list tile to “Gerenciar Clubes” with a new icon (
- lib/ui/core/ui/messages/show_simple_floating_message.dart → lib/ui/core/ui/messages/show_simple_message.dart
- Renamed the file and symbol from
show_simple_floating_message
toshow_simple_message
. - Changed the named parameter
iconData
toiconTitle
throughout.
- Renamed the file and symbol from
- lib/ui/pages/address/address_page.dart
- Updated import to
show_simple_message.dart
instead of the old filename. - Replaced
iconData:
usages withiconTitle:
in all calls toshowSimpleMessage
.
- Updated import to
- lib/ui/pages/club_manager/club_register/club_register_page.dart → lib/ui/pages/clubs/club_register/club_register_page.dart
- Moved the entire club registration page into
ui/pages/clubs/club_register
. No internal logic was changed.
- Moved the entire club registration page into
- lib/ui/pages/club_manager/club_register/club_register_view_model.dart → lib/ui/pages/clubs/club_register/club_register_view_model.dart
- Moved the view model file to match the new
clubs/club_register
folder. No code modifications.
- Moved the view model file to match the new
- lib/ui/pages/club_manager/club_register/widgets/schedule_page.dart → lib/ui/pages/clubs/club_register/widgets/schedule_page.dart
- Moved
schedule_page.dart
into theclubs/club_register/widgets
folder. Path only; content unchanged.
- Moved
- lib/ui/pages/club_manager/club_manager_page.dart → lib/ui/pages/clubs/clubs_page.dart
- Renamed the page from
ClubManagerPage
toClubsPage
. - Replaced all references to
ClubManagerViewModel
withClubsViewModel
. - Removed inline
Dismissible
logic and replaced it with aDismissibleClubCard
widget. - Updated routing callbacks:
- Changed
_navEditClub
to pushRoutes.clubRegister
. - Added
_navManagerClub
to pushRoutes.manageClub
with aClub
instance.
- Changed
- 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.
- Renamed the page from
- lib/ui/pages/club_manager/club_manager_view_model.dart → lib/ui/pages/clubs/clubs_view_model.dart
- Renamed
ClubManagerViewModel
toClubsViewModel
and moved it underui/pages/clubs
. No functional changes to commands or use cases.
- Renamed
- lib/ui/pages/home/home_page.dart
- Imported
FavoriteClubsPage
underhome/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”.
- Replaced Home icon/label with
- Updated the
IndexedStack
children array:- Index 0: placeholder
Center(child: Text('Eventos'))
. - Index 1:
ClubsPage()
(formerlyClubManagerPage
). - Index 2: placeholder
Center(child: Text('Perfil'))
.
- Index 0: placeholder
- Imported
- lib/ui/pages/home/home_view_model.dart
- Fixed import path to use
'/domain/models/user_info.dart'
instead of a relative path.
- Fixed import path to use
New Files
- lib/ui/pages/clubs/club_register/widgets/dismissible_club_card.dart
- Introduces
DismissibleClubCard
widget to encapsulate the swipe-to-edit and swipe-to-delete UI. - Accepts callbacks:
navManagerClub
,navEditClub
, andremoveClub
for handling respective actions.
- Introduces
- lib/ui/pages/clubs/manage_club/manage_club_page.dart
- Implements a stub
ManageClubPage
, which receives aManageClubViewModel
and aClub
object via the route. - Displays the club’s name in the
AppBar
.
- Implements a stub
- lib/ui/pages/clubs/manage_club/manage_club_view_model.dart
- Defines an empty
ManageClubViewModel
class as a placeholder for future club-management logic.
- Defines an empty
- 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.
- A new
Conclusion
Club-related pages are now neatly organized under ui/pages/clubs
, navigation has been updated to reflect “Eventos” and “Clubes” tabs, and a new ManageClubPage
has been introduced—making club management routes and UI more maintainable and extensible.
2025/06/02 – version: 0.22.04+66
Add UI navigation, club search, and update club management structure
This commit introduces a bottom navigation bar with three tabs (Home, Favorites, Profile) in the home page, renames and relocates all “club” pages under a new club_manager
directory, adds a basic Club Search page, and updates routing and diagrams to reflect these changes. Together, these updates improve project organization and provide the foundation for client-side club browsing functionality.
Modified Files
- doc/diagrama de classes Sports.drawio
- Bumped Excalidraw/Draw.io version metadata.
- Adjusted swimlane dimensions and cell geometry for better alignment.
- Added new enum
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 ofclub
. - Changed builder for
Routes.clubs
to instantiateClubManagerPage
withClubManagerViewModel
(formerlyClubPage
/ClubViewModel
).
- Updated imports to use
- lib/ui/pages/home/home_page.dart
- Introduced an
int currentPageIndex
field to track active tab. - Added a
NavigationBar
at the bottom with threeNavigationDestination
entries: Home, Favoritos, Perfil. - Wrapped existing scaffold body in an
IndexedStack
keyed bycurrentPageIndex
: placeholders for Home, Favoritos, and Perfil. - Wrapped setState on
onDestinationSelected
to switch tabs.
- Introduced an
- lib/ui/pages/club/club_page.dart → lib/ui/pages/club_manager/club_manager_page.dart
- Renamed class from
ClubPage
toClubManagerPage
. - Updated constructor and state class to use
ClubManagerViewModel
instead ofClubViewModel
.
- Renamed class from
- lib/ui/pages/club/club_view_model.dart → lib/ui/pages/club_manager/club_manager_view_model.dart
- Renamed
ClubViewModel
toClubManagerViewModel
. - Constructor and commands remain, but class and file path updated to reflect “club_manager”.
- Renamed
- lib/ui/pages/club/club_register/club_register_page.dart → lib/ui/pages/club_manager/club_register/club_register_page.dart
- Moved the register page under
club_manager/club_register
. No content changes beyond path adjustment.
- Moved the register page under
- lib/ui/pages/club/club_register/club_register_view_model.dart → lib/ui/pages/club_manager/club_register/club_register_view_model.dart
- Moved and renamed the view model to match the new directory. No logic changes.
- lib/ui/pages/club/club_register/widgets/schedule_page.dart → lib/ui/pages/club_manager/club_register/widgets/schedule_page.dart
- Moved schedule widget into
club_manager/club_register/widgets
. No modifications to the file’s internals.
- Moved schedule widget into
New Files
- doc/Estudo de Interface para o App.excalidraw
- Excalidraw diagram file defining the app’s interface study.
- lib/ui/pages/club_search/club_search.dart
- New
ClubSearch
widget with aScaffold
and centered “Club Search” placeholder text. Serves as the starting point for club browsing features.
- New
- lib/ui/pages/club_search/club_search_view_model.dart
- Placeholder view model file for
ClubSearch
(currently empty).
- Placeholder view model file for
Conclusion
All routing, UI structure, and directory layouts have been updated—navigation and club management pages are reorganized and functional.
2025/05/28 – version: 0.22.04+65
Refactor UserModel to UserInfo and streamline registration flow
This commit renames the core UserModel
to UserInfo
across the domain, data layer, UI and tests, unifying all references and types. It also augments the registration stepper with role-based permissions and JSON encoding for UserRole
and Address
in routing, renames routes and navigation handlers, and refines address selection and billing info pages for improved UX.
Modified Files
- lib/data/repositories/user/remote_user_repository.dart
- Replaced
UserModel
withUserInfo
in import, fields, getters, method signatures, JSON mapping and caching logic.
- Replaced
- lib/data/repositories/user/user_repository.dart
- Updated repository interface to use
UserInfo
instead ofUserModel
for property, methods and documentation.
- Updated repository interface to use
- lib/domain/enums/enums_declarations.dart
- Added
factory UserRole.byName(String)
for convenient lookup by name.
- Added
- lib/domain/models/user_info.dart (formerly
user.dart
)- Renamed class
UserModel
toUserInfo
. - Adjusted constructor,
copyWith
,toMap
,fromMap
,fromJsonString
, equality andtoString
. - Simplified sports deserialization into a
Set<Sports>
.
- Renamed class
- lib/domain/use_cases/account_management_user_case.dart
- Switched imports and use cases to
UserInfo
. - Renamed getters and
addPerson
/updatePerson
return types toUserInfo
.
- Switched imports and use cases to
- lib/routing/app_extra_codec.dart
- Imported
enums_declarations.dart
andaddress.dart
. - Extended
_AppExtraEncoder
to JSON-encodeAddress
(type: 'address'
) andUserRole
(type: 'userRole'
).
- Imported
- lib/routing/router.dart
- Imported
UserRole
. - Updated route names and paths:
personRegister
→userRegister
. - Modified registration builder to accept
extra
asUserRole?
and pass toRegistrationPage
.
- Imported
- lib/routing/routes.dart
- Renamed
personRegister
constant touserRegister
.
- Renamed
- lib/ui/core/ui/drawer/main_drawer.dart
- Updated
person
parameter and import toUserInfo
.
- Updated
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Updated header to accept
UserInfo
instead ofUserModel
.
- Updated header to accept
- 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.
- Replaced
- lib/ui/pages/address/address_register/address_register_page.dart
- Wrapped controller assignments for ViaCep lookup in
setState
. - Removed unused
ViaCepAddress
import.
- Wrapped controller assignments for ViaCep lookup in
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Fixed type casting by using untyped
value
forbillinginfo
.
- Fixed type casting by using untyped
- 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
.
- Introduced
- lib/ui/pages/home/home_view_model.dart
- Switched import and getter from
UserModel
/person
toUserInfo
/userInfo
.
- Switched import and getter from
- lib/ui/pages/registration/registration_page.dart
- Added
UserRole? role
parameter androlePermissions
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.
- Added
- lib/ui/pages/user_register/user_resister_page.dart
- Moved and renamed file from
home/user_register
. - Updated imports to local widget paths.
- Switched from
personRegisterViewModel
touserResisterViewModel
withUserInfo
. - Adjusted state initialization, controllers, hint texts, back navigation returning
UserInfo
, and comparison logic in_setEdited
.
- Moved and renamed file from
- lib/ui/pages/user_register/user_resister_view_model.dart
- Renamed file and imports to
UserInfo
. - Updated command types for
add
andupdate
toCommand1<UserInfo, UserInfo>
. - Renamed
person
getter touserInfo
.
- Renamed file and imports to
- lib/ui/pages/user_register/widgets/select_sports.dart
- Moved file path to
user_register/widgets
without content changes.
- Moved file path to
- test/data/repositories/clubs/remote_club_repository_test.dart
- Updated import and test user instantiation to
UserInfo
.
- Updated import and test user instantiation to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated import and test user instantiation to
UserInfo
.
- Updated import and test user instantiation to
- test/data/repositories/user/remote_user_repository_test.dart
- Updated import, field types and test user creation to
UserInfo
.
- Updated import, field types and test user creation to
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import and test user instantiation to
UserInfo
.
- Updated import and test user instantiation to
Conclusion
All references to UserModel
are now unified under UserInfo
, registration flow respects role-based permissions, and routing JSON encoding is extended—the system is updated and fully functional.
2025/05/28 – version: 0.22.04+64
Add sports support, theme use case refactor, and registration flow enhancements
This commit introduces multi-sport selection in user registration, replaces the ThemeViewModel
with a dedicated ThemeUserCase
, and adds a new registration stepper page. It also updates routing to include the registration route, refactors several imports, and alters the users
table to support an array of sports enums.
Modified Files
doc/diagrama de classes Sports.drawio
- Adjusted the
<mxGraphModel>
dimensions to reflect updated layout sizing.
- Adjusted the
lib/config/dependencies.dart
- Imported the new
ThemeUserCase
use case. - Replaced
ChangeNotifierProvider<ThemeViewModel>
withChangeNotifierProvider<ThemeUserCase>
. - Removed obsolete import of
theme_view_model.dart
.
- Imported the new
lib/domain/models/user.dart
- Added
sports: Set<Sports>
field with default empty set. - Updated constructor,
copyWith
,toMap
,fromMap
, and==
override to includesports
. - Imported the
Sports
enum.
- Added
lib/domain/use_cases/theme_user_case.dart
- Renamed and moved
ThemeViewModel
toThemeUserCase
underdomain/use_cases
. - Updated constructor class name and file path.
- Renamed and moved
lib/main_app.dart
- Updated import to point at
ThemeUserCase
instead ofThemeViewModel
. - Changed context read to use
ThemeUserCase
.
- Updated import to point at
lib/routing/router.dart
- Updated all imports referencing
ThemeViewModel
toThemeUserCase
. - Added a new
GoRoute
for the registration page. - Inserted an empty placeholder
class ThemeViewModel {}
to maintain backward compatibility.
- Updated all imports referencing
lib/ui/core/ui/text_fields/select_text_field.dart
- Imported
dart:async
. - Introduced
_showDescriptionDuration
,_isShowDescription
, and_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.
- Imported
lib/ui/pages/address/address_register/address_register_page.dart
- Changed error check from
_viewModel.getViaCep.error
to_viewModel.getViaCep.isFailure
.
- Changed error check from
lib/ui/pages/club/club_view_model.dart
- Corrected import path for
address_club_user_case.dart
to use absolute import.
- Corrected import path for
lib/ui/pages/home/home_page.dart
- Updated imports to use absolute paths.
- Added an icon button to navigate to the new registration page.
lib/ui/pages/home/home_view_model.dart
- Updated import and constructor parameter from
ThemeViewModel
toThemeUserCase
.
- Updated import and constructor parameter from
lib/ui/pages/home/user_register/user_resister_page.dart
- Imported
SelectSports
widget andSports
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 wiredsports
into the user model creation and populate logic.
- Imported
lib/utils/commands.dart
- Moved
_result
declaration above getters. - Renamed
error
/success
getters toisFailure
/isSuccess
with updated comments. - Ensured
notifyListeners()
and_running = false
occur infinally
.
- Moved
lib/utils/result.dart
- Expanded class-level documentation to describe generic
Result<T>
. - Standardized getter signatures for
value
anderror
. - Refined
fold
callback variable names. - Updated
Success
andFailure
subclass comments.
- Expanded class-level documentation to describe generic
New Files
lib/ui/pages/home/user_register/widgets/select_sports.dart
- A reusable
SelectSports
widget presenting a list ofFilterChip
s for multi-sport selection, reporting changes via aSet<Sports>
callback.
- A reusable
lib/ui/pages/registration/registration_page.dart
- A new
RegistrationPage
implementing a three-stepStepper
for user, address, and payment data capture.
- A new
supabase/migrations/20250527132735_alter_table_users.sql
- Migration to create
sports_enum
type and addsports
column as a non-null array of enums with default empty array.
- Migration to create
Conclusion
All enhancements are now integrated, supporting sports selection, refined theming logic, and a complete registration workflow. The system remains fully functional and ready for further testing.
2025/05/24 – version: 0.22.04+63
Refactor repository interfaces and use-case naming for list consistency and optional remote loading
This commit harmonizes collection property names across address and club repositories, extends initialization and fetch APIs with an optional forceRemote
parameter, and renames use-case classes and their references for clearer intent. Routing and view-model imports are updated accordingly to reflect the new class names.
Modified Files
- doc/diagrama de classes Sports.drawio
- Updated file index pointer to reflect latest draw.io export
- lib/data/repositories/address/address_repository.dart
- Renamed
addressesList
toaddressList
- Added optional
[bool forceRemote = false]
parameter toinitialize
andfetch
signatures
- Renamed
- lib/data/repositories/address/remote_address_repository.dart
- Updated getter from
addressesList
toaddressList
- Adjusted
initialize
andfetch
method definitions to accept positionalforceRemote
flag
- Updated getter from
- lib/data/repositories/clubs/club_repository.dart
- Renamed
clubs
toclubList
- Changed
initialize
signature to use optional positionalforceRemote
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Updated getter from
clubs
toclubList
- 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
- Updated getter from
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Corrected
bulkDelete
parameter ordering for Supabase match API call
- Corrected
- lib/data/services/remote_database_service.dart
- Changed
bulkDelete
signature to accept positionalconditions
map
- Changed
- lib/domain/use_cases/address_billinginfo_user_case.dart
- Renamed
addressesList
reference toaddressList
- Renamed
- lib/domain/use_cases/address_club_user_case.dart
- Renamed class from
AddressClubCase
toAddressClubUserCase
- Updated constructor field ordering and import paths
- Adjusted parameter name from
oldUrl
tooldLogoUrl
- Renamed class from
- lib/domain/use_cases/address_user_user_case.dart
- Renamed class from
AddressUserCase
toAddressUserUserCase
- Updated
addresses
getter to useaddressList
- Renamed class from
- lib/routing/router.dart
- Updated imports for renamed use-case classes (
AddressClubUserCase
,AddressUserUserCase
)
- Updated imports for renamed use-case classes (
- lib/ui/pages/address/address_register/address_register_view_model.dart
- lib/ui/pages/address/address_view_model.dart
- lib/ui/pages/club/club_register/club_register_view_model.dart
- lib/ui/pages/club/club_view_model.dart
- Updated import paths to reference the renamed use-case classes
- test/data/repositories/address/remote_address_repository_test.dart
- Changed invocation of
fetch(addressId, forceRemote: true)
to positionalfetch(addressId, true)
- Updated test reference from
addressesList
toaddressList
- Changed invocation of
- test/domain/use_cases/address_club_user_case_test.dart
- Updated import and instantiation to use
AddressClubUserCase
- Updated import and instantiation to use
Conclusion
All interface signatures and class names are now consistent, ensuring clearer API usage and maintainable code structure.
2025/05/23 – version: 0.22.04+62
Clean up legacy fetch methods, refine repository docs, and enhance validation logic
This commit removes duplicated and obsolete local/fetch helper methods from address, billing, club, and schedule repositories, updates documentation in the ScheduleRepository
interface, and adds validation safeguards in the storage service. These changes streamline repository implementations and ensure clearer, single-responsibility methods across the data layer.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Eliminated duplicated
_fetchAllFromLocal
and_fetchAllFromDatabase
definitions at class end - Consolidated address-loading logic in the primary initialization flow
- Eliminated duplicated
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Restored private helpers (
_fetchFromLocal
,_fetchFromRemote
,_cachePerson
) after earlier removal - Ensured caching, remote fetch, and logging methods are present and documented
- Restored private helpers (
- lib/data/repositories/clubs/remote_club_repository.dart
- Removed stale
FIXME
comment about uncached club fetch - Preserved only the necessary
_fetchFromRemote
invocation
- Removed stale
- 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
- Stripped out redundant
- lib/data/repositories/schedule/schedule_repository.dart
- Rewrote interface documentation to describe initialization, fetch, and add behaviors clearly
- Updated parameter descriptions and return semantics for all abstract methods
- lib/data/repositories/storage/remote_storage_repository.dart
- Added doc comment on
_validateFileAndGenerateName
to explain its purpose and failure mode
- Added doc comment on
Conclusion
Legacy helpers removed and documentation refined—repositories are now cleaner and storage paths validated reliably.
2025/05/23 – version: 0.22.03+61
Refactor initialization flags, rename Membership model, and adjust diagram and service logic
This commit standardizes initialization guards across repositories by renaming _started
to _initialized
, refactors the domain model from Membership
to Affiliate
, updates the class diagram to reflect geometry and style changes, and improves cache key logic and logging in database services. It also enhances UI components for address navigation and adds a cache inspection button on the home page. All tests and formatting have been updated accordingly.
Modified Files
- doc/diagrama de classes Sports.drawio
- Adjusted swimlane and mxGraphModel geometry attributes for consistency
- Standardized
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
- Renamed
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed
_started
to_initialized
across initialization and logout methods - Reset
_initialized
flag on logout
- Renamed
- lib/data/repositories/clubs/remote_club_repository.dart
- Renamed
_started
to_initialized
and refined initialization check
- Renamed
- 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
- Renamed
- lib/data/services/cache_database_service.dart
- Corrected key prefix matching from
'$prefix.'
to'${prefix}_'
- Added info-level logging for key retrieval
- Corrected key prefix matching from
- lib/data/services/remote_database_service.dart
- Inverted
conditions
null check to only apply when non-null - Upgraded error logging from warning to severe for Postgrest and generic exceptions
- Inverted
- lib/utils/result.dart
- Introduced
resultSuccess
constant for reusableResult.success(null)
- Introduced
- lib/ui/core/ui/form_fields/address_form_field.dart
- Removed commented-out decoration colors and added explicit
contentPadding
- Removed commented-out decoration colors and added explicit
- lib/ui/pages/address/address_page.dart
- Fixed import path for
main_app_bar.dart
- Extracted back-navigation into
_backPage
method - Split floating action button into two: back and add, each with distinct
heroTag
- Fixed import path for
- lib/ui/pages/home/home_page.dart
- Added
provider
imports and cache inspection button in app bar - Prints all keys starting with
'club'
when tapped
- Added
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated test invocation of
fetch(clubId, true)
to includeforceRemote
parameter
- Updated test invocation of
New Files
- lib/domain/models/affiliate.dart
- Renamed model from
Membership
toAffiliate
, updated constructor,copyWith
, and factory methods - Adjusted imports and mapping logic to use
Affiliate.fromMap
- Renamed model from
Conclusion
All updates complete—initialization logic, model naming, and UI enhancements are in place and the system functions as expected.
2025/05/23 – version: 0.22.03+60
Refactored caching utilities and enhanced club and schedule data handling
This commit introduces multiple improvements across repositories, domain models, routing, and unit tests. Key changes include standardizing cache service method names, enhancing club and schedule serialization methods, refining local cache update logic, and adding a custom codec for route extras serialization. The AddressClub use case and related view models have been renamed and updated accordingly.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Renamed cache method from
getKeysStatedWith
togetKeysStartsWith
for consistency.
- Renamed cache method from
- lib/data/repositories/clubs/club_repository.dart
- Renamed
delete
method parameter toclubId
for improved clarity.
- Renamed
- 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
withtoJson
/fromJson
. - Fixed minor documentation formatting and removed obsolete comments.
- Refactored local cache update logic into
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Renamed cache method to
getKeysStartsWith
. - Refactored caching logic into
_saveCaching
. - Modified
add
and_addToDatabase
to standardize parameter order and avoid in-place list mutations.
- Renamed cache method to
- lib/data/services/cache_database_service.dart
- Renamed method
getKeysStatedWith
togetKeysStartsWith
to improve semantic accuracy.
- Renamed method
- lib/domain/models/club.dart
- Replaced
toJsonString
/fromJsonString
withtoJson
/fromJson
for standardization.
- Replaced
- lib/domain/models/operating_day.dart
- Fixed
toMap
logic to correctly serializeid
andclubId
fields.
- Fixed
- lib/domain/models/schedule.dart
- Changed
addDay
from returning a new Schedule to mutating the existing instance. - Added
removeDay
method for removing specific weekdays.
- Changed
- lib/domain/use_cases/address_club_user_case.dart → lib/domain/use_cases/address_club_case.dart
- Renamed file and class from
AddressClubUserCase
toAddressClubCase
for improved readability.
- Renamed file and class from
- lib/routing/router.dart
- Integrated
AppExtraCodec
as theextraCodec
forGoRouter
. - Updated imports and use case instantiations to
AddressClubCase
.
- Integrated
- lib/ui/pages/club/club_register/club_register_view_model.dart
- Updated use case reference to
AddressClubCase
.
- Updated use case reference to
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Modified
addDay
usage to align with mutable API. - Added
_resetSchedule
method with corresponding button for clearing schedules. - Updated
_selectDay
to useremoveDay
when deselecting weekdays.
- Modified
- lib/ui/pages/club/club_view_model.dart
- Updated use case reference to
AddressClubCase
.
- Updated use case reference to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Updated test to align with new mutable
addDay
behavior. - Adjusted expectations to reflect updated API usage.
- Updated test to align with new mutable
- test/data/repositories/user/remote_user_repository_test.dart
- Renamed fake cache method to
getKeysStartsWith
for consistency.
- Renamed fake cache method to
- test/domain/models/club_test.dart
- Replaced deprecated serialization methods in tests.
- test/domain/use_cases/address_club_user_case_test.dart
- Updated imports and instantiations to
AddressClubCase
.
- Updated imports and instantiations to
New Files
- lib/routing/app_extra_codec.dart
- Introduced
AppExtraCodec
for serializing and deserializing routeextra
parameters. - Supports
Club
,Map<String, dynamic>
, andString
types for routing data transport.
- Introduced
Conclusion
All changes have been successfully integrated, improving code consistency, maintainability, and type safety across the project. The system remains fully functional with enhanced route data serialization capabilities.
2025/05/23 – version: 0.22.03+59
Added schedule repository integration to address club use case
This commit integrates the schedule repository with the address club use case, ensuring that schedules are properly handled during club creation, update, fetch, and delete operations. It also introduces a new unit test to validate the complete CRUD flow for clubs and schedules in combination.
Modified Files
- lib/config/dependencies.dart
- Registered
ScheduleRepository
and its remote implementation in the dependency injection. - Adjusted imports to use consistent absolute paths.
- Registered
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed constructor parameter from
localService
tocacheService
for consistency.
- Renamed constructor parameter from
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Exposed
schedules
map via getter. - Enhanced
fetch
to allow bypassing memory cache with aforceRemote
parameter. - Corrected memory removal logic in
delete
.
- Exposed
- lib/data/repositories/schedule/schedule_repository.dart
- Added getter for
schedules
. - Modified
fetch
signature to include optionalforceRemote
parameter.
- Added getter for
- lib/domain/models/schedule.dart
- Renamed
copyWithDay
method toaddDay
for improved semantic clarity.
- Renamed
- 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
load
,fetchClub
,addClub
,updateClub
, anddeleteClub
to handle schedules accordingly.
- Integrated
- lib/routing/router.dart
- Passed
ScheduleRepository
dependency toAddressClubUserCase
. - Minor import adjustments for consistency.
- Formatted
SchedulePage
initialization for better readability.
- Passed
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated method calls from
copyWithDay
toaddDay
to reflect API change.
- Updated method calls from
- lib/ui/pages/club/club_view_model.dart
- Adjusted
clubs
getter toclubsList
to reflect combined data source with schedules.
- Adjusted
- test/data/repositories/clubs/remote_club_repository_test.dart
- Added missing
await
toinitialize
method call for proper async handling.
- Added missing
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Added comprehensive CRUD test covering add, fetch (memory and database), update, and delete operations for schedules.
New Files
- test/domain/use_cases/address_club_user_case_test.dart
- Added extensive test validating integration of
AddressClubUserCase
with schedule CRUD operations. - Covers full flow: load, add club with schedule, fetch, update, delete, and post-deletion fetch.
- Added extensive test validating integration of
Conclusion
All changes have been implemented and tested successfully. The schedule repository is now fully integrated within the address club use case, ensuring consistent and reliable handling of club schedules across the application.
2025/05/22 – version: 0.22.02+58
Enhance schedule repository with caching and update related components
This commit significantly improves the ScheduleRepository
by adding in-memory and device caching mechanisms, enabling efficient initialization and retrieval of schedules. Additional changes include improvements to related services and models, alignment of method signatures, and comprehensive test coverage.
Modified Files
- Makefile
- Added
git status
command todiff
target for better workflow visibility.
- Added
- doc/diagrama de classes.drawio → doc/diagrama de classes Sports.drawio
- Renamed the file for better contextual clarity.
- lib/data/repositories/address/remote_address_repository.dart
- Updated internal method to use
getKeysStatedWith
for more precise cache key retrieval.
- Updated internal method to use
- lib/data/repositories/clubs/remote_club_repository.dart
- Replaced
getKeys
withgetKeysStatedWith
for consistent cache key handling.
- Replaced
- 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
fetch
,add
,update
, anddelete
methods to manage both memory and device cache. - Added
_cacheSchedule
and_deviceCaching
helpers for consistent caching.
- Added
- 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
togetKeysStatedWith
for semantic accuracy.
- Renamed
- lib/data/services/remote_database_service.dart
- Improved
add
method documentation to clarify semantics.
- Improved
- lib/domain/models/schedule.dart
- Renamed constructor parameter to
listODay
for consistency. - Renamed
listDays
getter tolistODays
. - Removed redundant
fromOperatingDays
factory. - Simplified
copyWithDay
to uselistODays
.
- Renamed constructor parameter to
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Implemented comprehensive test setup, including creation of dependencies such as user, address, and club.
- Prepared environment for schedule repository CRUD tests.
- test/data/repositories/user/remote_user_repository_test.dart
- Updated
FakeCache
implementation to match newgetKeysStatedWith
method signature.
- Updated
Assets and Test Data
- doc/diagrama de classes Sports.drawio
- Renamed for clarity but contents remain functionally unchanged.
Conclusion
This update strengthens the scheduling infrastructure by introducing robust caching mechanisms, optimizing data access patterns, and ensuring consistency across related components. All tests and supporting utilities have been updated accordingly, ensuring system stability and improved maintainability.
2025/05/21 – version: 0.22.02+57
Refactor repositories and enhance database service with WKB to WKT conversion
This commit introduces a comprehensive refactoring of repository classes, standardizing nomenclature from person
to user
. It also adds important improvements to DatabaseService
, particularly WKB-to-WKT conversion for spatial data handling. Additional adjustments include enhancements in models and tests for improved robustness and consistency.
Modified Files
- analysis_options.yaml
- Added
formatter
configuration to preserve trailing commas.
- Added
- lib/config/dependencies.dart
- Updated imports from
person_repository
touser_repository
. - Standardized constructor parameter names (
sharedPreferences
→cacheService
).
- Updated imports from
- lib/data/repositories/address/remote_address_repository.dart
- Renamed constructor parameter.
- Added null-check for fetched address result.
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Renamed internal variables for clarity.
- Improved fetch logic with explicit null-checks.
- Modified
_fetchFromRemote
to returnResult<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.
- Enhanced
- lib/data/repositories/common/server_names.dart
- Added new constants:
schedule
andlocation
forClubsTableColumns
.
- Added new constants:
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Added null-aware operator in
fromOperatingDays
.
- Added null-aware operator in
- lib/data/repositories/person/remote_person_repository.dart → lib/data/repositories/user/remote_user_repository.dart
- Renamed file and updated import paths.
- Standardized variable names and method parameters from
person
touser
.
- lib/data/repositories/person/person_repository.dart → lib/data/repositories/user/user_repository.dart
- Renamed file.
- Updated documentation and method signatures from
person
touser
.
- lib/data/services/auth_service.dart
- Added optional
debug
parameter toinitialize
.
- Added optional
- lib/data/services/remote_database_service.dart
- Added
ClubsTableColumns
import for location field handling. - Implemented
_wkbToWkt
method to convert spatial data. - Modified
fetch
andfetchList
to use WKB-to-WKT conversion. - Simplified
update
anddelete
methods for consistency.
- Added
- lib/domain/models/location.dart
- Fixed duplicate
fromMap
constructor. - Minor code rearrangement for clarity.
- Fixed duplicate
- lib/domain/models/schedule.dart
- Refactored to use
List<OperatingDay>
for internal structure. - Added getter
listDays
. - Simplified
copyWith
andcopyWithDay
methods.
- Refactored to use
- lib/domain/use_cases/account_management_user_case.dart
- Updated import path for
user_repository
.
- Updated import path for
- lib/domain/use_cases/address_billinginfo_user_case.dart
- Changed
fetchAddress
return type toResult<Address?>
.
- Changed
- lib/domain/use_cases/address_club_user_case.dart
- Changed
fetchAddress
andfetchClub
return types to nullableResult
.
- Changed
- lib/domain/use_cases/address_user_case.dart
- Changed
fetch
return type toResult<Address?>
.
- Changed
- lib/routing/router.dart
- Updated import path for
user_repository
.
- Updated import path for
- lib/ui/pages/address/address_view_model.dart
- Updated
fetch
return type toFuture<Result<Address?>>
.
- Updated
- lib/ui/pages/billinginfo/billinginfo_view_model.dart
- Updated
fetchAddress
return type toFuture<Result<Address?>>
.
- Updated
- lib/ui/pages/club/club_register/club_register_view_model.dart
- Updated
fetchClub
andfetchAddress
types to nullable. - Adjusted
_fetchClub
method signature accordingly.
- Updated
- lib/ui/pages/club/club_view_model.dart
- Updated
fetchAddress
return type toFuture<Result<Address?>>
.
- Updated
- test/data/repositories/address/remote_address_repository_test.dart
- Corrected parameter name for
RemoteAddressRepository
. - Improved test setup with
Uuid
for dynamic email generation.
- Corrected parameter name for
- test/data/repositories/auth/remote_auth_repository_test.dart
- Standardized test user creation with dynamic
Uuid
email. - Aligned test variable naming with refactor.
- Standardized test user creation with dynamic
- test/data/repositories/user/remote_user_repository_test.dart
- Corrected import path.
- Updated constructor parameters to match
RemoteUserRepository
.
- test/domain/models/club_test.dart
- Updated
Schedule
instantiation to useList<OperatingDay>
.
- Updated
- test/domain/models/schedule_test.dart
- Refactored tests to accommodate new
Schedule
list-based constructor.
- Refactored tests to accommodate new
New Files
- test/data/repositories/clubs/remote_club_repository_test.dart
- Added comprehensive CRUD test for
RemoteClubRepository
.
- Added comprehensive CRUD test for
- test/data/repositories/schedule/remote_schedule_repository_test.dart
- Placeholder for future
RemoteScheduleRepository
tests.
- Placeholder for future
Assets and Test Data
No assets or test data were added in this commit.
Conclusion
The refactoring and enhancements significantly improve code consistency, readability, and functionality, particularly in repository patterns and spatial data handling. All changes are complete and the system remains stable.
2025/05/20 – version: 0.22.02+56
Remove deprecated profile page and refactor listener naming
This commit removes the unused ProfilePage
from the billing info module and renames listener callbacks in AddressRegisterPage
to improve semantic clarity. Additionally, the changelog version dates were corrected to reflect the actual commit date.
Modified Files
- README.md
- Updated changelog dates from
2025/05/19
to2025/05/20
for versions0.22.01+54
and0.22.01+55
.
- Updated changelog dates from
- 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
andupdate
operations to use the new method name.
- Renamed
Deleted Files
- lib/ui/pages/BillingInfo/profile_page.dart
- Fully removed this file, which contained an outdated implementation of the billing profile registration UI.
- The page handled multiple roles (
athlete
,manager
) and supported various document types but is no longer part of the current workflow.
Conclusion
This update cleans up obsolete UI components and aligns listener naming for clarity, improving maintainability and reducing confusion during development.
2025/05/20 – version: 0.22.01+55
Refactor serialization and finalize schedule enhancements
This commit finalizes the enhancements to the Schedule
and OperatingDay
models by refining the serialization structure, improving developer ergonomics, and introducing weekday-specific getters. It also updates the database service for improved error logging, standardizes test environment loading, and enables user self-deletion through Supabase policy.
Modified Files
- README.md
- Added changelog entry for version 0.22.01+55 with a summary of refactors and improvements.
- lib/data/services/remote_database_service.dart
- Modified
update()
to use.select()
for accurate response parsing. - Rewrote
delete()
with full try-catch error handling and logging. - Improved
_executeVoid()
to properly handle and log API errors.
- Modified
- lib/domain/enums/enums_declarations.dart
- Added a placeholder utility method
byName
(commented) for future use.
- Added a placeholder utility method
- lib/domain/models/location.dart
- Removed redundant
toString()
method for cleaner output.
- Removed redundant
- lib/domain/models/schedule.dart
- Introduced weekday-specific getters (e.g.,
monday
,tuesday
, etc.). - Updated
toMap()
to serializedays
as a map keyed by weekday names. - Improved
fromMap()
to correctly parse nested weekday maps.
- Introduced weekday-specific getters (e.g.,
- pubspec.yaml
- Bumped version to
0.22.01+55
.
- Bumped version to
- supabase/migrations/20250417191646_create_users_table.sql
- Added a new Supabase policy:
"Allow users to delete their own users"
.
- Added a new Supabase policy:
- test/data/repositories/auth/remote_auth_repository_test.dart
- Refactored
.env
file loading to a unified and centralized path.
- Refactored
- test/data/repositories/storage/remote_storage_repository_test.dart
- Standardized environment file path for consistency.
- test/data/services/remote_storage_service_test.dart
- Unified
.env
file path to use/test/.env_test_supabase
.
- Unified
- test/data/services/supabase_auth_service_test.dart
- Updated path to
.env
for consistency across all Supabase-related tests.
- Updated path to
- test/domain/models/club_test.dart
- Fixed test expectation by aligning with
toPointString()
representation forLocation
.
- Fixed test expectation by aligning with
- test/domain/models/schedule_test.dart
- Rewrote
Schedule
andOperatingDay
tests to reflect new serialization logic. - Verified
toMap
,fromMap
,toJson
, andfromJson
round-trip integrity. - Added assertions for correct weekday serialization, deserialization, and structural consistency.
- Rewrote
Conclusion
This update completes the structural refactor of the scheduling system with a clean, consistent, and extensible design. All data access and serialization layers are now aligned, tests fully reflect the new structure, and Supabase permissions have been improved for user profile management.
2025/05/20 – version: 0.22.01+54
Update data model to support structured club schedules
This commit refactors the Schedule
and OperatingDay
models to enable structured storage and retrieval of weekly club operation hours in a normalized table (club_schedules
). It also introduces a new repository for handling remote schedule data and updates related UI and data access layers accordingly.
Modified Files
- doc/diagrama de classes.drawio
- Replaced verbose per-day fields with a concise
Map<Weekday, OperatingDay>
structure forSchedule
. - Reduced height of the
Schedule
component to reflect simplified structure.
- Replaced verbose per-day fields with a concise
- 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.
- Internalized
- lib/data/repositories/billinginfo/remote_billinginfo_repository.dart
- Updated call to
fetch
method to use named parameters.
- Updated call to
- lib/data/repositories/clubs/remote_club_repository.dart
- Updated fetch and fetchList calls to use named parameters.
- lib/data/repositories/common/server_names.dart
- Added
club_schedules
toTables
and createdClubSchedulesTableColumns
.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated call to
fetch
method to use named parameters.
- Updated call to
- lib/data/services/remote_database_service.dart
- Refactored
fetch
andfetchList
to use named parameters (id
,fromMap
,conditions
). - Added
bulkDelete
method for deleting multiple entries by condition. - Improved logging for error handling.
- Refactored
- lib/domain/models/club.dart
- Changed
schedule
to nullable and updated serialization accordingly.
- Changed
- lib/domain/models/operating_day.dart
- Introduced
id
,clubId
, andweekday
. - Replaced
open
andclose
withopenAt
andcloseAt
. - Moved
TimeOfDay
extension to a separate file. - Enhanced JSON and map support.
- Introduced
- lib/domain/models/schedule.dart
- Simplified internal structure to use
Map<Weekday, OperatingDay>
. - Added
fromOperatingDays
factory. - Improved
toString
and JSON serialization.
- Simplified internal structure to use
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated UI logic to match new field names (
openAt
,closeAt
). - Adjusted
_pickTimeFromWeek
and checkbox logic accordingly.
- Updated UI logic to match new field names (
- supabase/config.toml
- Disabled email confirmation for sign-in to simplify testing.
- supabase/migrations/20250514180524_create_clubs_table.sql
- Commented out old
schedule
column inclubs
.
- Commented out old
- supabase/migrations/20250519171604_create_club_schedules.sql
- Added clarification comment on
weekday
field constraint.
- Added clarification comment on
- 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.
- Renamed test file to reflect correct domain (
- test/domain/models/club_test.dart
- Updated tests to use new
OperatingDay
structure. - Adjusted serialization checks for
Schedule
.
- Updated tests to use new
- test/domain/models/schedule_test.dart
- Refactored all tests to use
weekday
,openAt
,closeAt
. - Updated serialization and deserialization expectations.
- Refactored all tests to use
New Files
- lib/data/repositories/schedule/remote_schedule_repository.dart
- Repository implementation to fetch, add, update, and delete schedules using the normalized
club_schedules
table.
- Repository implementation to fetch, add, update, and delete schedules using the normalized
- lib/data/repositories/schedule/schedule_repository.dart
- Abstract definition for schedule operations to be implemented by repositories.
- lib/utils/extensions/time_of_day_extensions.dart
- Utility extension for
TimeOfDay
to convert to/fromHH:MM
andHH:MM:SS
formats.
- Utility extension for
Assets and Test Data
- test/.env_test_supabase
- Moved
.env_test_supabase
to roottest/
folder for consistent loading across integration tests.
- Moved
Conclusion
This refactoring completes the migration from a flat schedule
string field to a fully normalized and structured model, enabling better flexibility and integration with the Supabase backend. The system is now ready to handle weekly scheduling with full test coverage and database synchronization.
2025/05/19 – version: 0.22.01+53
Refactor billing and club schedule models, enforce UUID and PostGIS support
This commit introduces several key changes: refactors to billing info naming conventions, enhancements to the Schedule
model structure, inclusion of PostGIS and pgcrypto extensions in the database, and separation of sports position enums into a dedicated file. These modifications aim to improve modularity, database integrity, and naming consistency throughout the codebase.
Modified Files
- lib/config/dependencies.dart
- Updated import path for billing info repository.
- lib/data/repositories/billinginfo/billinginfo_repository.dart
- Renamed
profile
tobillinginfo
across methods and properties.
- Renamed
- lib/data/repositories/billinginfo/remote_profile_repository.dart → remote_billinginfo_repository.dart
- File renamed and all internal references updated to
billinginfo
.
- File renamed and all internal references updated to
- lib/data/services/remote_database_service.dart
- Removed dependency on
uuid
package. - Replaced client-side UUID generation with server-side
gen_random_uuid()
. - Enhanced
update
to optionally updateupdated_at
.
- Removed dependency on
- lib/domain/enums/enums_declarations.dart
- Reordered
Weekday
enum entries. - Removed all embedded position enums.
- Reordered
- lib/domain/enums/enums_sports.dart
- Removed
Position
abstraction and all position-specific enums. - Introduced new sports:
footvolley
,beachVolleybal
.
- Removed
- lib/domain/enums/enums_sports_positions.dart
- Created new file encapsulating
Position
interface and related enums for each sport. - Added
FootvolleyPosition
andBeachVolleybalPosition
.
- Created new file encapsulating
- lib/domain/models/club.dart
- Updated
location
to usetoPointString()
. - Changed
schedule
from JSON string to structured map.
- Updated
- lib/domain/models/location.dart
- Added support for PostGIS-compatible POINT string conversion.
- lib/domain/models/sportman.dart → membership.dart
- Renamed class
Sportsman
toMembership
. - Aligned terminology (
joinedAt
,athleteId
, etc.) and improved field consistency.
- Renamed class
- lib/domain/models/schedule.dart
- Replaced hardcoded weekday fields with a
Map<Weekday, OperatingDay>
. - Updated serialization/deserialization methods accordingly.
- Replaced hardcoded weekday fields with a
- lib/domain/models/user.dart
- Minor comment clarification.
- lib/domain/use_cases/address_profile_user_case.dart → address_billinginfo_user_case.dart
- Refactored naming from
profile
tobillinginfo
throughout.
- Refactored naming from
- lib/routing/router.dart
- Updated routes and imports to reflect renaming of billing info and user registration modules.
- lib/routing/routes.dart
- Renamed route from
profiles
tobillinginfo
.
- Renamed route from
- lib/ui/core/ui/drawer/main_drawer.dart
- Renamed
profile
callback tobillinginfo
.
- Renamed
- lib/ui/pages/profile/profile_page.dart → billinginfo/profile_page.dart
- Relocated and renamed to
BillingInfoPage
. - Refactored to align with new
BillingInfoViewModel
.
- Relocated and renamed to
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Created new billing info screen with full editing functionality.
- lib/ui/pages/profile/profile_view_model.dart → billinginfo/billinginfo_view_model.dart
- Refactored view model and naming conventions from
Profile
toBillingInfo
.
- Refactored view model and naming conventions from
- lib/ui/pages/club/club_register/widgets/schedule_page.dart
- Updated references to new
Schedule
implementation with map-based structure.
- Updated references to new
- lib/ui/pages/home/home_page.dart
- Updated navigation and callback references from
profile
tobillinginfo
.
- Updated navigation and callback references from
- lib/ui/pages/home/person_register/person_resister_page.dart → user_register/user_resister_page.dart
- Renamed and reorganized user registration page.
- lib/ui/pages/home/person_register/person_resister_view_model.dart → user_register/user_resister_view_model.dart
- Renamed corresponding view model.
- test/domain/enums/enums_sports_test.dart
- Added import for new sports position enums.
- test/domain/models/club_test.dart
- Updated tests to match new
Schedule
structure usingMap<Weekday, OperatingDay>
.
- Updated tests to match new
- test/domain/models/schedule_test.dart
- Adapted test cases for new schedule structure and removed deprecated JSON serialization test.
New Files
- doc/Pendeicias.md
- Markdown document listing design decisions and technical debts related to UUID generation and schedule refactoring.
- lib/domain/enums/enums_sports_positions.dart
- Centralized declaration of sports position enums and related logic.
- lib/ui/pages/billinginfo/billinginfo_page.dart
- Fully functional UI page for managing billing info data.
- supabase/migrations/20250519171604_create_club_schedules.sql
- Creates
club_schedules
table with RLS policies and index. - Supports fine-grained control over schedule per weekday.
- Creates
Conclusão
The refactor modernizes data handling in the app and establishes a cleaner structure for scheduling, billing info, and user-related data. The system remains stable and is ready for further feature development.
2025/05/16 – version: 0.22.01+52
Renamed domain models and repositories to align with terminology
This commit refactors domain models, repositories, and Supabase table names for semantic clarity and better alignment with industry terminology. It replaces the term Person
with UserModel
and Profile
with BillingInfo
across all layers. Corresponding Supabase table names (person
, profile
, and address
) have been renamed to users
, billing_info
, and addresses
, respectively, with matching migration updates and security policies. Code dependencies and import paths have been updated accordingly.
Modified Files
lib/config/dependencies.dart
- Updated dependency injection to use
UserRepository
andBillingInfoRepository
.
- Updated dependency injection to use
lib/data/repositories/address/remote_address_repository.dart
- Renamed table and column references from
address
toaddresses
.
- Renamed table and column references from
lib/data/repositories/clubs/remote_club_repository.dart
- Updated filter field to use
ClubsTableColumns
.
- Updated filter field to use
lib/data/repositories/common/server_names.dart
- Renamed constants for
Tables
,AddressesTableColumns
, andClubsTableColumns
.
- Renamed constants for
lib/data/repositories/person/person_repository.dart
- Replaced
Person
withUserModel
throughout the interface.
- Replaced
lib/data/repositories/person/remote_person_repository.dart
- Replaced all internal references of
Person
withUserModel
. - Renamed
RemotePersonRepository
toRemoteUserRepository
.
- Replaced all internal references of
lib/domain/use_cases/account_management_user_case.dart
- Replaced
Person
withUserModel
andPersonRepository
withUserRepository
.
- Replaced
lib/domain/use_cases/address_profile_user_case.dart
- Replaced
Profile
withBillingInfo
.
- Replaced
lib/routing/router.dart
- Updated dependency and routing logic to reflect renamed repository interfaces and models.
lib/ui/core/ui/drawer/main_drawer.dart
&main_drawer_header.dart
- Updated to use
UserModel
instead ofPerson
.
- Updated to use
lib/ui/pages/home/home_view_model.dart
- Updated to reflect new naming for
UserModel
.
- Updated to reflect new naming for
lib/ui/pages/home/person_register/person_resister_page.dart
- Replaced
Person
withUserModel
and related logic.
- Replaced
lib/ui/pages/home/person_register/person_resister_view_model.dart
- Updated view model to manage
UserModel
data.
- Updated view model to manage
lib/ui/pages/profile/profile_page.dart
- Replaced
Profile
withBillingInfo
.
- Replaced
lib/ui/pages/profile/profile_view_model.dart
- Refactored to work with
BillingInfo
as the domain model.
- Refactored to work with
test/data/repositories/address/remote_address_repository_test.dart
- Updated table name from
address
toaddresses
.
- Updated table name from
test/data/repositories/person/remote_person_repository_integration_test.dart
- Refactored test setup, assertions, and cleanup to use
UserModel
andusers
table.
- Refactored test setup, assertions, and cleanup to use
New Files
lib/data/repositories/billinginfo/billinginfo_repository.dart
- New interface for managing billing info records.
lib/data/repositories/billinginfo/remote_profile_repository.dart
- Refactored from
remote_profile_repository.dart
, implementingBillingInfoRepository
.
- Refactored from
lib/domain/models/billinginfo.dart
- Refactored from
profile.dart
to represent billing-related user data.
- Refactored from
supabase/migrations/20250512192942_create_billing_info_table.sql
- SQL script to create the new
billing_info
table, with appropriate indexes and policies.
- SQL script to create the new
Deleted Files
lib/data/repositories/profiles/profile_repository.dart
- Removed legacy profile repository interface.
lib/domain/models/profile.dart
- Superseded by
billinginfo.dart
.
- Superseded by
supabase/migrations/20250512192942_create_profile_table.sql
- Removed obsolete migration for
profile
table.
- Removed obsolete migration for
supabase/migrations/20250417191646_create_person_table.sql
- Renamed to
create_users_table.sql
.
- Renamed to
Conclusion
This large-scale refactor completes the transition from generic profile/person naming to domain-specific terminology, improving clarity, maintainability, and semantic accuracy across all layers of the application.
2025/05/16 – version: 0.22.01+51
Added password recovery and confirmation email workflows
This commit introduces password recovery and account confirmation flows into the app. It includes UI and backend integration for sending recovery and confirmation emails, improves user feedback during login errors, and updates email templates. Additionally, it refactors imports for consistency and initializes the logger earlier in the application lifecycle.
Modified Files
README.md
- Updated the section title to reflect the current MVVM folder structure.
lib/main.dart
- Extracted authentication and logger initialization into dedicated functions.
- Ensured logger applies ANSI color codes based on log severity.
lib/routing/router.dart
- Replaced relative imports with root-relative paths for consistency across the routing layer.
lib/data/repositories/auth/auth_repository.dart
- Declared methods for sending password recovery and confirmation emails.
lib/data/repositories/auth/dev_auth_repository.dart
- Added mock implementations of the new methods returning
Result.success
.
- Added mock implementations of the new methods returning
lib/data/repositories/auth/remote_auth_repository.dart
- Integrated remote implementations for
sendPasswordRecovery
andresendConfirmationEmail
.
- Integrated remote implementations for
lib/data/services/auth_service.dart
- Implemented the logic for sending confirmation emails via Supabase.
lib/data/services/remote_database_service.dart
- Refactored query builder to resolve assignment type errors with chained filters and transformations.
lib/domain/use_cases/account_management_user_case.dart
- Added use cases for password recovery and confirmation email resend.
lib/ui/core/ui/messages/app_snack_bar.dart
- Introduced reusable methods:
showSnackError
andshowSnackSuccess
.
- Introduced reusable methods:
lib/ui/pages/profile/profile_page.dart
- Enabled word capitalization in the legal guardian name text field.
lib/ui/pages/sign_in/sign_in_page.dart
- Connected the password recovery logic to the UI.
- Added robust error handling based on Supabase error codes.
- Provided confirmation prompt UI when email is not confirmed.
- Managed focus and keyboard state cleanly.
lib/ui/pages/sign_in/sign_in_view_model.dart
- Exposed recovery and reauthentication methods from the use case.
lib/ui/pages/sign_up/sign_up_page.dart
- Refactored one import path to follow root-relative pattern.
lib/utils/validates/sign_validate.dart
- Adjusted the password validation regex to exclude whitespace characters.
pubspec.yaml
- Bumped the app version to
0.22.01+50
.
- Bumped the app version to
supabase/config.toml
- Enabled email confirmations.
- Adjusted password requirements.
- Linked Supabase to HTML email templates for confirmation and recovery.
New Files
supabase/templates/confirmation.html
- HTML template used by Supabase to send confirmation emails.
supabase/templates/recovery.html
- HTML template used by Supabase to send password recovery emails.
Conclusion
The authentication system now supports full email-based password recovery and account confirmation flows, with enhanced UI feedback and improved configuration.
2025/05/16 – version: 0.22.01+50
Renamed section in README and standardized import paths in router
This commit updates the README section title to correctly reflect the current folder structure of the project based on the MVVM architecture. Additionally, it refactors import paths within router.dart
to use consistent root-relative imports (/ui/...
) instead of mixed relative patterns.
Modified Files
README.md
- Updated the section header from “Estrutura de Coleções do Firebase” to “Estrutura de Arquivos do Projeto no Padrão MVVM” to better reflect the current content.
lib/routing/router.dart
- Replaced multiple
../ui/...
and../data/...
relative imports with root-relative/ui/...
and/data/...
imports. - Ensured consistent and clean import formatting for all modules used in route configuration.
- Replaced multiple
Conclusion
The changes improve documentation clarity and maintain consistent import semantics across the routing layer, aligning with best practices for modular Flutter project organization.
2025/05/15 – version: 0.22.00+49
Refactored UI structure and adjusted imports to match new directory layout
This commit performs a comprehensive reorganization of the lib/ui/features/
directory structure into a new, more intuitive lib/ui/pages/
hierarchy. It also updates all relevant import statements throughout the application to reflect this new structure, aligning with standard practices for scalable Flutter projects. Minor style and consistency improvements in imports were also applied.
Modified Files
README.md
- Replaced outdated Firebase schema tree with a structured representation of the project’s MVVM folder layout.
lib/config/dependencies.dart
- Updated import path for
theme_view_model.dart
to reflect its new location.
- Updated import path for
lib/data/repositories/auth/remote_auth_repository.dart
- Converted relative import from
package:
to/
style forcache_database_service.dart
.
- Converted relative import from
lib/domain/models/schedule.dart
- Replaced
package:
import with relative/
path.
- Replaced
lib/domain/models/sportman.dart
- Adjusted import path to use a relative
/
reference for extensions.
- Adjusted import path to use a relative
lib/domain/use_cases/address_club_user_case.dart
- Updated import to use relative path for
server_names.dart
.
- Updated import to use relative path for
lib/main_app.dart
- Adjusted import for
theme_view_model.dart
due to file relocation.
- Adjusted import for
lib/routing/router.dart
- Updated all UI-related imports from
features/
topages/
. - Ensured consistency in the routing setup to reflect new structure.
- Updated all UI-related imports from
lib/ui/core/ui/...
files- Updated various
package:
style imports to relative/
references to improve maintainability and uniformity.
- Updated various
Conclusion
All UI components were successfully migrated to the pages
directory, and imports were refactored to ensure consistency across the project. This restructuring promotes clarity and maintainability as the codebase scales.
2025/05/15 – version: 0.21.02+48
Refactored club and home modules for improved UX and code cohesion
This commit introduces several enhancements across the club and home modules, focusing on usability, consistency, and architectural improvements. Notable changes include the integration of edit/remove actions via Dismissible
lists, refactored theme handling, unified avatar image management, and improvements in AccountManagementUseCase
.
Modified Files
doc/diagrama de classes.drawio
- Adjusted layout dimensions and positions.
- Renamed and replaced use case method names to reflect authentication semantics (
login
,logout
,signUp
, etc.). - Added new visual methods like
_processPhoto()
and updated others to better represent their intent.
lib/domain/models/schedule.dart
- Changed the string join separator from newline to comma for better display formatting.
lib/domain/use_cases/account_management_user_case.dart
- Refactored
updatePerson
to include internal photo processing via_processPhoto
. - Added
_processPhoto
method to manage avatar uploads or updates with storage fallback.
- Refactored
lib/domain/use_cases/address_club_user_case.dart
- Added error logging on logo update failure.
- Used a fallback to existing logo if the update result is null.
lib/routing/router.dart
- Passed existing
Club
asextra
when navigating toClubRegisterPage
. - Reordered constructor parameters to reflect logical dependency flow.
- Applied naming consistency (
viewModel
,authenticationUserCase
).
- Passed existing
lib/ui/core/ui/cards/address_card.dart
- Removed default margin from card to allow custom layout spacing externally.
lib/ui/core/ui/drawer/main_drawer.dart
- Replaced theme toggler with a simple
isDark
boolean for drawer rendering.
- Replaced theme toggler with a simple
lib/ui/core/ui/images/avatar_image.dart
- Renamed
imagePath
toimage
for consistency and clarity.
- Renamed
lib/ui/core/ui/images/select_avatar_image.dart
- Updated property reference from
imagePath
toimage
.
- Updated property reference from
lib/ui/core/ui/others/main_app_bar.dart
- Replaced
actionWidget
with a fullactions
list to support multiple actions. - Removed theme toggle logic from within the component.
- Replaced
lib/ui/features/address/address_page.dart
- Updated
MainAppBar
to use newactions
format.
- Updated
lib/ui/features/address/widgets/dismissible_address.dart
- Wrapped
Dismissible
widget in aPadding
to provide vertical spacing.
- Wrapped
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.
- Implemented
lib/ui/features/club/club_register/club_register_page.dart
- Added
_initialize()
to populate form when editing an existing club. - Ensured consistent assignment of
id
andcreatedAt
during form submission.
- Added
lib/ui/features/club/club_register/club_register_view_model.dart
- Replaced
Command1
forfetchAddress
with direct access to the use case method.
- Replaced
lib/ui/features/club/club_view_model.dart
- Implemented
deleteClub
method with success/failure logging.
- Implemented
lib/ui/features/home/home_page.dart
- Switched from ViewModel-based theme to centralized ViewModel state.
- Updated app bar and drawer to use unified state and toggle.
lib/ui/features/home/home_view_model.dart
- Integrated
ThemeViewModel
intoHomeViewModel
to centralize theme logic. - Added
toggleTheme
command andisDark
getter.
- Integrated
Conclusion
The modifications improve maintainability, clarity, and user experience, particularly around theming, club management, and state-driven UI updates. All modules compile and behave as expected.
2025/05/15 – version: 0.21.01+47
Refactored Storage Services and Club Management with Logo Upload Support
This commit introduces significant changes to unify and streamline the use of storage and database services across the codebase. It renames RemoteDatabaseService
and RemoteStorageService
to more general DatabaseService
and StorageService
. The commit also refactors the logic for managing club logos, allowing file upload, update, and deletion through a dedicated Supabase bucket (club_logos
), with proper RLS policies defined.
Modified Files
- lib/config/dependencies.dart
- Replaced
RemoteDatabaseService
andRemoteStorageService
withDatabaseService
andStorageService
. - Updated dependency injection for repositories.
- Replaced
- lib/data/repositories/address/remote_address_repository.dart
- Replaced
RemoteDatabaseService
with the newDatabaseService
.
- Replaced
- lib/data/repositories/clubs/club_repository.dart
- Added optional
forceRemote
parameter toinitialize
.
- Added optional
- 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
toclubs
). - Improved exception handling and added logs.
- lib/data/repositories/common/server_names.dart
- Added
clubLogos
constant to theBuckets
class.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated service references to use
DatabaseService
.
- Updated service references to use
- lib/data/repositories/profiles/remote_profile_repository.dart
- Updated service references to use
DatabaseService
.
- Updated service references to use
- lib/data/repositories/storage/remote_storage_repository.dart
- Replaced
RemoteStorageService
withStorageService
. - Updated
add
,update
, anddelete
methods to explicitly requirebucket
andurl
. - Removed fixed references to the
avatars
bucket.
- Replaced
- lib/data/repositories/storage/storage_repository.dart
- Updated interface methods to support configurable
bucket
andurl
parameters.
- Updated interface methods to support configurable
- lib/data/services/remote_database_service.dart
- Renamed class from
RemoteDatabaseService
toDatabaseService
.
- Renamed class from
- lib/data/services/remote_storage_service.dart
- Renamed class from
RemoteStorageService
toStorageService
. - Updated parameters in
add
andupdate
methods tofilePath
.
- Renamed class from
- lib/domain/enums/enums_sports.dart
- Added
byLabel
static method for retrievingSports
by their label.
- Added
- lib/domain/use_cases/account_management_user_case.dart
- Refactored
_processPhoto
to use newStorageRepository
interface withbucket
andfilePath
.
- Refactored
- 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
addClub
,updateClub
, anddeleteClub
.
- Injected
- lib/domain/use_cases/address_profile_user_case.dart
- Updated import paths to use project-relative style.
- lib/routing/router.dart
- Updated
AddressClubUserCase
injection to includeStorageRepository
.
- Updated
- lib/ui/core/ui/text_fields/select_text_field.dart
- Added
unfocus()
call to close keyboard before showing enum labels.
- Added
- lib/ui/features/club/club_page.dart
- Refactored
ListView
building to avoid usage of stale child builder.
- Refactored
- lib/ui/features/club/club_register/club_register_page.dart
- Added validation to all fields.
- Injected logo processing into save logic.
- Used merged
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
toisNotEmpty
for clarity and consistency.
- Renamed
- test/data/repositories/address/remote_address_repository_test.dart
- Replaced
RemoteDatabaseService
withDatabaseService
.
- Replaced
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated test passwords to stronger values.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Updated service name to
DatabaseService
.
- Updated service name to
- test/data/repositories/storage/remote_storage_repository_test.dart
- Refactored to support new
bucket
andfilePath
parameters.
- Refactored to support new
- test/data/services/remote_storage_service_test.dart
- Updated test references to renamed service and parameter names.
- test/data/services/supabase_auth_service_test.dart
- Updated test passwords to comply with stricter validation.
New Files
- supabase/migrations/20250515160917_create_club_logos_buckt.sql
- Creates
club_logos
bucket in Supabase with public access. - Adds RLS policies for
INSERT
,UPDATE
,DELETE
, andSELECT
to allow only authenticated users to manage their own files.
- Creates
Conclusion
The storage and database layers have been unified with more consistent naming and parameterization, improving clarity and flexibility. Club logo management is now fully integrated, with support for Supabase Storage and appropriate access control. The system remains stable and fully functional.
2025/05/14 – version: 0.21.01+46
Implement club schedule support and finalize club registration flow
This commit completes the implementation of club registration by enabling support for structured schedule data, enhanced form controls, and Supabase backend integration. It includes creation of a new SchedulePage
, form validation, extended input handling, and a dedicated database migration with row-level security policies.
Modified Files
- lib/data/repositories/clubs/remote_club_repository.dart
- Replaced all references from
Tables.club
toTables.clubs
. - Ensured consistency with updated table name across fetch, add, update, and delete operations.
- Replaced all references from
- lib/data/repositories/common/server_names.dart
- Renamed
club
→clubs
in theTables
class for plural consistency.
- Renamed
- lib/domain/enums/enums_declarations.dart
- Removed commented-out
AddressType
enum for cleanup.
- Removed commented-out
- lib/domain/enums/enums_sports.dart
- Added static method
byName()
to convert from string to enum value.
- Added static method
- lib/domain/models/club.dart
- Made
id
optional to support creation flows before persistence.
- Made
- lib/domain/models/operating_day.dart
- Added method
toHHMM()
to format operating times.
- Added method
- lib/domain/models/schedule.dart
- Introduced
scheduleMap
,copyWithDay
, and improvedtoString()
formatting for display and mutation.
- Introduced
- lib/routing/router.dart
- Added routing support for
/schedule
usingSchedulePage
, passing current schedule and onSave callback viaextra
.
- Added routing support for
- lib/routing/routes.dart
- Declared the
/schedule
route as a constant.
- Declared the
- lib/ui/core/ui/others/main_app_bar.dart
- Added
onBack
optional callback to override default navigation behavior.
- Added
- lib/ui/core/ui/text_fields/select_text_field.dart
- Improved customization by supporting
prefixIcon
as a widget.
- Improved customization by supporting
- lib/ui/features/club/club_register/club_register_page.dart
- Finalized the UI for club registration.
- Integrated
AvatarFormField
,SchedulePage
, andCurrencyEditingController
. - Added full form validation, edit support, and submission logic.
- lib/ui/features/club/club_register/club_register_view_model.dart
- Added
userId
getter to simplify access to the current user.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Simplified image validator by using centralized
GenericsValidate.image
.
- Simplified image validator by using centralized
- lib/ui/features/profile/profile_page.dart
- Adapted to new
SelectTextField
customization.
- Adapted to new
- lib/utils/validates/generics_validate.dart
- Added
image
validator method to ensure photo input isn’t null or empty.
- Added
New Files
- lib/ui/features/club/club_register/widgets/schedule_page.dart
- A new interactive page for selecting weekly schedule with duration and time pickers.
- lib/utils/extensions/time_of_day_extension.dart
- Extension on
TimeOfDay
for arithmetic and display formatting.
- Extension on
- lib/ui/core/ui/editing_controllers/currency_editing_controller.dart
- Custom
TextEditingController
for currency input with formatting and parsing.
- Custom
- 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
andcreated_at
.
- Migration script to create the
Conclusion
The club registration process is now fully functional, complete with schedule management, validation, and backend integration. These changes improve user experience and data integrity, supporting future scalability.
2025/05/14 – version: 0.21.01+45
Refactor profile and address handling to use full Address objects
This commit refactors how address selection and profile association are handled across the UI. Instead of relying solely on address IDs, Address
objects are now passed and retained throughout components. This approach simplifies the logic and avoids redundant fetches. Additionally, minor refinements were made to enums and text field components for consistency and flexibility.
Modified Files
- lib/domain/enums/enums_declarations.dart
- Refined comment for
UserRole.collaborator
to clarify its purpose.
- Refined comment for
- lib/domain/enums/enums_sports.dart
- Added
labels
anddescriptions
accessors for UI binding.
- Added
- lib/domain/use_cases/address_user_case.dart
- Added a new
fetch
method to retrieve full address data by ID.
- Added a new
- lib/ui/core/ui/form_fields/address_form_field.dart
- Updated the
selectAddress
callback to work withAddress?
instead ofString?
.
- Updated the
- lib/ui/core/ui/text_fields/select_text_field.dart
- Changed
iconData
toprefixIcon
to allow greater customization of input decorations. - Made
hintText
optional.
- Changed
- 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.
- Refactored address selection to use
- lib/ui/features/address/address_view_model.dart
- Exposed
fetch
function to allow address fetching by ID.
- Exposed
- lib/ui/features/address/widgets/dismissible_address.dart
- Updated address selection callback to return the
Address
object.
- Updated address selection callback to return the
- lib/ui/features/club/club_register/club_register_page.dart
- Implemented the club form UI with support for selecting an address and sport type.
- lib/ui/features/home/person_register/person_resister_page.dart
- Migrated to use
prefixIcon
forSelectTextField
.
- Migrated to use
- lib/ui/features/profile/profile_page.dart
- Refactored address handling to work with full
Address
objects. - Removed dependency on
Command1
forfetchAddress
, using direct function call instead. - Simplified the state handling during profile initialization.
- Refactored address handling to work with full
- lib/ui/features/profile/profile_view_model.dart
- Replaced
Command1
with a plain function forfetchAddress
to align with other use cases.
- Replaced
Conclusion
Address handling is now more robust and cohesive throughout the app. The refactor improves code clarity and reduces unnecessary complexity in address resolution and state synchronization.
2025/05/14 – version: 0.21.01+44
Add club management feature with new use case, UI pages, and routing
This commit introduces a complete feature for managing sports clubs, including data access layers, use cases, UI pages, and route configurations. It also removes the now-inlined AccountManagementUseCase
from the global provider list, reorganizes app bar imports, and enhances naming consistency in constructors and internal properties.
Modified Files
- lib/config/dependencies.dart
- Removed the global
AccountManagementUseCase
provider. - Registered the new
RemoteClubRepository
with the DI container. - Renamed parameters for consistency (
service
→databaseService
).
- Removed the global
- lib/data/repositories/address/remote_address_repository.dart
- Renamed constructor parameter
service
todatabaseService
for clarity.
- Renamed constructor parameter
- lib/data/repositories/clubs/remote_club_repository.dart
- Standardized constructor parameters (
cacheService
,databaseService
). - Changed
_userId
to nullable. - Cleared
_userId
on logout.
- Standardized constructor parameters (
- lib/data/repositories/profiles/remote_profile_repository.dart
- Renamed parameter
remoteService
todatabaseService
.
- Renamed parameter
- lib/domain/use_cases/address_profile_user_case.dart
- Renamed
fetch
tofetchAddress
for consistency with new use cases.
- Renamed
- lib/routing/router.dart
- Injected
AccountManagementUseCase
inline into the respective view models. - Added routes for
clubs
andclubRegister
, initializing view models withAddressClubUserCase
.
- Injected
- lib/routing/routes.dart
- Added two new routes:
clubs
andclubRegister
.
- Added two new routes:
- lib/ui/core/ui/drawer/main_drawer.dart
- Added a menu entry for
Clubes
that is shown when the user is logged in.
- Added a menu entry for
- lib/ui/features/address/address_page.dart
- lib/ui/features/address/address_register/address_register_page.dart
- lib/ui/features/home/home_page.dart
- lib/ui/features/home/person_register/person_resister_page.dart
- lib/ui/features/profile/profile_page.dart
- Updated imports of
main_app_bar.dart
to its new location (core/ui/others
). - Adjusted ViewModel usage patterns for consistency.
- Ensured creation timestamps fall back to existing values when editing.
- Updated imports of
- lib/ui/features/profile/profile_view_model.dart
- Updated reference to renamed method
fetchAddress
.
- Updated reference to renamed method
- test/data/repositories/address/remote_address_repository_test.dart
- Updated parameter name to
databaseService
inRemoteAddressRepository
.
- Updated parameter name to
New Files
- lib/domain/use_cases/address_club_user_case.dart
- Encapsulates interaction logic between address and club repositories.
- lib/ui/features/club/club_page.dart
- Displays a list of registered clubs with actions for creating and managing clubs.
- lib/ui/features/club/club_register/club_register_page.dart
- Scaffold for creating or editing clubs, integrated with
ClubRegisterViewModel
.
- Scaffold for creating or editing clubs, integrated with
- lib/ui/features/club/club_register/club_register_view_model.dart
- ViewModel handling commands for CRUD operations related to clubs.
- lib/ui/features/club/club_view_model.dart
- Handles data loading and UI binding for the club listing page.
Conclusion
The club feature is now fully integrated with the system architecture, routing, and UI. The changes follow consistent architectural patterns and are ready for further extension and testing.
2025/05/12 – version: 0.21.00+43
Refactor profile state and enhance profile submission handling
This commit refactors the internal naming of the profile state in the RemoteProfileRepository
, replacing _manager
with the more semantically accurate _profile
. It also extends the profile form submission on the UI side, introducing logic to handle and construct additional document types when creating or updating a Profile
. Lastly, it improves password security in the Supabase config and fixes a policy target in a SQL migration.
Modified Files
- lib/data/repositories/profiles/remote_profile_repository.dart
- Renamed
_manager
to_profile
for consistency and clarity across internal state. - Updated all related references and assignments accordingly.
- Maintained functional behavior while improving semantic accuracy.
- Renamed
- lib/ui/features/profile/profile_page.dart
- Added
_createProfile()
method to encapsulate profile creation logic. - Included support for additional document types (
RG
,CNH
,CNPJ
) using a second document field. - Connected profile creation and update operations to the appropriate view model methods.
- Ensured safe fallback when no profile is found during initialization.
- Added
- supabase/config.toml
- Strengthened password requirements by setting
password_requirements
to"lower_upper_letters_digits_symbols"
.
- Strengthened password requirements by setting
- supabase/migrations/20250512192942_create_profile_table.sql
- Fixed incorrect policy reference by changing
ON person
toON profile
inselect_own_profile
.
- Fixed incorrect policy reference by changing
Conclusion
The changes streamline profile state handling, extend profile creation capabilities, and reinforce backend security. All features are now consistent and functional.
2025/05/12 – version: 0.20.04+42
Added club repository support and unified cache management
This commit introduces the ClubRepository
and its implementation, enabling full CRUD operations for club data integrated with both cache and remote services. Additionally, it unifies cache handling across multiple repositories (Address
, Profile
, Auth
) and renames/reorganizes profile-related files for better modularity.
Modified Files
- lib/config/dependencies.dart
- Adjusted imports for
ProfileRepository
. - Injected
CacheDatabaseService
intoRemoteAuthRepository
.
- Adjusted imports for
- lib/data/repositories/address/address_repository.dart
- Added
logout()
method to clear local address data.
- Added
- lib/data/repositories/address/remote_address_repository.dart
- Renamed internal variables for clarity (
_prefs
→_cacheService
,_service
→_databaseService
). - Replaced references to old Supabase service with updated abstractions.
- Added
logout()
to clear address memory cache.
- Renamed internal variables for clarity (
- lib/data/repositories/auth/remote_auth_repository.dart
- Added optional injection of
CacheDatabaseService
. - Cleared cache on login and logout events.
- Added optional injection of
- lib/data/repositories/common/server_names.dart
- Added
club
table constant. - Introduced
ClubTableColumns
definition.
- Added
- lib/data/repositories/profiles/profile/profile_repository.dart → lib/data/repositories/profiles/profile_repository.dart
- Moved and refactored the interface file for cleaner structure.
- lib/data/repositories/profiles/profile/remote_profile_repository.dart → lib/data/repositories/profiles/remote_profile_repository.dart
- Adjusted imports and variable names (
_localService
→_cacheService
). - Now consistently uses
_cacheService
across all methods.
- Adjusted imports and variable names (
- lib/data/services/cache_database_service.dart
- Added
clear()
method to reset shared preferences storage.
- Added
- lib/domain/models/club.dart
- Made
id
field nullable. - Renamed
toJson()
totoJsonString()
andfromJson()
tofromJsonString()
. - Removed unused
toString
, equality, andhashCode
overrides.
- Made
- lib/domain/use_cases/address_profile_user_case.dart
- Adjusted import path for
ProfileRepository
.
- Adjusted import path for
- lib/routing/router.dart
- Fixed inconsistent import paths and formatting for route definitions.
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Assigned default value
1
tomaxLines
.
- Assigned default value
- lib/ui/features/profile/profile_page.dart
- Ensures
_isEditing
is set totrue
after successful profile load.
- Ensures
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated repository instantiation to use named parameters.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Implemented the
clear()
method in theFakeCache
class.
- Implemented the
- test/domain/models/club_test.dart
- Updated calls to use
toJsonString
andfromJsonString
.
- Updated calls to use
New Files
- lib/data/repositories/clubs/club_repository.dart
- Defines the
ClubRepository
interface with standard CRUD and session-related methods.
- Defines the
- lib/data/repositories/clubs/remote_club_repository.dart
- Implements the
ClubRepository
with support for memory caching, local storage, and remote fetch using Supabase.
- Implements the
Conclusion
The system now supports club data operations and has a unified strategy for clearing cached data across repositories. All changes have been tested and are functionally stable.
2025/05/12 – version: 0.20.03+41
Migrate profile roles into unified model and implement remote profile persistence
This commit introduces a significant refactor to how user profiles are modeled and persisted. The previous individual classes for each user role (AthleteProfile
, ManagerRole
, etc.) have been consolidated into a single Profile
model. A new repository layer was added to handle remote profile data storage using Supabase. Supporting updates were made to view models, use cases, and routing to align with the new structure.
Modified Files
- lib/config/dependencies.dart
- Registered
ProfileRepository
andRemoteProfileRepository
. - Aligned providers for
AuthRepository
,StorageRepository
, and others.
- Registered
- lib/data/repositories/auth/auth_repository.dart
AuthRepository
now extendsChangeNotifier
.
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated implementation to extend
ChangeNotifier
.
- Updated implementation to extend
- lib/data/repositories/common/server_names.dart
- Added new constant
Tables.profile
.
- Added new constant
- lib/data/repositories/person/remote_person_repository.dart
- Improved error handling and consistency in
delete
andlogout
.
- Improved error handling and consistency in
- lib/domain/enums/enums_declarations.dart
- Adjusted role label (“Presidente” → “Gerente”).
- Added static method
byName
toSex
enum for safer parsing.
- lib/domain/models/document.dart
- Added named constructors for each document type (
cpf
,rg
, etc.).
- Added named constructors for each document type (
- lib/domain/use_cases/account_management_user_case.dart
- Refactored to use interface
StorageRepository
.
- Refactored to use interface
- lib/domain/use_cases/address_profile_user_case.dart
- Integrated
ProfileRepository
and exposedprofile
,addProfile
, andupdateProfile
.
- Integrated
- lib/routing/router.dart
- Updated route setup for
ProfilePage
to includePersonRepository.role
. - Injected
ProfileRepository
intoAddressProfileUserCase
.
- Updated route setup for
- lib/ui/core/ui/cards/address_card.dart
- Cleaned up import statements.
- lib/ui/core/ui/form_fields/sex_form_field.dart
- Fixed layout inconsistencies and ensured state sync on updates.
- lib/ui/features/profile/profile_page.dart
- Enhanced to load and bind existing profile data on edit.
- Added logic to differentiate between create and update flows.
- Integrated profile document selection and form feedback.
- lib/ui/features/profile/profile_view_model.dart
- Exposed
addProfile
,updateProfile
,userId
, and currentprofile
.
- Exposed
New Files
- lib/data/repositories/profiles/profile/profile_repository.dart
- Interface defining contract for profile repository.
- lib/data/repositories/profiles/profile/remote_profile_repository.dart
- Implementation of
ProfileRepository
using Supabase and local caching. - Handles
fetch
,add
,update
,delete
, and initialization logic.
- Implementation of
- lib/domain/models/profile.dart
- Unified
Profile
model supporting all role data (sex, cpf, guardian, etc.). - Includes serialization and equality methods.
- Unified
Deleted Files
- lib/domain/models/profiles/*.dart
- Removed separate profile models:
athlete_profile.dart
,manager_profile.dart
, etc. - Superseded by the unified
Profile
class.
- Removed separate profile models:
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
andsex
.
- Created
Conclusion
This refactor unifies profile management across roles, simplifies the model structure, and improves scalability by centralizing persistence through a dedicated repository and Supabase table. The system is now consistent, extensible, and ready for future profile-related features.
2025/05/12 – version: 0.20.02+40
Refactor repository interfaces and introduce profile form system
This commit introduces several structural enhancements to the application. Repository contracts were updated to use Dart’s interface
keyword for clarity and explicit implementation. A new profile form system was implemented, enabling user-specific data input based on their role. The codebase now includes a complete UI for editing profile details, with new reusable components for form fields and address selection.
Modified Files
- lib/data/repositories/address/address_repository.dart
- Converted
abstract class
toabstract interface class
.
- Converted
- lib/data/repositories/auth/auth_repository.dart
- Changed to
abstract interface class
for consistency.
- Changed to
- lib/data/repositories/auth/dev_auth_repository.dart
- Explicitly implemented
AuthRepository
usingimplements
.
- Explicitly implemented
- lib/data/repositories/person/person_repository.dart
- Updated to
abstract interface class
.
- Updated to
- lib/data/repositories/storage/storage_repository.dart
- Converted to
abstract interface class
.
- Converted to
- lib/domain/enums/enums_declarations.dart
- Introduced
EnumLabel
interface to support custom labeled enums. Sex
enum now implementsEnumLabel
.
- Introduced
- lib/domain/enums/enums_sports.dart
- Changed
Position
to anabstract interface class
.
- Changed
- lib/domain/models/person.dart
- Simplified
toMap()
method using direct assignments. - Cleaned up import statements.
- Simplified
- lib/domain/models/profiles/*.dart
- Refactored all user profile classes (
AthleteProfile
,EnthusiastRole
,HeadHunterRole
,ManagerRole
) to extendUserProfile
as abase class
. - Centralized common fields (id, addressId, sex, createdAt, updatedAt) in
UserProfile
.
- Refactored all user profile classes (
- lib/main_app.dart
- Commented out unnecessary
labelStyle
configurations inInputDecorationTheme
.
- Commented out unnecessary
- lib/routing/router.dart
- Updated route for address selection to accept
addressId
viastate.extra
. - Added new route for
/profile
mapped toProfilePage
.
- Updated route for address selection to accept
- lib/routing/routes.dart
- Declared new route constant
Routes.profile
.
- Declared new route constant
- lib/ui/features/address/address_page.dart
- Supports pre-selection of address using
widget.addressId
.
- Supports pre-selection of address using
- lib/ui/features/address/widgets/dismissible_address.dart
- Replaced inline
ListTile
with new reusableAddressCard
.
- Replaced inline
- lib/ui/features/home/home_page.dart
- Added
_navToProfile()
method and integrated it with the drawer.
- Added
- lib/ui/core/ui/drawer/main_drawer.dart
- Added new menu item for “Perfil” with callback
profile
.
- Added new menu item for “Perfil” with callback
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added support for
maxLines
andminLines
.
- Added support for
- lib/utils/commands.dart
- Updated
Command
class declaration to useinterface
.
- Updated
New Files
- lib/domain/use_cases/address_profile_user_case.dart
- Encapsulates business logic for loading and fetching user addresses in profile context.
- lib/ui/core/others/address_name_icon.dart
- Maps common address name prefixes to material icons.
- lib/ui/core/ui/cards/address_card.dart
- Stateless UI component to display address information consistently.
- lib/ui/core/ui/form_fields/address_form_field.dart
- Custom
FormField<String>
widget to select and display addresses interactively.
- Custom
- lib/ui/core/ui/form_fields/sex_form_field.dart
- Custom
FormField<Sex>
widget with toggle button interface.
- Custom
- lib/ui/core/ui/text_fields/toggle_buttons_text.dart
- Helper widget to style labeled buttons inside a
ToggleButtons
widget.
- Helper widget to style labeled buttons inside a
- lib/ui/features/profile/profile_page.dart
- Full profile editing page supporting sex, address, CPF, and role-specific documents.
- lib/ui/features/profile/profile_view_model.dart
- View model handling address loading and reactive state for profile editing.
Conclusion
These changes improve architectural clarity through the use of Dart’s interface
keyword and introduce a scalable, modular profile editing system with reusable UI components.
2025/05/09 – version: 0.20.01+39
Simplified model serialization and introduced role-based profile structure
This commit refactors multiple domain model classes by simplifying their toMap()
implementations using direct assignments. It also removes the generic Athlete
model and introduces a structured, role-based system for user profiles, encapsulating data for athletes, managers, enthusiasts, and headhunters in dedicated classes.
Modified Files
- lib/domain/models/address.dart
- Simplified
toMap()
method using direct key assignments to improve readability.
- Simplified
- lib/domain/models/club.dart
- Replaced verbose
addAll
usage intoMap()
with clean key-value assignments.
- Replaced verbose
- lib/domain/models/document.dart
- Simplified
toMap()
logic.
- Simplified
- lib/domain/models/location.dart
- Improved
toMap()
structure with direct map key assignments.
- Improved
- lib/domain/models/operating_day.dart
- Refactored
toMap()
to avoid intermediateresult
map.
- Refactored
- lib/domain/models/person.dart
- Refactored
toMap()
usingaddAll
only once and removed unnecessary intermediate variable.
- Refactored
- lib/domain/models/schedule.dart
- Rewrote
toMap()
to conditionally include fields using conciseif
statements.
- Rewrote
- lib/domain/models/sportman.dart
- Applied a cleaner, more direct mapping approach in
toMap()
for better performance and clarity.
- Applied a cleaner, more direct mapping approach in
- lib/domain/models/viacep_address.dart
- Modernized
toMap()
method using direct key assignments.
- Modernized
New Files
- lib/domain/models/profiles/athlete_profile.dart
- Defines
AthleteProfile
as a concrete implementation ofUserProfile
, encapsulating athlete-specific fields.
- Defines
- lib/domain/models/profiles/enthusiast_profile.dart
- Defines
EnthusiastRole
as a user profile for casual participants with minimal fields.
- Defines
- lib/domain/models/profiles/head_hunter_profile.dart
- Implements
HeadHunterRole
for scout-style users withcpfDoc
and address fields.
- Implements
- lib/domain/models/profiles/manager_profile.dart (renamed from
manager.dart
)- Introduces
ManagerRole
, renaming and cleaning up the original manager model and aligning it with the new profile structure.
- Introduces
- lib/domain/models/profiles/user_profile.dart
- Declares the
UserProfile
abstract class used to standardize role-specific user profiles.
- Declares the
Deleted Files
- lib/domain/models/athlete.dart
- Removed the outdated
Athlete
class in favor of the newAthleteProfile
under the profile-based architecture.
- Removed the outdated
Conclusion
This update provides a significant architectural improvement by introducing explicit role-based profile models and modernizing data serialization. The changes enhance type safety, modularity, and code clarity across the domain layer.
2025/05/09 – version: 0.20.00+38
Refactored UI Widgets to Improve Decoupling and Flexibility
This commit introduces refinements to reduce widget coupling and improve modularity across the address registration and home screen components. Theme control and navigation logic have been abstracted to enhance reusability and readability in the MainAppBar
.
Modified Files
- lib/ui/features/address/address_register/address_register_page.dart
- Removed explicit back button from the AppBar, delegating navigation responsibility to the
MainAppBar
.
- Removed explicit back button from the AppBar, delegating navigation responsibility to the
- lib/ui/features/home/home_page.dart
- Passed explicit theme toggling parameters (
onToggleTheme
andisDarkMode
) toMainAppBar
. - Enabled the drawer by setting
useDrawer: true
for the home page AppBar.
- Passed explicit theme toggling parameters (
- lib/ui/features/home/widgets/main_app_bar.dart
- Refactored
MainAppBar
to:- Accept
onToggleTheme
andisDarkMode
as parameters instead of aThemeViewModel
. - Conditionally show a drawer button or back navigation icon based on
useDrawer
andleading
. - Simplify and decouple logic for theme toggle icon rendering.
- Accept
- Refactored
Conclusion
These adjustments improve code modularity, make the MainAppBar
more reusable, and better isolate UI responsibilities, contributing to a cleaner and more maintainable architecture.
2025/05/09 – version: 0.15.06+37
Updated data models and router logic for streamlined user flow
This commit refactors multiple domain model classes for consistency in date handling, updates the authentication interface to simplify property naming, and simplifies router and navigation logic related to address management. It also enhances UI components for a better user experience.
Modified Files
- doc/diagrama de classes.drawio
- Updated method return types from
Acougue
to specific domain models (Manager
,Athlete
,Enthusiast
,Headhunter
) to reflect actual model responsibilities. - Adjusted graph model dimensions.
- Updated method return types from
- lib/data/repositories/auth/auth_repository.dart
- Renamed
userAuth
getter touser
for cleaner access to authenticated user.
- Renamed
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated implementation to match new
user
getter.
- Updated implementation to match new
- lib/data/repositories/auth/remote_auth_repository.dart
- Replaced
userAuth
withuser
, aligning with new AuthRepository interface.
- Replaced
- lib/domain/models/athlete.dart
- Replaced manual date parsing with
DateTimeMapper
. - Refactored field initialization order for better clarity.
- Replaced manual date parsing with
- lib/domain/models/club.dart
- Unified date serialization using
DateTimeMapper
.
- Unified date serialization using
- lib/domain/models/manager.dart
- Made
sex
optional. - Replaced manual
toUtc().toIso8601String()
withDateTimeMapper
. - Removed unused
toJson
,fromJson
,toString
,==
, andhashCode
methods.
- Made
- lib/domain/models/person.dart
- Unified date serialization/deserialization via
DateTimeMapper
.
- Unified date serialization/deserialization via
- lib/domain/models/sportman.dart
- Made
updatedAt
required with fallback initialization. - Replaced raw date handling with
DateTimeMapper
.
- Made
- lib/domain/use_cases/account_management_user_case.dart
- Updated all usages of
userAuth
to newuser
getter.
- Updated all usages of
- lib/routing/router.dart
- Simplified route builders to avoid explicit passing of userId via
state.extra
. - Used
RemoteAuthRepository
context to fetch authenticateduserId
.
- Simplified route builders to avoid explicit passing of userId via
- lib/ui/features/address/address_page.dart
- Added a back button to
AppBar
. - Simplified navigation by removing extra argument passing.
- Added a back button to
- lib/ui/features/address/address_register/address_register_page.dart
- Added leading back button in the AppBar.
- Improved pre-filling form fields in editing mode.
- Set address ID when editing existing address.
- lib/ui/features/address/widgets/dismissible_address.dart
- Added
getLeadingIcon()
to infer icon from address name category.
- Added
- lib/ui/features/home/home_page.dart
- Refactored
_navToAddresses
to use async navigation and print selected address ID on return.
- Refactored
- lib/ui/features/home/widgets/main_app_bar.dart
- Added optional
leading
parameter to allow custom back buttons in AppBar.
- Added optional
- lib/utils/extensions/date_time_extensions.dart
- Added
DateTimeMapper
helper class to unify date parsing and formatting throughout the codebase.
- Added
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated tests to reflect renamed
userAuth
getter asuser
.
- Updated tests to reflect renamed
Conclusion
All changes aim to improve clarity, maintainability, and consistency across models, navigation logic, and UI components. The application remains stable and functionally complete.
2025/05/08 – version: 0.15.05+36
Add address CRUD flow with Dismissible UI and enhanced CEP validation
This update implements the full address management workflow, including Create, Read, Update, and Delete (CRUD) operations. It also introduces new UI widgets for dismissible actions and message dialogs, enhancing usability and feedback. Additionally, CEP validation via ViaCEP API was improved with more robust error handling and a standardized feedback mechanism.
Modified Files
- lib/data/services/viacep_service.dart
- Fixed ViaCEP error field check (
'erro' == 'true'
) to align with the actual API response format.
- Fixed ViaCEP error field check (
- lib/domain/models/address.dart
- Added
fullAddress
computed property to format a complete address string.
- Added
- lib/domain/use_cases/address_user_case.dart
- Extended use case to support
add
,update
, anddelete
methods for address operations.
- Extended use case to support
- lib/ui/core/ui/messages/app_snack_bar.dart
- Added
isError
flag to differentiate success and error snackbars with distinct color schemes.
- Added
- lib/ui/core/ui/messages/show_simple_floating_message.dart
- Enhanced to support custom
iconData
, returnbool?
result, and more flexible layout.
- Enhanced to support custom
- lib/ui/core/ui/texts/parse_rich_text.dart
- Ensured color consistency for bold/italic text segments using
onSurface
.
- Ensured color consistency for bold/italic text segments using
- lib/ui/features/address/address_page.dart
- Connected dismissible UI to
edit
,delete
, andselect
handlers. - Improved help message presentation with contextual icons.
- Connected dismissible UI to
- lib/ui/features/address/address_register/address_register_page.dart
- Integrated validation with CEP lookup.
- Managed form submission logic for both add and update flows.
- Added feedback via
AppSnackBar
andshowSimpleMessage
.
- lib/ui/features/address/address_register/address_register_view_model.dart
- Refactored to include
add
andupdate
commands. - Removed internal method wrappers in favor of direct use case delegation.
- Refactored to include
- lib/ui/features/address/address_view_model.dart
- Added
delete
command usingAddressUserCase
.
- Added
New Files
- lib/ui/core/ui/dismissible/dismissible_container.dart
- Utility widget to generate configurable swipe backgrounds for dismissible elements.
- lib/ui/features/address/widgets/dismissible_address.dart
- Encapsulates the
Dismissible
behavior for address cards with swipe actions for edit and delete.
- Encapsulates the
Conclusion
This update delivers a polished, interactive address management interface, backed by robust service and validation layers. Users can now reliably create, update, and remove addresses with immediate visual feedback and support for postal code lookups.
2025/05/08 – version: 0.15.04+35
Refactor imports, formatting, and layout improvements across UI and infrastructure
This update standardizes import styles by converting absolute imports to relative ones, enhancing modularity and portability. It also introduces a reusable cardMessage
widget and a showSimpleMessage
dialog for displaying formatted messages. The address registration flow was polished with focus node transitions and better UI guidance through help dialogs and tooltips.
Modified Files
- README.md
- Replaced section titles from Portuguese “Conclusão” to “Conclusion” for consistency in commit structure.
- lib/config/dependencies.dart
- lib/data/repositories/person/person_repository.dart
- lib/data/repositories/storage/storage_repository.dart
- lib/data/services/remote_database_service.dart
- lib/domain/use_cases/address_user_case.dart
- lib/ui/features/address/address_view_model.dart
- lib/ui/features/app/view_model/theme_view_model.dart
- lib/ui/features/sign_up/sign_up_page.dart
- lib/ui/features/splash/splash_page.dart
- Replaced absolute imports (
package:sports/...
) with relative paths for cohesion and maintainability.
- Replaced absolute imports (
- lib/domain/models/viacep_address.dart
- Removed unused
toJson()
andfromJson()
methods to reduce unnecessary code.
- Removed unused
- lib/main_app.dart
- Customized
InputDecorationTheme
for both light and dark themes to ensure consistent label/hint styling.
- Customized
- lib/routing/router.dart
- Standardized imports and ensured proper formatting.
- lib/ui/core/ui/drawer/main_drawer.dart
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Switched to relative imports for better modular consistency.
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added
nextFocusNode
to facilitate keyboard navigation between fields.
- Added
- lib/ui/core/ui/text_fields/sugestions_text_field.dart
- Integrated
nextFocusNode
to auto-focus the next field upon selection.
- Integrated
- lib/ui/features/address/address_page.dart
- Added contextual help using a new help icon and dialog message.
- Replaced static empty-state message with reusable
cardMessage
.
- lib/ui/features/address/address_register/address_register_page.dart
- Enhanced field navigation with
FocusNode
usage. - Improved input flow and validation UX for address registration.
- Enhanced field navigation with
- lib/ui/features/home/widgets/main_app_bar.dart
- Added support for injecting custom action widgets (e.g., help button) into the app bar.
- lib/utils/validates/address_validate.dart
- Updated import to relative path.
New Files
- lib/ui/core/ui/messages/card_message.dart
- A widget for reusable card-based message display using a consistent layout and typography.
- lib/ui/core/ui/messages/show_simple_floating_message.dart
- Provides a floating dialog box for help messages, with rich text formatting support.
- lib/ui/core/ui/texts/parse_rich_text.dart
- Utility function to parse and render bold/italic markers and optional leading icons from a text string.
Conclusion
The codebase is now more modular, readable, and user-friendly, with improved navigation, help messaging, and consistent UI behavior across themes.
2025/05/07 – version: 0.15.03+34
Add support for address registration and ZIP code lookup
This commit introduces full address registration functionality in the app, including the ability to register, edit, and view addresses. It also integrates a service for retrieving address data from the ViaCEP API based on ZIP code input. The address repository now interacts with a remote service abstraction, improving testability and modularity.
Modified Files
- lib/config/dependencies.dart
- Registered
RemoteAddressRepository
andViaCepService
in the dependency graph.
- Registered
- 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.
- Refactored to use
- lib/data/repositories/common/server_names.dart
- Added constants for
AddressTableColumns
.
- Added constants for
- lib/data/services/remote_database_service.dart
- Added
add()
method that auto-generates UUIDs if needed and returns the inserted ID. - Changed
update()
to return the ID after a successful operation.
- Added
- lib/domain/models/person.dart
- Changed default role from
athlete
tonone
.
- Changed default role from
- lib/routing/router.dart
- Refactored to use named route objects instead of raw strings.
- Added navigation to address pages with parameters.
- lib/routing/routes.dart
- Replaced raw route strings with named route constants encapsulated in a
Route
class.
- Replaced raw route strings with named route constants encapsulated in a
- lib/ui/core/ui/drawer/main_drawer.dart
- Added a new navigation entry for the addresses screen.
- lib/ui/core/ui/text_fields/select_text_field.dart
- Refactored field names to be more generic (
enumLabels
→labels
,enumDescriptions
→descriptions
).
- Refactored field names to be more generic (
- lib/ui/features/home/home_page.dart
- Integrated navigation to the address management screen via the drawer.
- Adjusted routing for sign-out and person registration.
- lib/ui/features/home/person_register/person_resister_page.dart
- Adjusted field initialization for
UserRole
and updated prop names inSelectTextField
.
- Adjusted field initialization for
- lib/ui/features/sign_in/sign_in_page.dart
- lib/ui/features/sign_up/sign_up_page.dart
- lib/ui/features/splash/splash_page.dart
- Replaced raw route strings with
Routes.*.path
.
- Replaced raw route strings with
- test/data/repositories/address/remote_address_repository_test.dart
- Updated tests to use
RemoteDatabaseService
instead ofSupabaseClient
.
- Updated tests to use
New Files
- lib/data/services/viacep_service.dart
- Provides integration with the ViaCEP API to fetch address data from ZIP codes.
- lib/domain/models/viacep_address.dart
- Defines the model for deserialized responses from the ViaCEP service.
- lib/domain/use_cases/address_user_case.dart
- Encapsulates address operations and delegates data fetching and ZIP code lookup.
- lib/ui/features/address/address_page.dart
- Presents the list of addresses and allows navigation to the registration screen.
- lib/ui/features/address/address_register/address_register_page.dart
- Contains the full form for registering or editing addresses, integrated with ViaCEP lookup.
- lib/ui/features/address/address_register/address_register_view_model.dart
- ViewModel that manages address registration logic and API integration.
- lib/ui/features/address/address_view_model.dart
- Updated to delegate to the
AddressUserCase
abstraction.
- Updated to delegate to the
- lib/ui/core/ui/text_fields/sugestions_text_field.dart
- Custom text field with suggestions displayed as chips.
- lib/utils/validates/address_validate.dart
- Contains field validation logic for the address registration form.
Assets and Test Data
- test/data/services/viacep_service_test.dart
- Unit tests for
ViaCepService
, validating data retrieval from real API endpoints.
- Unit tests for
Conclusion
Address management and ZIP code lookup have been successfully implemented, enhancing the app’s user onboarding and data consistency features.
2025/05/07 – version: 0.15.02+33
Renamed LocalDatabaseService to CacheDatabaseService and introduced Address UI layer
This update improves naming consistency by renaming LocalDatabaseService
to CacheDatabaseService
, reflecting its purpose more clearly. Additionally, it introduces a new UI module for managing user addresses, including the page and view model. Integration and unit tests were updated to reflect these changes, and a legacy test file was removed in favor of a new structured version.
Modified Files
- lib/config/dependencies.dart
- Replaced all references from
LocalDatabaseService
toCacheDatabaseService
in dependency injection.
- Replaced all references from
- lib/data/repositories/address/remote_address_repository.dart
- Updated constructor and field types to use
CacheDatabaseService
.
- Updated constructor and field types to use
- lib/data/repositories/person/remote_person_repository.dart
- Replaced usage of
LocalDatabaseService
withCacheDatabaseService
.
- Replaced usage of
- 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.
- Renamed the file and class to
- lib/ui/features/app/view_model/theme_view_model.dart
- Updated class dependency from
LocalDatabaseService
toCacheDatabaseService
.
- Updated class dependency from
- supabase/migrations/20250417191633_create_address_table.sql
- Minor formatting adjustment for SQL RLS policies.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Replaced interface reference for
FakeCache
to implementCacheDatabaseService
.
- Replaced interface reference for
- test/data/services/remote_storage_service_test.dart
- Changed test bucket to use a dynamically generated UUID-based name to avoid conflicts.
- test/data/services/shared_preferences_service_test.dart
- Updated service under test to
CacheDatabaseService
.
- Updated service under test to
New Files
- lib/ui/features/address/address_page.dart
- UI page for displaying address data with a floating action button.
- lib/ui/features/address/address_view_model.dart
- View model with a command-based approach to loading address data.
- test/data/repositories/address/remote_address_repository_test.dart
- New integration test for the address repository using updated service names and patterns.
Deleted Files
- test/data/repositories/address/remote_address_repository_integration_test.dart
- Removed legacy test in favor of a structured and updated test implementation.
Conclusion
All changes are complete and functional. The codebase now uses clearer service names and includes a solid base for address-related UI functionality.
2025/05/06 – version: 0.15.00+31
Enhance Supabase security policies and finalize backend storage setup
This commit addresses a previously undocumented technical issue related to Supabase security rules. The problem arose from insufficient or improperly configured Row-Level Security (RLS) and required alignment between client access policies and server-side storage constraints. After extensive investigation, including discussions with both ChatGPT and Supabase’s own AI assistant, the final resolution was found by thoroughly consulting Supabase’s official documentation. These backend adjustments ensure proper integration with table creation and bucket operations.
Modified Files
- .gitignore
- Added
.env
to ignore list to avoid committing environment-specific secrets.
- Added
- supabase/migrations/20250501101621_create_avatars_bucket.sql
- No functional change; only added a trailing newline for consistency.
- supabase/migrations/20250505132643_alter_avatars_bucket.sql
- Wrapped RLS activation in a
DO $$ ... $$
block with exception handling to prevent permission errors when not the owner. - Ensures compatibility with shared environments or when using the Supabase Dashboard-generated SQL.
- Wrapped RLS activation in a
Deleted Files
- .env
- Removed from version control due to security risks and inclusion in
.gitignore
.
- Removed from version control due to security risks and inclusion in
Conclusion
Backend storage policies are now properly aligned with Supabase security best practices, and RLS is correctly configured for bucket operations, ensuring a more secure and stable environment.
2025/05/06 – version: 0.13.03+30
Refactor authentication and person management workflows
This commit introduces a significant refactor of the authentication flow and the person registration form. The login and signup logic has been consolidated within the AccountManagementUseCase
, improving separation of concerns. Additionally, form fields across the app now support change detection, enabling dynamic UI behavior like save button activation only on edits.
Modified Files
- lib/data/repositories/person/remote_person_repository.dart
- Ensured
_started
flag is reset on logout.
- Ensured
- lib/domain/models/person.dart
- Updated the
==
operator to ignorecreatedAt
andupdatedAt
fields.
- Updated the
- lib/domain/use_cases/account_management_user_case.dart
- Added
login()
andsignUp()
methods to centralize authentication logic. - Removed commented legacy
_uploadAvatar
code. - Improved logging of login/signup events.
- Added
- lib/routing/router.dart
- Switched dependency injection from
RemoteAuthRepository
toAccountManagementUseCase
.
- Switched dependency injection from
- lib/ui/core/ui/buttons/big_button.dart
- Made
onPressed
optional. - Adjusted icon color depending on whether the button is enabled.
- Made
- lib/ui/core/ui/drawer/main_drawer.dart
- Added support for
Person
object andmyAccount
callback. - Updated parameters to handle nullability and improve routing logic.
- Added support for
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Displayed
Person.photo
asCircleAvatar
if available. - Prioritized
Person.nickname
as fallback whenuserName
is null.
- Displayed
- lib/ui/core/ui/images/avatar_form_field.dart
- Added
onChanged
callback for real-time updates to image selection.
- Added
- 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.
- Added
- lib/ui/core/ui/text_fields/select_text_field.dart
- Introduced
onChanged
support for tracking selection changes.
- Introduced
- lib/ui/features/home/home_page.dart
- Passed
Person
,onTap
, andmyAccount
toMainDrawer
.
- Passed
- lib/ui/features/home/person_register/person_resister_page.dart
- Converted form into a reactive editing experience.
- Detects changes and only enables the save button on modification.
- Centralized person creation logic via
_createPerson
. - Added initialization logic for edit mode.
- Supports both add and update flows based on context.
- lib/ui/features/sign_in/sign_in_view_model.dart
- Switched from direct repository use to
AccountManagementUseCase
.
- Switched from direct repository use to
- lib/ui/features/sign_up/sign_up_view_model.dart
- Replaced direct call to
AuthRepository
withAccountManagementUseCase
.
- Replaced direct call to
New Files
- lib/utils/extensions/date_time_extensions.dart
- Provides a
toDDMMYYYY()
extension for consistent date formatting.
- Provides a
Conclusion
All changes have been successfully applied, enhancing modularity and improving the user experience with dynamic UI feedback and centralized authentication logic.
2025/05/06 – version: 0.13.02+29
Add splash screen customization for Android and iOS platforms
This update introduces native splash screen support using the flutter_native_splash
package. It includes configuration for Android 12+, legacy Android, and iOS, applying dark/light themes and custom images. Additionally, it improves the avatar selection mechanism in the person registration form and corrects form behavior by ensuring onSaved
is triggered properly.
Modified Files
- Makefile
- Added a
make update_splash
target to generate splash screens usingflutter_native_splash
.
- Added a
- android/app/src/main/res/drawable/launch_background.xml*
- Replaced default white background with a custom background image reference.
- android/app/src/main/res/values/styles.xml
- Updated
AppTheme
to include splash-specific attributes like fullscreen and cutout behavior.
- Updated
- android/app/src/main/res/values-night/styles.xml
- Applied dark mode specific launch theme attributes.
- android/app/src/main/res/values-v31/styles.xml
- Added Android 12 light mode splash screen theme with custom splash icon and color.
- android/app/src/main/res/values-night-v31/styles.xml
- Added Android 12 dark mode splash screen theme.
- flutter_native_splash.yaml
- Created configuration for splash generation across platforms, including Android 12+ settings.
- lib/domain/use_cases/account_management_user_case.dart
- Refactored avatar upload logic into a private
_processPhoto
method used byaddPerson
andupdatePerson
.
- Refactored avatar upload logic into a private
- lib/ui/core/ui/images/avatar_form_field.dart
- Fixed
onSaved
not being triggered by wiringFormField.didChange
correctly.
- Fixed
- lib/ui/core/ui/images/select_avatar_image.dart
- Updated property names to match
FormField
usage; renamedphotoPath
→value
andsetImagePath
→didChange
.
- Updated property names to match
- lib/ui/core/ui/text_fields/basic_text_field.dart
- Added support for the
readOnly
parameter.
- Added support for the
- lib/ui/core/ui/text_fields/select_text_field.dart
- Added
focusNode
support and enforcedreadOnly
mode to ensure proper dropdown-like behavior.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Replaced deprecated
save
command withadd
, and fixed avatar fieldonSaved
logic. - Improved focus behavior between fields after date selection.
- Handled role parsing with fallback in case of invalid label.
- Replaced deprecated
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Renamed command from
save
toadd
for clarity and consistency.
- Renamed command from
- lib/ui/features/sign_in/sign_in_view_model.dart
- Cleaned up import statement formatting.
- lib/utils/commands.dart
- Renamed
completed
getter tosuccess
for clearer semantics.
- Renamed
- lib/utils/validates/generics_validate.dart
- Fixed phone number validation logic to correctly handle 10 and 11-digit formats.
- pubspec.yaml
- Added dependency on
flutter_native_splash
.
- Added dependency on
New Files
- flutter_native_splash.yaml
- Configuration file to define splash behavior and assets for all platforms.
- assets/images/splash_image.png
- Splash image asset used in Android 12+ splash screen.
- android/app/src/main/res/drawable/android12splash.png*
- Auto-generated assets for Android 12 splash icon in various resolutions.
- android/app/src/main/res/drawable/background.png
- Custom background image used for legacy Android splash screen.
- ios/Runner/Assets.xcassets/LaunchBackground.imageset/
- iOS launch screen background image and its metadata.
Assets and Test Data
- assets/images/splash_image.png
- Used for splash image configuration via
flutter_native_splash
.
- Used for splash image configuration via
Conclusion
All changes related to splash screen setup and avatar field integration are now in place and functional across Android and iOS platforms.
2025/05/05 – version: 0.13.01+28
Refactor authentication use case and introduce account management features
This commit introduces a new AccountManagementUseCase
that consolidates responsibilities previously handled by AuthenticationUserCase
, and expands functionality to include avatar upload and update workflows. The update also includes related ViewModel, UI, and dependency injection adjustments to reflect this architectural change and enhance maintainability.
Modified Files
- lib/config/dependencies.dart
- Replaced
AuthenticationUserCase
withAccountManagementUseCase
in provider bindings. - Registered new dependencies for
RemoteStorageRepository
andRemoteStorageService
. - Renamed
ThemeNotifier
toThemeViewModel
.
- Replaced
- lib/data/repositories/auth/remote_auth_repository.dart
- Adjusted import path for
AuthService
using absolute path.
- Adjusted import path for
- lib/data/repositories/person/person_repository.dart
- Added abstract method
logout()
to clear local user data.
- Added abstract method
- lib/data/repositories/person/remote_person_repository.dart
- Implemented the new
logout()
method to remove local person data and clear cached instance.
- Implemented the new
- lib/main_app.dart
- Replaced
ThemeNotifier
withThemeViewModel
in dependency access.
- Replaced
- lib/routing/router.dart
- Updated all usages of
AuthenticationUserCase
toAccountManagementUseCase
. - Replaced
ThemeNotifier
withThemeViewModel
.
- Updated all usages of
- lib/ui/core/ui/drawer/main_drawer.dart
- Conditionally renders account and logout options based on login status.
- Renamed
ThemeNotifier
reference toThemeViewModel
.
- lib/ui/features/app/view_model/theme_notifier.dart → lib/ui/features/app/view_model/theme_view_model.dart
- Renamed class
ThemeNotifier
toThemeViewModel
and updated constructor name.
- Renamed class
- lib/ui/features/home/home_page.dart
- Updated references to
ThemeNotifier
to useThemeViewModel
. - Passed
isLoggedIn
toMainDrawer
.
- Updated references to
- lib/ui/features/home/home_view_model.dart
- Switched dependency from
AuthenticationUserCase
toAccountManagementUseCase
. - Exposed
isLoggedIn
flag from the use case.
- Switched dependency from
- lib/ui/features/home/person_register/person_resister_page.dart
- Replaced usage of
SelectAvatarImage
with the newAvatarFormField
. - Adjusted image validation and form integration.
- Replaced usage of
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Updated dependency type to
AccountManagementUseCase
. - Adjusted getter names for user and person.
- Updated dependency type to
- lib/ui/features/home/widgets/main_app_bar.dart
- Updated to use
ThemeViewModel
instead ofThemeNotifier
.
- Updated to use
New Files
- lib/domain/use_cases/account_management_user_case.dart
- Created new use case to handle authentication, person data, and avatar storage operations in a unified way.
- lib/ui/core/ui/images/avatar_form_field.dart
- New reusable form-integrated widget for avatar image selection and validation.
Deleted Files
- lib/domain/use_cases/authentication_user_case.dart
- Removed obsolete use case in favor of the new consolidated
AccountManagementUseCase
.
- Removed obsolete use case in favor of the new consolidated
Conclusion
All changes have been successfully applied, improving architectural clarity and user account handling capabilities.
2025/05/05 – version: 0.13.00+27
Refactor storage service to use URL-based API and improve test coverage
This commit introduces a comprehensive refactor of the storage system, transitioning the repository and service layers to operate with public URLs rather than raw file paths. It also improves modularity, enhances logging, and expands test coverage with integration and unit tests, including full CRUD validation of the avatar logic.
Modified Files
- lib/data/repositories/address/remote_address_repository.dart
- Updated import from
tables.dart
to renamed fileserver_names.dart
.
- Updated import from
- lib/data/repositories/common/tables.dart → server_names.dart
- Renamed file for clarity.
- Split constants into separate
Tables
andBuckets
classes.
- lib/data/repositories/person/remote_person_repository.dart
- Adjusted import to match renamed file (
server_names.dart
).
- Adjusted import to match renamed file (
- lib/data/repositories/storage/remote_storage_repository.dart
- Replaced internal Supabase client usage with
RemoteStorageService
. - Changed all methods to use URL-based logic instead of raw file paths.
- Added file extension validation and conditional deletion in
update
. - Improved logging and error handling consistency.
- Replaced internal Supabase client usage with
- lib/data/repositories/storage/storage_repository.dart
- Changed all method signatures to accept named parameters.
- Updated documentation to reflect URL-based design.
- Modified
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
anddeleteBucket
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
tosetUp
to isolate test cases. - Replaced legacy import with updated
server_names.dart
.
- Replaced hardcoded keys with values from
- test/data/repositories/storage/remote_storage_repository_test.dart
- Rewrote test to cover the full storage lifecycle: add → fetch → update → delete.
- Introduced temporary file generation using base64 dummy images.
- Used mocked SharedPreferences and Supabase initialization via
.env
.
New Files
- supabase/migrations/20250505132643_alter_avatars_bucket.sql
- Defines Supabase RLS policies for the
avatars
bucket: insert, update, delete, and optional select metadata for authenticated users.
- Defines Supabase RLS policies for the
- test/data/services/remote_storage_service_test.dart
- Unit test for the
RemoteStorageService
, covering add, fetch, update, and delete. - Includes environment setup and Supabase bucket isolation.
- Unit test for the
Conclusion
This update completes the refactor of the storage API to a clean, URL-driven design and significantly enhances reliability and test coverage across the storage module.
2025/05/04 – version: 0.12.05+26
Refactor services and repositories for clarity and separation of concerns
This commit introduces a significant structural refactor aimed at improving the clarity, naming, and separation of responsibilities between local and remote services. It renames LocalStorageService
and RemoteStorageService
to more domain-specific names and splits data responsibilities into separate repositories, especially for file storage operations. It also adds support for managing avatar storage using Supabase buckets.
Modified Files
- lib/config/dependencies.dart
- Renamed
LocalStorageService
toLocalDatabaseService
. - Renamed
RemoteStorageService
toRemoteDatabaseService
. - Updated dependency injection accordingly.
- Renamed
- lib/data/repositories/address/remote_address_repository.dart
- Renamed internal dependency from
LocalStorageService
toLocalDatabaseService
.
- Renamed internal dependency from
- lib/data/repositories/auth/dev_auth_repository.dart
- Renamed field from
userId
touid
in test mock return.
- Renamed field from
- lib/data/repositories/common/tables.dart
- Added
avatars
as a new storage table constant.
- Added
- lib/data/repositories/person/remote_person_repository.dart
- Updated constructor and field names to use new
LocalDatabaseService
andRemoteDatabaseService
.
- Updated constructor and field names to use new
- lib/data/services/auth_service.dart
- Replaced references to
userId
withuid
to standardize user identification fields.
- Replaced references to
- lib/domain/models/person.dart
- Made
nickname
field optional inPerson
model.
- Made
- lib/domain/models/user_auth.dart
- Renamed
userId
touid
inUserAuth
,LoggedUser
, andNotLoggedUser
.
- Renamed
- lib/domain/use_cases/authentication_user_case.dart
- Updated usage of
userAuth.userId
touserAuth.uid
.
- Updated usage of
- lib/ui/features/app/view_model/theme_notifier.dart
- Updated injected dependency to
LocalDatabaseService
.
- Updated injected dependency to
- lib/ui/features/home/person_register/person_resister_page.dart
- Integrated success and error feedback using
AppSnackBar
. - Updated field names for
uid
. - Added
_onSaved
method with feedback and navigation.
- Integrated success and error feedback using
- lib/ui/features/home/person_register/person_resister_view_model.dart
- Adjusted import paths to use relative imports.
- supabase/migrations/20250417191646_create_person_table.sql
- Enforced
birthdate
column asNOT NULL
.
- Enforced
- test/data/repositories/address/remote_address_repository_integration_test.dart
- Refactored mock service to implement
LocalDatabaseService
.
- Refactored mock service to implement
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Switched service from
RemoteStorageService
toRemoteDatabaseService
. - Updated mocks and setup accordingly.
- Switched service from
- test/data/services/shared_preferences_service_test.dart
- Renamed tested service to
LocalDatabaseService
.
- Renamed tested service to
New Files
- lib/data/repositories/storage/remote_storage_repository.dart
- Implements
StorageRepository
interface to handle avatar uploads, downloads, updates, and deletions.
- Implements
- lib/data/repositories/storage/storage_repository.dart
- Defines the contract for remote file storage operations using
Result
types.
- Defines the contract for remote file storage operations using
- lib/data/services/remote_database_service.dart
- New service to manage Supabase table operations (CRUD) via REST API abstraction.
- supabase/migrations/20250501101621_create_avatars_bucket.sql
- Adds SQL migration to create the public
avatars
bucket on Supabase.
- Adds SQL migration to create the public
- test/data/repositories/storage/remote_storage_repository_test.dart
- Adds a unit test scaffold for the
RemoteStorageRepository
, including a helper for creating test avatar files.
- Adds a unit test scaffold for the
Conclusion
The codebase has been successfully refactored to enhance modularity, naming clarity, and separation between local/remote responsibilities. The system is now more aligned with domain-driven conventions and is functionally complete and stable.
2025/04/30 – version: 0.12.04+25
Add avatar image selection, validation, and person form enhancements
This update introduces avatar image selection functionality, field validations, and improved user role selection to enhance the person registration form. Platform-specific permissions and UI improvements were also implemented to support mobile functionality and consistent styling across Android and iOS.
Modified Files
- android/app/src/main/AndroidManifest.xml
- Registered
UCropActivity
for image cropping with a custom theme.
- Registered
- android/app/src/main/res/values/styles.xml
- Added a new style
Ucrop.CropTheme
usingAppCompat.Light.NoActionBar
.
- Added a new style
- ios/Runner/Info.plist
- Declared permissions for camera and photo library access to comply with iOS requirements.
- lib/domain/enums/enums_declarations.dart
- Renamed the label for the
enthusiast
role. - Added
labels
anddescriptions
getters for UI rendering and validation.
- Renamed the label for the
- lib/routing/router.dart
- Fixed parameter naming from
viewModel
topersonRegisterViewModel
.
- Fixed parameter naming from
- 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).
- Switched to
- lib/ui/core/ui/text_fields/date_text_field.dart
- Added
labelText
,hintText
,validator
, andonDatePicked
to increase customization. - Called
onDatePicked
when the date is selected.
- Added
- lib/ui/features/home/person_register/person_resister_page.dart
- Integrated new widgets and validation logic.
- Replaced static avatar display with interactive avatar selector.
- Added
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
withwindowOptOutEdgeToEdgeEnforcement
to enhance compatibility.
- Declares
- lib/ui/core/ui/images/select_avatar_image.dart
- Implements interactive avatar selection using
image_picker
andimage_cropper
. - Provides options for selecting an image from the gallery or camera.
- Implements interactive avatar selection using
- lib/ui/core/ui/text_fields/select_text_field.dart
- Custom widget for selecting values from enums with label-description pairing.
- Includes toggle buttons and contextual descriptions.
- lib/utils/validates/generics_validate.dart
- Centralizes validation logic for common input fields such as name, nickname, phone, birthdate, role, and image path.
Conclusion
The avatar selection flow and person registration form were successfully enhanced, with proper validations and UI support for mobile platforms now in place.
2025/04/30 – version: 0.12.03+24
Refactored Home Flow and Introduced Authentication Use Case
This commit introduces an AuthenticationUserCase
class to centralize user authentication and person management. It also updates the dependency injection configuration, integrates a new person registration page, and enhances the drawer with user details. Various refactorings improve code clarity, encapsulation, and support for new UI behaviors on first access.
Modified Files
- lib/config/dependencies.dart
- Registered new providers for
RemoteStorageService
,PersonRepository
, andAuthenticationUserCase
.
- Registered new providers for
- lib/data/repositories/auth/auth_repository.dart
- Renamed getter
user
touserAuth
to better reflect its purpose.
- Renamed getter
- lib/data/repositories/auth/dev_auth_repository.dart
- Aligned with
userAuth
naming convention.
- Aligned with
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated getter from
user
touserAuth
. - Assigned fetched user in
fetchUser()
for consistency.
- Updated getter from
- lib/data/repositories/person/remote_person_repository.dart
- Simplified the
initialize
method to delegate tofetch
.
- Simplified the
- lib/routing/router.dart
- Injected
AuthenticationUserCase
intoHomeViewModel
. - Added route for
PersonResisterPage
.
- Injected
- lib/routing/routes.dart
- Declared route path for
/person_register
.
- Declared route path for
- lib/ui/core/ui/drawer/main_drawer.dart
- Added support for displaying user name and email in the drawer.
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Updated to dynamically show the authenticated user’s name and email.
- lib/ui/core/ui/images/avatar_image.dart
- Made the
imagePath
parameter optional to support fallback usage.
- Made the
- lib/ui/features/home/home_page.dart
- Replaced
signOut
withlogout
command. - Implemented logic to prompt person registration via a bottom sheet when missing.
- Replaced
- lib/ui/features/home/home_view_model.dart
- Rewritten to use
AuthenticationUserCase
. - Removed direct reference to
AuthRepository
.
- Rewritten to use
- lib/ui/features/home/widgets/custom_app_bar.dart → main_app_bar.dart
- Renamed and refactored to make
themeMode
optional and safer to use.
- Renamed and refactored to make
- test/data/repositories/auth/remote_auth_repository_test.dart
- Adapted test suite to reflect changes in property naming (
userAuth
).
- Adapted test suite to reflect changes in property naming (
New Files
- lib/domain/use_cases/authentication_user_case.dart
- Encapsulates logic for login, logout, load, add and update of
Person
objects.
- Encapsulates logic for login, logout, load, add and update of
- lib/ui/core/ui/editing_controllers/masked_editing_controller.dart
- A
TextEditingController
subclass that formats input using a digit mask.
- A
- lib/ui/core/ui/messages/botton_sheet_message.dart
- Custom reusable bottom sheet message dialog with optional actions.
- lib/ui/core/ui/text_fields/date_text_field.dart
- A
TextField
widget for date picking using native platform dialogs.
- A
- lib/ui/features/home/person_register/person_resister_page.dart
- UI for person registration, including name, nickname, phone, and birthdate inputs.
- lib/ui/features/home/person_register/person_resister_view_model.dart
- ViewModel for the person registration form, managing save and update logic.
Assets and Test Data
- pubspec.yaml & pubspec.lock
- Added new dependencies:
image_picker
,image_cropper
for image selection and cropping.- Updated versions of several existing packages (
go_router
,provider
, etc).
- Added platform-specific plugins (
file_selector_*
,image_picker_*
, etc).
- Added new dependencies:
Conclusion
All changes were successfully applied, enabling a structured authentication workflow, person registration flow, and improved UI behavior. The app is functional and aligned with the new domain-driven structure.
2025/04/28 – version: 0.12.02+23
Refactored enums, created sports structure, and updated models accordingly
This commit introduces a major refactor on enum management, separating sports-related enums into a dedicated file. A new model Sportsman
was added, and existing models and diagrams were updated to align with the new structure. Additional tests were included to validate these changes.
Modified Files
- doc/diagrama de classes.drawio
- Updated class diagram positions and dimensions.
- Renamed “Memberships” to “Sportsman” entity and updated its attributes to match the new
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
DocType
,UserRole
,Sex
, andWeekday
.
- lib/domain/models/athlete.dart
- Added a clarifying comment indicating that
id
corresponds touserId
.
- Added a clarifying comment indicating that
- lib/domain/models/club.dart
- Migrated the
sport
field fromSportType
to the newSports
enum. - Adjusted imports to reference the new
enums_sports.dart
.
- Migrated the
- lib/domain/models/document.dart
- Removed old local definition of
DocType
(now centralized inenums_declarations.dart
).
- Removed old local definition of
- lib/domain/models/manager.dart
- Added a clarifying comment indicating that
id
corresponds touserId
.
- Added a clarifying comment indicating that
- lib/domain/models/person.dart
- Added a clarifying comment indicating that
id
corresponds touserId
.
- Added a clarifying comment indicating that
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Updated the default user role in test data from
admin
tomanager
.
- Updated the default user role in test data from
- test/domain/models/club_test.dart
- Adjusted test imports and values to use the new
Sports
enum instead ofSportType
.
- Adjusted test imports and values to use the new
New Files
- lib/domain/enums/enums_sports.dart
- Created a new file dedicated to sports-related enums.
- Added a
Position
abstraction with abyLabel
factory constructor. - Introduced the
Sports
,AffiliationStatus
,SoccerPosition
,BasketballPosition
,VolleyballPosition
, andHandballPosition
enums.
- lib/domain/models/sportman.dart
- Added the new
Sportsman
model to represent an athlete’s affiliation to a club, validating sport-position consistency.
- Added the new
- test/domain/enums/enums_sports_test.dart
- Added unit tests for
Position.byLabel
to ensure correct mapping between labels and sports.
- Added unit tests for
- test/utils/validates/docs_validate_test.dart
- Added comprehensive tests for CPF, CNPJ, CNH, and RG validation methods.
Conclusion
All changes were successfully implemented to improve enum management, create a clearer domain structure for sports entities, and strengthen test coverage. The system remains fully functional and consistent with the updated design.
2025/04/24 – version: 0.12.01+22
Refactored Auth Architecture and Repository Enhancements
This commit introduces a refactor in the authentication architecture, removes unnecessary inheritance from ChangeNotifier
, and improves repository consistency and event propagation. The changes promote clearer separation of concerns and simplify reactivity by using streams instead of Flutter’s widget bindings.
Modified Files
- doc/diagrama de classes.drawio
- Updated diagram dimensions and layout metadata, likely due to UI adjustments in draw.io.
- lib/data/repositories/auth/auth_repository.dart
- Removed
ChangeNotifier
inheritance fromAuthRepository
to decouple UI reactivity. - Removed
authService
getter to enforce access through composition rather than inheritance.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Removed
override
andauthService
property, aligning with updatedAuthRepository
abstraction.
- Removed
- lib/data/repositories/auth/remote_auth_repository.dart
- Now extends
ChangeNotifier
and implementsAuthRepository
directly to handle event changes and notify listeners. - Added internal
AuthEvent
state and listener onAuthService
events. - Implemented
dispose
method to cancel subscriptions and avoid memory leaks.
- Now extends
- lib/data/repositories/person/remote_person_repository.dart
- Fixed typo in constructor parameter from
reoteService
toremoteService
. - Updated
_person
cache after remote update to maintain consistency.
- Fixed typo in constructor parameter from
- lib/data/services/auth_service.dart
- Removed
ChangeNotifier
inheritance, shifting to a stream-based reactivity model. - Introduced a
StreamController
to emitAuthEvent
s to interested subscribers. - Updated
_onAuthStateChange
to dispatch events viaStreamController
instead of usingnotifyListeners()
. - Improved resource cleanup in the new asynchronous
dispose()
method.
- Removed
- lib/ui/features/home/home_view_model.dart
- Removed the
authService
getter, relying solely on theevent
property from the repository interface.
- Removed the
- 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.
- Added
Conclusion
The authentication layer is now cleaner, more modular, and aligned with modern reactive patterns. All changes are complete and the application remains stable and functional.
2025/04/24 – version: 0.12.00+21
Refactored Auth Architecture and Repository Enhancements
This commit introduces a refactor in the authentication architecture, removes unnecessary inheritance from ChangeNotifier
, and improves repository consistency and event propagation. The changes promote clearer separation of concerns and simplify reactivity by using streams instead of Flutter’s widget bindings.
Modified Files
- doc/diagrama de classes.drawio
- Updated diagram dimensions and layout metadata, likely due to UI adjustments in draw.io.
- lib/data/repositories/auth/auth_repository.dart
- Removed
ChangeNotifier
inheritance fromAuthRepository
to decouple UI reactivity. - Removed
authService
getter to enforce access through composition rather than inheritance.
- Removed
- lib/data/repositories/auth/dev_auth_repository.dart
- Removed
override
andauthService
property, aligning with updatedAuthRepository
abstraction.
- Removed
- lib/data/repositories/auth/remote_auth_repository.dart
- Now extends
ChangeNotifier
and implementsAuthRepository
directly to handle event changes and notify listeners. - Added internal
AuthEvent
state and listener onAuthService
events. - Implemented
dispose
method to cancel subscriptions and avoid memory leaks.
- Now extends
- lib/data/repositories/person/remote_person_repository.dart
- Fixed typo in constructor parameter from
reoteService
toremoteService
. - Updated
_person
cache after remote update to maintain consistency.
- Fixed typo in constructor parameter from
- lib/data/services/auth_service.dart
- Removed
ChangeNotifier
inheritance, shifting to a stream-based reactivity model. - Introduced a
StreamController
to emitAuthEvent
s to interested subscribers. - Updated
_onAuthStateChange
to dispatch events viaStreamController
instead of usingnotifyListeners()
. - Improved resource cleanup in the new asynchronous
dispose()
method.
- Removed
- lib/ui/features/home/home_view_model.dart
- Removed the
authService
getter, relying solely on theevent
property from the repository interface.
- Removed the
- 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.
- Added
Conclusion
The authentication layer is now cleaner, more modular, and aligned with modern reactive patterns. All changes are complete and the application remains stable and functional.
2025/04/23 – version: 0.11.05+20
Refactor RemotePersonRepository to use centralized RemoteService
This commit refactors the RemotePersonRepository
to delegate all remote operations to a newly created RemoteService
class. This abstraction improves code reuse, testability, and maintainability by encapsulating Supabase-specific logic outside the repository. The update also renames internal variables for clarity and consistency.
Modified Files
- lib/data/repositories/person/remote_person_repository.dart
- Replaced direct usage of
SupabaseClient
with the newRemoteService
abstraction. - Refactored
_fetchFromSupabase
into_fetchFromRemote
usingRemoteService.fetch
. - Updated
add
,update
, anddelete
methods to delegate operations toRemoteService
. - Renamed internal fields to
_remoteService
and_localService
for consistency.
- Replaced direct usage of
New Files
- lib/data/services/remote_service.dart
- Introduced
RemoteService
, a general-purpose service for interacting with Supabase. - Provides methods:
fetch
,fetchList
,add
,update
, anddelete
. - Includes centralized error handling and logging using
Logger
. - Enhances testability by separating concerns between data access and business logic.
- Introduced
Conclusion
The integration of RemoteService
streamlines remote operations and prepares the codebase for easier scalability and testing. All functionalities are preserved and operational.
2025/04/23 – version: 0.11.04+19
Add custom main drawer with header and avatar support
This commit introduces a new custom navigation drawer (MainDrawer
) with support for user display and logout functionality. It enhances the user interface by adding a stylized drawer header and an avatar image widget capable of displaying local or network images. Additionally, new dependencies were added to support these functionalities.
Modified Files
- lib/ui/core/ui/drawer/main_drawer.dart
- Implemented the main drawer UI with rounded borders and dynamic background color based on theme.
- Injected
ThemeNotifier
and logout callback. - Included a
MainDrawerHeader
and a logoutListTile
.
- lib/ui/features/home/home_page.dart
- Added
MainDrawer
to theScaffold
usingdrawer:
property.
- Added
- pubspec.yaml
- Added
cached_network_image
as a dependency.
- Added
- pubspec.lock
- Added dependency entries for
cached_network_image
and its transitive dependencies. - Includes additional packages like
flutter_cache_manager
,octo_image
, andsqflite
, likely required bycached_network_image
.
- Added dependency entries for
New Files
- lib/ui/core/ui/drawer/widgets/main_drawer_header.dart
- Custom drawer header widget displaying a placeholder user name and email.
- Uses theme styling and adapts color based on brightness mode.
- lib/ui/core/ui/images/avatar_image.dart
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.
- Replaced hardcoded Supabase CLI version with
- analysis_options.yaml
- Enabled
prefer_const_constructors
andprefer_const_literals_to_create_immutables
for better performance and consistency.
- Enabled
- lib/config/dependencies.dart
- Replaced synchronous
dependencies
list with asynchronouscreateDependencies()
function. - Registered
ThemeNotifier
andLocalStorageService
in the provider tree.
- Replaced synchronous
- lib/data/repositories/*
- Updated references from
SharedPreferencesService
toLocalStorageService
. - Renamed parameters and fields accordingly across multiple repository classes.
- Introduced
const
usage for Result wrappers and UUID constructor.
- Updated references from
- lib/data/services/auth_service.dart
- Standardized usage of
const Result.success(null)
.
- Standardized usage of
- lib/data/services/shared_preferences_service.dart → lib/data/services/local_storage_service.dart
- Renamed class and file to better reflect general-purpose local storage functionality.
- Updated result returns to
const
.
- lib/main.dart
- Added logger initialization.
- Awaited dependency injection setup with
createDependencies()
.
- lib/main_app.dart
- Integrated
ThemeNotifier
withListenableBuilder
to dynamically switch between light and dark themes.
- Integrated
- lib/routing/router.dart
- Passed
ThemeNotifier
toHomePage
.
- Passed
- lib/ui/core/theme/fonts.dart
- Made all
TextStyle
declarationsconst
.
- Made all
- lib/ui/core/ui/buttons/
- Applied
const
constructors where applicable.
- Applied
- lib/ui/core/ui/messages/app_snack_bar.dart
- Made the
Divider
constant.
- Made the
- lib/ui/features/home/home_page.dart
- Replaced
AppBar
with a reusableCustomAppBar
widget. - Included
ThemeNotifier
in the constructor.
- Replaced
- lib/ui/features/sign_in/sign_in_page.dart
- Added
const
toAppBar
andIcon
.
- Added
- lib/ui/features/sign_up/sign_up_page.dart
- Updated
AppBar
title to useconst
.
- Updated
- test/data/repositories/*
- Updated test implementations to use
LocalStorageService
in place ofSharedPreferencesService
.
- Updated test implementations to use
- test/domain/models/club_test.dart & schedule_test.dart
- Made
TimeOfDay
constructorsconst
.
- Made
New Files
- lib/ui/features/app/view_model/theme_notifier.dart
- Implements a
ChangeNotifier
that manages the theme state using a key-value storage.
- Implements a
- lib/ui/core/ui/drawer/main_drawer.dart
- Added base structure for the app’s navigation drawer.
- lib/ui/features/home/widgets/custom_app_bar.dart
- Custom
AppBar
with dynamic icon for theme toggling usingThemeNotifier
.
- Custom
Conclusion
All changes have been successfully implemented to improve theming, dependency management, and CLI maintainability. The application remains functional and now supports dynamic light/dark mode switching.
2025/04/16 – version: 0.11.02+17
Enhance Address Repository with Remote Fetch and Full CRUD Test Coverage
This update refines the RemoteAddressRepository
by introducing a forceRemote
flag to both initialize
and fetch
methods, allowing explicit bypassing of local cache when needed. Additionally, the integration tests were expanded to cover the entire CRUD flow (add, fetch, update, delete) and provide greater reliability in real-world usage scenarios.
Modified Files
lib/data/repositories/address/remote_address_repository.dart
- Wrapped
addressesList
inUnmodifiableListView
to enforce immutability. - Enhanced
initialize
to optionally force remote fetch even if local data is available. - Enhanced
fetch
to support theforceRemote
flag. - Improved internal logic for more consistent and flexible address data retrieval.
- Wrapped
lib/data/services/shared_preferences_service.dart
- Documented the
getKeys
method to clarify its purpose and expected usage.
- Documented the
lib/domain/models/address.dart
- Corrected field mapping in
fromMap
fromperson_id
touser_id
to match the actual database schema.
- Corrected field mapping in
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 addressfetch
from cachefetch
from Supabase withforceRemote
update
address and verify persisted valuesdelete
and verify deletion
- Added placeholder for future test on
initialize()
logic.
- Updated
test/data/repositories/person/remote_person_repository_integration_test.dart
- Aligned test
userId
with new sample data used across tests for consistency.
- Aligned test
Conclusion
The RemoteAddressRepository
is now more flexible and testable, with robust support for cache bypass and improved test coverage across all operations. These enhancements help ensure consistent behavior in both development and production environments.
2025/04/16 – version: 0.11.01+16
Update UML Diagram and Add Address Repository with Supabase Integration
This commit introduces a complete implementation for managing address data via Supabase, including a new repository layer, model serialization support, integration tests, and a corresponding UML diagram update. It also improves the Person repository with cache initialization and adds utility support for key-prefixed queries in the shared preferences service.
Modified Files
doc/diagrama de classes.drawio
- Updated method names from
get
tofetch
for consistency across all repositories. - Added a new class diagram for
RemotePersonRepository
and theAddress
model.
- Updated method names from
lib/data/repositories/common/tables.dart
- Added the
address
table constant.
- Added the
lib/data/repositories/person/person_repository.dart
- Added documentation for all CRUD operations and introduced the new
initialize
method.
- Added documentation for all CRUD operations and introduced the new
lib/data/repositories/person/remote_person_repository.dart
- Added initialization logic via
initialize
. - Implemented local cache fallback with
_fetchFromLocal
and_fetchFromSupabase
. - Added and documented
_cachePerson
helper for shared preferences. - Improved error handling and internal state consistency using
_started
flag.
- Added initialization logic via
lib/data/services/shared_preferences_service.dart
- Introduced
getKeys(String prefix)
to retrieve all keys under a namespace.
- Introduced
lib/domain/models/address.dart
- Replaced
personId
withuserId
to align with Supabase schema. - Updated field names to snake_case to match Supabase column names.
- Added
toJsonString()
andfromJsonString()
methods for local caching.
- Replaced
pubspec.lock
&pubspec.yaml
- Added the
uuid
package to support ID generation for addresses. - Included new transitive dependencies
fixnum
andsprintf
.
- Added the
supabase/migrations/20250416131951_create_person_table.sql
→20250417191646_create_person_table.sql
- Renamed and updated
person
table migration to explicitly referenceauth.users(id)
.
- Renamed and updated
New Files
lib/data/repositories/address/address_repository.dart
- Declares the
AddressRepository
abstract class with methods for initialize, fetch, add, update, and delete.
- Declares the
lib/data/repositories/address/remote_address_repository.dart
- Implements
RemoteAddressRepository
using Supabase and SharedPreferences. - Provides full address lifecycle management with local cache fallback.
- Implements
supabase/migrations/20250417191633_create_address_table.sql
- Creates the
address
table with RLS and policies to restrict access byauth.uid()
.
- Creates the
test/data/repositories/address/remote_address_repository_integration_test.dart
- Provides integration tests for the
RemoteAddressRepository
. - Verifies add and fetch logic, including cache fallback and Supabase consistency.
- Provides integration tests for the
Conclusion
Address management has been successfully integrated with Supabase, including full repository functionality, schema migration, and robust testing. The diagram and infrastructure have been updated accordingly.
2025/04/16 – version: 0.11.00+15
Replace abstract repository imports with unified auth/person repository paths
This commit updates all references from the previously named abstract_auth_repository.dart
and abstract_person_repository.dart
to their new unified names: auth_repository.dart
and person_repository.dart
. This change ensures consistency across the project and reflects the updated repository file structure.
Modified Files
- lib/data/repositories/auth/dev_auth_repository.dart
- Updated import to use
auth_repository.dart
.
- Updated import to use
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated import path from abstract to unified auth repository.
- lib/data/repositories/person/remote_person_repository.dart
- Replaced import of
abstract_person_repository.dart
withperson_repository.dart
.
- Replaced import of
- lib/ui/features/home/home_view_model.dart
- Updated import path to use
auth_repository.dart
.
- Updated import path to use
- lib/ui/features/sign_in/sign_in_view_model.dart
- Updated dependency from
abstract_auth_repository.dart
toauth_repository.dart
.
- Updated dependency from
- lib/ui/features/sign_up/sign_up_view_model.dart
- Same import change for the authentication repository.
- lib/ui/features/splash/splash_view_model.dart
- Aligned import with new file name for the authentication repository.
Conclusion
All repository references have been successfully updated to reflect the new file names, improving naming clarity and alignment across the project layers.
2025/04/16 – version: 0.11.00+14
Rename abstract repositories and add unit tests for Club and Schedule
This update performs the renaming of abstract repository files to standard names and adds comprehensive unit tests for the Club
and Schedule
models. These changes improve the consistency of the repository structure and increase test coverage for key domain models.
Modified Files
- lib/data/repositories/auth/abstract_auth_repository.dart → auth_repository.dart
- Renamed the file to follow a cleaner and more conventional naming pattern.
- lib/data/repositories/person/abstract_person_repository.dart → person_repository.dart
- Renamed for consistency with other repository file names.
New Files
- test/domain/models/club_test.dart
- Added unit tests for the
Club
class:- Verifies correct field mapping in
toMap
. - Ensures accurate reconstruction via
fromMap
. - Validates JSON round-trip behavior with
toJson
andfromJson
.
- Verifies correct field mapping in
- Added unit tests for the
- test/domain/models/schedule_test.dart
- Introduced tests for both
OperatingDay
andSchedule
:- Confirms correct map serialization and deserialization.
- Ensures JSON round-trip reliability for
OperatingDay
. - Tests selective inclusion of non-null days in
Schedule
.
- Introduced tests for both
Conclusion
This commit improves naming clarity for repository interfaces and strengthens model reliability through precise unit tests for schedule and club data structures.
2025/04/16 – version: 0.10.03+13
Add new Club model and refactor Athlete and Manager data structure
This commit introduces several structural enhancements to the data model layer, particularly the replacement of raw document fields with a new Document
class. A new Club
entity was also introduced to represent the organization of sports activities. Additionally, utilities for document validation and string formatting were created to support cleaner validation logic.
Modified Files
- .gitignore
- Added
/coverage/
to the ignore list.
- Added
- Makefile
- Prevented
push
andpush_branch
onmain
ormaster
branches. - Updated
test_coverage
to run with--concurrency=1
. - Added
test_serial
task aliasingtest_coverage
.
- Prevented
- lib/domain/enums/enums_declarations.dart
- Replaced
SportType.rugby
withSportType.handball
.
- Replaced
- lib/domain/models/athlete.dart
- Replaced
personId
,document
, andsports
with a unifiedcpfDoc
field using the newDocument
class. - Updated serialization methods to use snake_case and ISO strings.
- Added
toJson()
, equality operator, andhashCode
.
- Replaced
- lib/domain/models/manager.dart
- Replaced multiple document fields with
cpfDoc
andsecondDoc
. - Refactored serialization to align with new structure and snake_case keys.
- Implemented
toJson()
, equality operator, andhashCode
.
- Replaced multiple document fields with
- lib/domain/models/operating_day.dart
- Changed time representation from seconds to “HH:mm” strings.
- Added JSON serialization and deserialization methods.
- lib/domain/models/person.dart
- Updated import to a relative path.
- lib/domain/models/schedule.dart
- Renamed
toJson()
andfromJson()
totoJsonString()
andfromJsonString()
for consistency.
- Renamed
- lib/ui/features/sign_in/sign_in_page.dart
- Updated validation import path from
utils/validate.dart
toutils/validates/sign_validate.dart
.
- Updated validation import path from
- lib/ui/features/sign_up/sign_up_page.dart
- Same import path adjustment as above.
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Added full test cycle:
add()
,update()
,fetch()
(from cache and remote), anddelete()
with verification.
- Added full test cycle:
New Files
- lib/domain/models/club.dart
- Created the
Club
class with properties such as manager, sport type, address, location, schedule, and monthly fee. - Includes full serialization, equality, and copy support.
- Created the
- lib/domain/models/document.dart
- Introduced
Document
class with enumDocType
for CPF, RG, CNPJ, and CNH. - Supports validation, serialization, and equality.
- Introduced
- lib/domain/models/location.dart
- Represents geographic location with latitude and longitude.
- Includes JSON serialization and equality comparison.
- lib/utils/extensions/string_extensions.dart
- Added extension to extract only numeric digits from a string.
- lib/utils/validates/docs_validate.dart
- Contains static validation methods for CPF, CNPJ, CNH, and RG with detailed logic.
- lib/utils/validates/sign_validate.dart (renamed from
utils/validate.dart
)- Retained existing email validation logic with updated class declaration.
Conclusion
The system now features improved data consistency and validation logic, laying solid groundwork for upcoming domain features.
2025/04/16 – version: 0.10.02+12
Add Person Caching and Test Infrastructure with Refined Supabase Integration
This commit introduces local caching to the RemotePersonRepository
using a shared preferences wrapper, enhancing offline resilience and reducing unnecessary network calls. Additionally, it includes extensive unit and integration tests for both the repository and shared preferences service. Minor structural and naming improvements were also applied across services and models.
Modified Files
- Makefile
- Added a
supabase_cli_restart
command for quick CLI server restarts.
- Added a
- lib/data/repositories/person/abstract_person_repository.dart
- Renamed method
get()
tofetch()
for consistency with repository terminology.
- Renamed method
- lib/data/repositories/person/remote_person_repository.dart
- Implemented caching logic via
SharedPreferencesService
. - Rewrote
fetch
,add
,update
, anddelete
to incorporate local cache handling. - Added logging and improved error traceability.
- Created private method
_cachePerson()
.
- Implemented caching logic via
- lib/data/services/auth_service.dart
- Renamed internal variable
_supabase
to_supabaseClient
for clarity. - Updated all usage accordingly.
- Renamed internal variable
- lib/data/services/shared_preferences_service.dart
- Redesigned with
setString
,getString
, andremove
methods using consistentResult
wrappers. - Enhanced logging and error handling.
- Redesigned with
- lib/domain/models/operatingDay → operating_day.dart
- Renamed file to match snake_case naming convention.
- lib/domain/models/person.dart
- Adjusted date serialization to use ISO 8601 format (UTC) instead of milliseconds.
- Renamed
toJson()
/fromJson()
totoJsonString()
/fromJsonString()
for consistency.
- lib/domain/models/schedule.dart
- Updated import to match renamed
operating_day.dart
.
- Updated import to match renamed
- pubspec.yaml
- Bumped version to
0.10.02+12
. - Added
mocktail
andtest
dependencies for unit testing.
- Bumped version to
- supabase/migrations/20250416131951_create_person_table.sql
- Fixed column names:
createdAt
→created_at
,updatedAt
→updated_at
to match Dart model changes.
- Fixed column names:
New Files
- test/data/repositories/person/remote_person_repository_integration_test.dart
- Integration test for
RemotePersonRepository
:- Validates
add()
+fetch()
from cache and remote. - Cleans up test data before/after tests.
- Validates
- Integration test for
- test/data/services/shared_preferences_service_test.dart
- Unit tests for
SharedPreferencesService
:- Validates
setString
,getString
,remove
. - Tests retrieval of non-existent keys.
- Validates
- Unit tests for
Conclusion
This update strengthens the app’s architecture by introducing local caching, improving repository reliability, and enforcing test coverage. The system is now more resilient to connectivity issues and better structured for future expansion.
2025/04/16 – version: 0.10.01+11
Add Person Management Infrastructure and Refactor Git/CLI Configs
This commit introduces the foundational structure for managing user profiles through the new Person
entity. It includes model definitions, repository interfaces, Supabase integration, and access control via row-level security. In addition, project tooling and configuration files such as .gitignore
, README.md
, and Makefile
have been updated for improved workflow and documentation.
Modified Files
- .gitignore
- Added
.secrets
and backup files for.drawio
to avoid committing sensitive and temporary data.
- Added
- Makefile
- Pinned
supabase
CLI commands to version2.20.12
to ensure consistency across environments.
- Pinned
- README.md
- Replaced placeholder text with a detailed structure of the Firebase Firestore collections used in the project.
- doc/diagrama de classes.drawio
- Diagram content updated, likely to reflect recent class/model changes.
- lib/domain/enums/enums_declarations.dart
- Refined descriptions of user roles.
- Deprecated the
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 (
phone
,role
) - Serialization methods (
toMap
,fromMap
,toJson
,fromJson
) copyWith
,toString
, equality and hash overrides for robust model handling.
- Additional fields (
- Fully implemented the
New Files
- lib/data/repositories/common/tables.dart
- Centralized table name definitions; currently includes
'person'
.
- Centralized table name definitions; currently includes
- lib/data/repositories/person/abstract_person_repository.dart
- Interface definition for the
PersonRepository
.
- Interface definition for the
- lib/data/repositories/person/remote_person_repository.dart
- Concrete implementation of
PersonRepository
using Supabase client for CRUD operations. - Includes logging and error handling.
- Concrete implementation of
- supabase/migrations/20250416131951_create_person_table.sql
- Supabase SQL migration to:
- Create the
person
table with appropriate fields and constraints. - Enable row-level security.
- Define RLS policies for read, insert, and update access tied to authenticated users.
- Create the
- Supabase SQL migration to:
Conclusion
This update establishes the groundwork for managing user profile data securely and reliably via Supabase, while also improving tooling and documentation. All changes integrate cleanly with the existing codebase.
2025/04/16 – version: 0.10.00+10
Refactor AuthService and Introduce Operating Schedule Models
This commit includes refactoring of the authentication service to improve clarity and consistency, alongside the introduction of new domain models to manage business operating hours. Additionally, it unifies naming conventions across the codebase (id
→ userId
) and adjusts related test cases accordingly.
Modified Files
- lib/data/repositories/auth/abstract_auth_repository.dart
- Changed import from package to relative path.
- lib/data/repositories/auth/dev_auth_repository.dart
- Replaced
id
withuserId
to matchUserAuth
class refactor.
- Replaced
- lib/data/repositories/auth/remote_auth_repository.dart
- Updated method call from
signInWithPassword()
tosignIn()
to match new method naming.
- Updated method call from
- lib/data/services/auth_service.dart
- Renamed
start()
toinitialize()
for clearer intent. - Renamed method
signInWithPassword()
tosignIn()
. - Updated
LoggedUser
instantiation to useuserId
instead ofid
.
- Renamed
- lib/domain/models/user_auth.dart
- Replaced
id
field withuserId
to clarify user identifier semantics. - Updated constructors, copyWith methods, and toString accordingly for
LoggedUser
andNotLoggedUser
.
- Replaced
- lib/main.dart
- Adjusted call from
AuthService.start()
toAuthService.initialize()
.
- Adjusted call from
- lib/ui/features/home/home_page.dart, home_view_model.dart, sign_in_page.dart
- Minor formatting and removal of commented-out code.
- lib/utils/commands.dart
- Commented out
notifyListeners()
inclearResult()
method.
- Commented out
- test/data/repositories/auth/remote_auth_repository_test.dart
- Updated test call from
start()
toinitialize()
to reflect method rename.
- Updated test call from
- test/data/services/supabase_auth_service_test.dart
- Updated usage of
signInWithPassword()
tosignIn()
. - Renamed
AuthService.start()
toinitialize()
.
- Updated usage of
New Files
- lib/domain/models/operatingDay
- Defines the
OperatingDay
class representing a single day’s open and close time usingTimeOfDay
. - Includes extension and utility functions to convert to/from seconds.
- Defines the
- lib/domain/models/schedule.dart
- Introduces the
Schedule
class to manage weekly business hours via optionalOperatingDay
fields for each weekday. - Includes methods for serialization, deserialization, and deep copy.
- Introduces the
Conclusion
Authentication logic is now clearer and more consistent, while the addition of OperatingDay
and Schedule
models lays the groundwork for advanced scheduling features. All changes are stable and the codebase remains functional.
2025/04/04 – version: 0.01.00+09
Refactored authentication service and improved error handling for login and sign-up flows.
Changes made:
- lib/config/dependencies.dart:
- Replaced
SupabaseAuthService
with the renamedAuthService
. - Updated provider registration to reflect the new service name.
- Replaced
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Added
authService
andevent
getters to the abstract repository to expose authentication state and service.
- Added
- lib/data/repositories/auth/dev_auth_repository.dart:
- Injected
AuthService
into theDevAuthRepository
and implemented the new required getters.
- Injected
- lib/data/repositories/auth/remote_auth_repository.dart:
- Updated to use
AuthService
instead ofSupabaseAuthService
. - Removed internal
fetchUser
call from constructor. - Added support for
authService
andevent
properties.
- Updated to use
- lib/data/services/supabase_auth_service.dart → lib/data/services/auth_service.dart:
- Renamed file and class from
SupabaseAuthService
toAuthService
. - Refactored event logging for better clarity.
- Improved session handling by printing ‘opened’ or ‘closed’ instead of raw session.
- Renamed file and class from
- lib/main.dart:
- Updated import and initialization call from
SupabaseAuthService
toAuthService
.
- Updated import and initialization call from
- lib/ui/core/theme/dimens.dart:
- Added
paddingScreenAll
to encapsulate consistent edge spacing. - Applied new spacing in mobile and desktop implementations.
- Added
- lib/ui/core/ui/messages/app_snack_bar.dart:
- Removed unnecessary comments and added return type for clarity.
- Minor cleanup for better structure and readability.
- lib/ui/features/home/home_page.dart:
- Added disposal of listener in
dispose()
to avoid memory leaks.
- Added disposal of listener in
- lib/ui/features/home/home_view_model.dart:
- Exposed
authService
andevent
via the view model for external access.
- Exposed
- 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.
- Applied
- lib/ui/features/sign_up/sign_up_page.dart:
- Replaced raw
SnackBar
withAppSnackBar
for better consistency. - Enhanced error handling with contextual messages.
- Adjusted
onEditingComplete
and validation flow for improved UX.
- Replaced raw
- pubspec.yaml:
- Updated version from
0.0.1+08
to0.01.00+09
.
- Updated version from
- test/data/repositories/auth/remote_auth_repository_test.dart:
- Replaced
SupabaseAuthService
withAuthService
in test setup and logic.
- Replaced
- test/data/services/supabase_auth_service_test.dart:
- Renamed imports and instantiations to use
AuthService
throughout the integration tests.
- Renamed imports and instantiations to use
Conclusion:
This refactor centralizes authentication logic under the new AuthService
class, ensuring cleaner abstraction and naming consistency. It also enhances the user experience with improved error feedback and layout adjustments, and updates the test suite accordingly.
2025/04/04 – version: 0.0.01+08
Added new features and refactored existing components to improve authentication, routing, and UI feedback mechanisms.
Changes made:
- assets/images/sports_logo.png:
- Added new image asset for the sports logo.
- assets/images/sports_splash.png:
- Added new image asset for the splash screen.
- lib/config/dependencies.dart:
- Created a new dependency injection file using
Provider
forSupabaseAuthService
andRemoteAuthRepository
.
- Created a new dependency injection file using
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Added a new abstract method
fetchUser
to retrieve the authenticated user.
- Added a new abstract method
- lib/data/repositories/auth/dev_auth_repository.dart:
- Implemented the new
fetchUser
method returning a mockedLoggedUser
.
- Implemented the new
- lib/data/repositories/auth/remote_auth_repository.dart:
- Implemented
fetchUser
using theSupabaseAuthService
.
- Implemented
- lib/data/services/supabase_auth_service.dart:
- Renamed logger label to
SupabaseAuthService
. - Added logging to all cases of authentication state change.
- Removed artificial delays in sign-up, sign-in, sign-out, and user update methods.
- Improved error messages in
fetchUser
. - Changed return type of
fetchUser
toResult<LoggedUser>
. - Added validation for initialized session in
fetchUser
.
- Renamed logger label to
- lib/main.dart:
- Wrapped
MainApp
in aMultiProvider
using the newdependencies
list.
- Wrapped
- lib/main_app.dart:
- Changed app theme from
light
todark
.
- Changed app theme from
- lib/routing/router.dart:
- Replaced manual repository instantiations with
context.read()
usingProvider
. - Updated initial route to the splash screen.
- Injected
SplashViewModel
with dependency.
- Replaced manual repository instantiations with
- lib/ui/core/theme/dimens.dart:
- Added
radius
getter to unify border radius access. - Refactored
borderRadius
getters in both mobile and desktop classes to useradius
.
- Added
- lib/ui/core/ui/buttons/big_button.dart:
- Removed hardcoded icon dependency.
- Simplified icon rendering using the widget’s
iconData
.
- lib/ui/core/ui/messages/app_snack_bar.dart:
- Introduced a reusable
AppSnackBar
utility for showing stylized SnackBars.
- Introduced a reusable
- lib/ui/features/home/home_page.dart:
- Replaced dummy sign-out logic with actual sign-out result handling using
AppSnackBar
for error feedback.
- Replaced dummy sign-out logic with actual sign-out result handling using
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored
_onLogin
to useresult.fold()
for better control and feedback handling.
- Refactored
- lib/ui/features/sign_up/sign_up_page.dart:
- Renamed
passwordFocusNode
andconfirmPasswordFocusNode
to_passwordFocusNode
and_confirmPasswordFocusNode
for encapsulation. - Adjusted focus handling logic accordingly.
- Extended SnackBar display duration on successful sign-up.
- Renamed
- lib/ui/features/splash/splash_page.dart:
- Converted
SplashPage
fromStatelessWidget
toStatefulWidget
. - Added logic to fetch user on init and navigate accordingly to home or sign-in.
- Improved visual design with logo and themed text.
- Converted
- lib/ui/features/splash/splash_view_model.dart:
- Refactored
SplashViewModel
to include a command-basedfetchUser
method. - Added logging for success and error cases in
fetchUser
.
- Refactored
- pubspec.yaml:
- Added
provider
as a dependency. - Declared
assets/images/
in the Flutter assets section.
- Added
Conclusion:
This commit introduces foundational improvements to the app’s architecture, emphasizing better dependency injection, clearer user session handling, and enhanced UI feedback. It also sets up a splash screen with logic to redirect based on authentication state, improving overall UX.
2025/04/03 – version: 0.0.01+07
This commit introduces logout support, improves authentication UX feedback, refactors shared button behavior, and enhances form validation consistency across the sign-in and sign-up flows.
Changes made:
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Refactored import statements to use relative paths for consistency.
- lib/data/repositories/auth/dev_auth_repository.dart:
- Updated import statements to relative paths.
- lib/data/services/supabase_auth_service.dart:
- Added artificial delays (
Future.delayed
) insignUp
,signInWithPassword
,signOut
,updatePassword
, andupdateUserPhone
methods to simulate realistic request latency.
- Added artificial delays (
- lib/routing/router.dart:
- Injected
HomeViewModel
into theHomePage
usingRemoteAuthRepository
andSupabaseAuthService
.
- Injected
- lib/ui/core/ui/buttons/big_button.dart:
- Converted
BigButton
fromStatelessWidget
toStatefulWidget
. - Replaced the optional
icon
parameter withiconData
andisRunning
. - Added a dynamic internal icon that switches between loading indicator and an icon based on
isRunning
.
- Converted
- lib/ui/features/home/home_page.dart:
- Injected
HomeViewModel
through constructor. - Added logout logic using
signOut
command. - Connected the logout button to execute
signOut
.
- Injected
- lib/ui/features/home/home_view_model.dart:
- Created
HomeViewModel
class. - Implemented
signOut
command with logging on success and failure.
- Created
- lib/ui/features/sign_in/sign_in_page.dart:
- Added form key to enable validation.
- Updated
BigButton
to use the newiconData
andisRunning
parameters viaListenableBuilder
. - Wrapped
_signIn
logic with validation and running checks to avoid multiple submissions.
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Marked
signIn
asfinal
and ensured immutability.
- Marked
- lib/ui/features/sign_up/sign_up_page.dart:
- Updated validation to use
SignValidate
. - Replaced direct icon widget in
BigButton
withiconData
andisRunning
, usingListenableBuilder
. - Wrapped
_signUp
method with validation and running checks.
- Updated validation to use
- lib/ui/features/sign_up/sign_up_view_model.dart:
- Marked
signUp
asfinal
for consistency.
- Marked
- lib/utils/validate.dart:
- Renamed
Validate
class toSignValidate
to improve clarity and avoid future naming conflicts.
- Renamed
Conclusion:
These changes finalize the logout feature, improve responsiveness of auth actions with loading indicators, and enhance maintainability by standardizing validation and UI behavior across screens. This also refactors shared widget logic into a more flexible and scalable format.
2025/04/03 – version: 0.0.01+06
This commit enhances the sign-up flow with full integration of the SignUpViewModel
, introduces new validation logic, adjusts routing for dependency injection, and refactors the sign-in flow for naming consistency and better clarity.
Changes made:
- .env:
- Updated the Supabase
URL
from127.0.0.1
to a local network IP192.168.0.22
.
- Updated the Supabase
- lib/routing/router.dart:
- Refactored imports for better readability.
- Injected
SignUpViewModel
into theSignUpPage
usingRemoteAuthRepository
andSupabaseAuthService
.
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored import of
sign_in_view_model.dart
to a relative path. - Updated
SignInViewModel
usage: replacedlogin
withsignIn
in listeners and method calls to reflect updated naming. - Minor formatting fix in
BasicTextField
props order.
- Refactored import of
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Renamed command from
login
tosignIn
to improve clarity. - Renamed internal method
_login
to_signIn
. - Updated logger name from
LoginViewModel
toSignInViewModel
.
- Renamed command from
- 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.
- Injected
- lib/ui/features/sign_up/sign_up_view_model.dart:
- Created a new
SignUpViewModel
class. - Implemented
signUp
command usingCommand1
to encapsulate sign-up logic and handle result logging.
- Created a new
- lib/utils/validate.dart:
- Added a new method
confirmPassword
to check if confirmation matches the original password.
- Added a new method
Conclusion:
These improvements finalize the sign-up feature with robust state management, validation, and navigation logic, aligning it with the architecture used in sign-in. The changes also ensure better naming consistency and modularity across the app.
2025/04/03 – version: 0.0.01+05
This commit introduces significant updates to the authentication flow, UI structure, and routing configuration, along with new reusable UI components and enhancements to form validation and theme styling.
Changes made:
- devtools_options.yaml:
- Created a new configuration file to store Dart & Flutter DevTools settings.
- lib/data/repositories/auth/remote_auth_repository.dart:
- Changed the return type of the
login
method fromResult<void>
toResult<LoggedUser>
. - Refactored the login logic using
fold
to handle success and failure cases more explicitly.
- Changed the return type of the
- lib/main_app.dart:
- Changed the app theme from
theme.dark()
totheme.light()
inMaterialApp.router
.
- Changed the app theme from
- lib/routing/router.dart:
- Corrected typo in route paths from
singIn
andsingUp
tosignIn
andsignUp
. - Modified the sign-in route to provide a
SignInViewModel
with an injectedRemoteAuthRepository
. - Updated the sign-up route to render the correct
SignUpPage
.
- Corrected typo in route paths from
- lib/routing/routes.dart:
- Corrected route constants from
singIn
andsingUp
tosignIn
andsignUp
.
- Corrected route constants from
- lib/ui/core/theme/dimens.dart:
- Increased the default border radius from 12 to 50 in
_DimensMobile
.
- Increased the default border radius from 12 to 50 in
- lib/ui/core/ui/buttons/big_button.dart:
- Simplified the button layout by removing unnecessary padding.
- Adjusted alpha value in
backgroundColor
for better visual emphasis. - Used
dimens.spacingHorizontal
for spacing between elements.
- 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.
- Added a new
- lib/ui/core/ui/text_fields/basic_text_field.dart:
- Created a reusable
BasicTextField
widget encapsulating commonTextFormField
configurations. - Added automatic validation mode activation when text is entered.
- Created a reusable
- lib/ui/core/ui/text_fields/secret_text_field.dart:
- Added a
SecretTextField
widget based onBasicTextField
, with a visibility toggle icon for password input.
- Added a
- lib/ui/features/home/home_page.dart:
- Updated the
AppBar
icon to useSymbols.dark_mode_rounded
.
- Updated the
- lib/ui/features/sign_in/sign_in_page.dart:
- Refactored to use
SignInViewModel
with reactive command execution. - Replaced raw
TextFormField
usage withBasicTextField
andSecretTextField
. - Added new UI components: fingerprint authentication icon, route navigation to sign-up, and password recovery.
- Enhanced styling using
colorScheme
andDimens
.
- Refactored to use
- lib/ui/features/sign_in/sign_in_view_model.dart:
- Added
SignInViewModel
class withCommand1
to execute the login process. - Implemented detailed logging for success and failure scenarios.
- Added
- lib/ui/features/sign_up/sign_up_page.dart:
- Implemented the complete sign-up UI using
BasicTextField
andSecretTextField
. - Added navigation to login page and basic layout structure.
- Implemented the complete sign-up UI using
- lib/utils/commands.dart:
- Fixed typo in method name from
excute
toexecute
inCommand1
.
- Fixed typo in method name from
- lib/utils/validate.dart:
- Added email and password validation logic using regular expressions.
- Created a
Validate
utility class to encapsulate form validation rules.
- pubspec.lock:
- Updated lockfile with new dependencies including
material_symbols_icons
,args
,chalkdart
, andglob
.
- Updated lockfile with new dependencies including
- pubspec.yaml:
- Added
material_symbols_icons
package to dependencies.
- Added
Conclusion:
These changes lay the foundation for a structured authentication system and improved user experience through reusable components and cleaner routing. They also introduce robust validation mechanisms and consistent styling aligned with the app’s design system.
2025/04/03 – version: 0.0.01+04
Refactored app theming and structure; introduced responsive UI elements and custom theme support.
Changes made:
android/app/build.gradle.kts
- Set
ndkVersion
explicitly to"27.0.12077973"
for compatibility and stability across environments.
- Set
lib/main.dart
- Removed
MainApp
widget frommain.dart
, delegating it to its own filemain_app.dart
.
- Removed
lib/main_app.dart
(new)- Introduced
MainApp
widget as aStatefulWidget
with custom theming. - Dynamically applies dark mode theme with custom
MaterialTheme
.
- Introduced
lib/routing/router.dart
- Changed
initialLocation
toRoutes.singIn
(presumably a login screen). - Cleaned up import paths using relative imports.
- Changed
lib/ui/core/theme/
(new)- Added a full theming system:
theme.dart
: defines custom color schemes and theming logic.fonts.dart
: responsive typography with Google Fonts support (Quicksand
andAssistant
).dimens.dart
: responsive paddings, spacings and radius for mobile and desktop.util.dart
: generatesTextTheme
from Google Fonts dynamically.
- Added a full theming system:
lib/ui/core/ui/buttons/big_button.dart
(new)- Introduced a reusable
BigButton
component with custom color, shape, and optional icon.
- Introduced a reusable
lib/ui/features/sign_in/sign_in_page.dart
- Replaced
Placeholder
with a fully implemented sign-in form usingDimens
andBigButton
. - Styled input fields and button using the new theme system.
- Replaced
pubspec.yaml
- Added dependency on
google_fonts: ^6.2.1
.
- Added dependency on
pubspec.lock
- Updated lockfile to reflect new dependency on
google_fonts
.
- Updated lockfile to reflect new dependency on
Conclusion:
This commit introduces a scalable and modular design system with clear separation between logic, theme, and presentation. It significantly enhances UI responsiveness, theme customization, and maintainability, setting a strong foundation for future feature development.
2025/04/02 – version: 0.0.01+03
Renamed base auth repository and added new domain models and enums to support extended user profiles.
Changes made:
- lib/data/repositories/auth/abstract_auth_repository.dart:
- Renamed from
auth_repository.dart
to reflect its role as an abstract base class.
- Renamed from
- lib/data/repositories/auth/dev_auth_repository.dart:
- Updated import path to reference the renamed
abstract_auth_repository.dart
.
- Updated import path to reference the renamed
- lib/data/repositories/auth/remote_auth_repository.dart:
- Updated import path to reference the renamed
abstract_auth_repository.dart
.
- Updated import path to reference the renamed
- lib/domain/enums/enums_declarations.dart:
- Created a new file defining multiple domain enums:
DocumentType
,UserRole
,Sex
,SoccerPosition
,AffiliationStatus
,Weekday
,SportType
, andMessageCategories
.
- Included
LabeledEnum
interface and extensionEnumExtension
for utility mapping.
- Created a new file defining multiple domain enums:
- lib/domain/models/address.dart:
- Introduced
Address
model with fulltoMap
/fromMap
serialization support andcopyWith
method.
- Introduced
- lib/domain/models/athlete.dart:
- Created
Athlete
model with personal details, document, sports list, and address relation. - Includes serialization and copy functionality.
- Created
- lib/domain/models/manager.dart:
- Created
Manager
model similar toAthlete
, with two documents and sport tracking.
- Created
- lib/domain/models/person.dart:
- Defined
Person
model representing a general user with profile and address references.
- Defined
- lib/domain/models/user_auth.dart:
- Extended
UserAuth
base class to include optionalphone
field. - Preserved backward compatibility via default parameters.
- Extended
- lib/utils/result.dart:
- Annotated
Success.value
andFailure.error
with@override
to clarify their behavior from the abstract base.
- Annotated
Conclusion:
This update lays the groundwork for managing user profile types and roles through a well-structured domain model. It enables support for complex personas such as athletes and managers, and aligns the codebase with a more modular and extensible architecture.
2025/03/31 – version: 0.0.01+02
Refactored Supabase integration to introduce SupabaseAuthService
with full authentication handling and test coverage.
Changes made:
- .env:
- Added commented environment variables for the hosted Supabase instance to support multiple environments.
- Makefile:
- Added
rebuild
command to clean and restore Flutter dependencies. - Added
test_coverage
command to run tests and generate coverage report.
- Added
- coverage/lcov.info:
- Added test coverage data file generated from unit tests.
- lib/data/services/supabase_auth_service.dart:
- Introduced
SupabaseAuthService
to replaceSupabaseService
. - 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.
- Introduced
- lib/data/services/supabase_service.dart:
- Deleted legacy
SupabaseService
, which is now fully replaced bySupabaseAuthService
.
- Deleted legacy
- lib/main.dart:
- Updated to load environment variables using
flutter_dotenv
. - Replaced
SupabaseService
withSupabaseAuthService
. - Added example authentication flow with debug prints for success and failure cases.
- Updated to load environment variables using
- lib/utils/result.dart:
- Extended
Result<T>
withvalue
anderror
getters for easier access to result contents.
- Extended
- test/data/services/.env_test_supabase:
- Added a separate environment file for local Supabase CLI testing.
- test/data/services/supabase_auth_service_test.dart:
- Created comprehensive integration tests for
SupabaseAuthService
. - Covered user registration, sign-in, sign-out, duplicate handling, password recovery, and password update flows.
- Created comprehensive integration tests for
Conclusion:
This refactor significantly enhances the authentication architecture by consolidating Supabase-related logic into a single, reactive service. It also introduces robust automated tests, enabling better validation of user flows and improved maintainability going forward.
2025/03/28 – version: 0.0.01+01
Initial integration of Supabase services and setup of authentication infrastructure.
Changes made:
- .env:
- Added environment variables for local Supabase CLI usage, including
URL
andAnonKey
.
- Added environment variables for local Supabase CLI usage, including
- .vscode/extensions.json:
- Added VSCode extension recommendation for
denoland.vscode-deno
.
- Added VSCode extension recommendation for
- .vscode/settings.json:
- Configured Deno support and linting for
supabase/functions
.
- Configured Deno support and linting for
- Makefile:
- Added custom Makefile commands to start/stop Supabase CLI, generate diffs, and push commits.
- android/app/src/main/AndroidManifest.xml:
- Added permission to allow internet access in the Android application.
- lib/data/repositories/auth/auth_repository.dart:
- Created abstract class
AuthRepository
with methods for authentication logic:login
,logout
,signUp
, andisAuthenticated
.
- Created abstract class
- lib/data/repositories/auth/dev_auth_repository.dart:
- Implemented
DevAuthRepository
, a mock implementation ofAuthRepository
for development purposes.
- Implemented
- lib/data/repositories/auth/remote_auth_repository.dart:
- Created
RemoteAuthRepository
as a stubbed implementation ofAuthRepository
for future remote integration.
- Created
- lib/data/services/shared_preferences_service.dart:
- Added
SharedPreferencesService
to handle storing and retrieving tokens using shared preferences.
- Added
- lib/data/services/supabase_service.dart:
- Created
SupabaseService
with methods for initialization, user sign-up, sign-in with password, and sign-out.
- Created
- lib/domain/dto/credentials.dart:
- Introduced
Credentials
class to encapsulate email and password used for authentication.
- Introduced
- lib/domain/models/user_auth.dart:
- Created a sealed class
UserAuth
with two implementations:LoggedUser
andNotLoggedUser
, to represent authentication states.
- Created a sealed class
- lib/main.dart:
- Modified main function to initialize
SupabaseService
before running the app. - Added call to sign out the user during app initialization.
- Modified main function to initialize
- linux/flutter/generated_plugin_registrant.cc:
- Registered new plugins:
GtkPlugin
andUrlLauncherPlugin
.
- Registered new plugins:
- linux/flutter/generated_plugins.cmake:
- Included
gtk
andurl_launcher_linux
in the plugin list.
- Included
- pubspec.yaml:
- Simplified and cleaned up comments.
- Set version to
0.0.1+1
. - Added new dependencies:
shared_preferences
,logging
,supabase_flutter
, andflutter_dotenv
. - Included
.env
file in asset list.
- supabase/.gitignore:
- Added ignore rules for Supabase-generated files and dotenv local environment files.
- supabase/config.toml:
- Added full Supabase configuration for local development, covering API, DB, Studio, Realtime, Storage, Auth, and more.
Conclusion:
This commit establishes the foundation for user authentication via Supabase, introducing services, repositories, and shared preferences handling. It also configures local development tools and dependencies, paving the way for further backend integration.
Deixe uma resposta