- Set a fexed size for ad images and perform other optimizations on images to reduce resource consumption on the Parse Server.
This commit refactors various parts of the mechanics feature, significantly simplifying the controller logic by utilizing the newly introduced MechanicsStore
class for state management. In addition, several deprecated files were removed, and redundant methods were replaced to improve maintainability and efficiency.
-
assets/old/bgBazzar.db:
- Removed the old database file
bgBazzar.db
.
- Removed the old database file
-
lib/features/mechanics/mechanics_controller.dart:
- Replaced
MechanicsState
withMechanicsStore
for managing mechanics. - Removed
ChangeNotifier
and other state-related code, makingMechanicsController
lighter and more focused on business logic.
- Replaced
-
lib/features/mechanics/mechanics_screen.dart:
- Updated to use
MechanicsStore
for state management instead of the previousMechanicsState
approach. - Added
_removeMechanic
method to remove mechanics, which also logs the operation for debugging purposes.
- Updated to use
-
lib/features/mechanics/mechanics_state.dart (deleted):
- Removed
MechanicsState
and its various states (Initial
,Loading
,Success
,Error
). - These states are now replaced by the new state management using
MechanicsStore
.
- Removed
-
lib/features/mechanics/mechanics_store.dart (new file):
- Added
MechanicsStore
to handle the mechanics selection, count, UI flags, and state management. - Contains utility methods for selecting/deselecting mechanics, managing UI states, and interacting with
MechanicsController
.
- Added
-
lib/features/mechanics/widgets/search_mechs_delegate.dart:
- Updated
SearchMechsDelegate
to useMechanicsManager
directly for fetching mechanics names, removing the need to passmechsNames
as a parameter.
- Updated
-
lib/features/mechanics/widgets/show_all_mechs.dart:
- Converted
ShowAllMechs
into a stateful widget to work withMechanicsStore
. - Integrated the
MechanicsStore
for managing selections and toggling descriptions.
- Converted
-
lib/features/mechanics/widgets/show_only_selected_mechs.dart:
- Updated to use
MechanicsStore
for state management and handling the display of selected mechanics. - Replaced static parameter passing with dynamic state updates from
MechanicsStore
.
- Updated to use
-
lib/features/my_account/my_account_screen.dart:
- Removed duplicate rendering of
AdminHooks
, ensuring only one instance is displayed on theMyAccountScreen
.
- Removed duplicate rendering of
-
lib/repository/interfaces/i_mechanic_repository.dart:
- Added a new
delete(String id)
method toIMechanicRepository
for deleting mechanics.
- Added a new
-
lib/repository/parse_server/ps_ad_repository.dart:
- Renamed the
delete
method parameter fromad
toid
for better clarity. - Modified the
_prepareAdForSaveOrUpdate
method to use a simpler conditional structure when setting theobjectId
.
- Renamed the
-
lib/repository/parse_server/ps_boardgame_repository.dart:
- Simplified the
_prepareBgForSaveOrUpdate
method by optimizing the wayParseObject
is initialized. - Updated object field setting to use
setNonNull
to ensure non-null values are handled correctly.
- Simplified the
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Added a new
delete(String id)
method to delete a mechanic from the server. - Updated
_prepareMechForSaveOrUpdate
to simplify setting theobjectId
.
- Added a new
This refactor simplifies the codebase by reducing redundant state management logic and replacing it with a more consistent state management approach using MechanicsStore
. The overall maintainability and scalability of the mechanics feature are improved, as the store centralizes all state-related functionalities. Additionally, the removal of deprecated files and redundant methods results in a cleaner and more efficient codebase.
This commit includes multiple updates and enhancements across various parts of the codebase, focusing on improving the consistency, maintainability, and reusability of the project components. Key changes include the addition of new methods, the replacement of repetitive code with utility functions, the introduction of a new utility class (PsFunctions
), and modifications to existing functionalities for better adherence to best practices.
-
lib/common/models/bg_name.dart:
- Added a
copyWith
method to create copies ofBGNameModel
instances with modified attributes.
- Added a
-
lib/components/form_fields/custom_long_form_field.dart:
- Added a
FocusNode
as an optional parameter toCustomLongFormField
for better focus control.
- Added a
-
lib/components/others_widgets/state_error_message.dart:
- Removed
margin
from theContainer
widget and added it to theCard
widget for better layout control.
- Removed
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Removed an unnecessary logging statement from the
EditBoardgameController
.
- Removed an unnecessary logging statement from the
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart:
- Added a
nextFocusNode
parameter toCustomLongFormField
for smooth focus transitions. - Assigned the newly added
FocusNode
toCustomLongFormField
.
- Added a
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form_controller.dart:
- Added a
FocusNode
(descriptionFocus
) for managing the focus of the description field. - Disposed of
descriptionFocus
in thedispose
method.
- Added a
-
lib/manager/boardgames_manager.dart:
- Updated
_getLocalBgNames
to usegetAll
instead ofget
for fetching board game names. - Modified
_sortingBGNames
to use a more optimized approach for sorting_localBGsList
.
- Updated
-
lib/repository/parse_server/common/ps_functions.dart (new file):
- Introduced
PsFunctions
class with utility methods:handleError
,parseCurrentUser
, andcreateDefaultAcl
. - These utility methods centralize common operations like error handling, fetching the current user, and creating default ACLs, improving reusability.
- Introduced
-
lib/repository/parse_server/ps_ad_repository.dart:
- Replaced repetitive code for fetching the current user, handling errors, and creating ACLs with the utility methods from
PsFunctions
. - Removed redundant methods (
_parseCurrentUser
,_handleError
,_createDefaultAcl
) that were replaced by thePsFunctions
.
- Replaced repetitive code for fetching the current user, handling errors, and creating ACLs with the utility methods from
-
lib/repository/parse_server/ps_address_repository.dart:
- Updated
parseAddress
object setting by replacing standardset
calls withsetNonNull
to ensure non-nullable fields are consistently handled.
- Updated
-
lib/repository/parse_server/ps_boardgame_repository.dart:
- Refactored methods to use
PsFunctions
for user retrieval, ACL creation, and error handling. - Removed redundant implementations (
_parseCurrentUser
,_createDefaultAcl
).
- Refactored methods to use
-
lib/repository/parse_server/ps_favorite_repository.dart:
- Updated
parseFav
object setting by replacing standardset
calls withsetNonNull
for consistent handling of non-nullable fields.
- Updated
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Used
PsFunctions
for common operations, including user retrieval and ACL creation. - Removed redundant code (
_createDefaultAcl
,_parseCurrentUser
,_handleError
) that has been centralized inPsFunctions
.
- Used
-
lib/repository/parse_server/ps_user_repository.dart:
- Refactored the error handling to use
PsFunctions.handleError
. - Updated user field settings to use
setNonNull
for improved consistency.
- Refactored the error handling to use
-
lib/repository/sqlite/bg_names_repository.dart:
- Renamed method
get
togetAll
to better reflect its functionality and improve readability.
- Renamed method
-
lib/repository/sqlite/local_interfaces/i_bg_names_repository.dart:
- Updated interface method name from
get
togetAll
to align with the implementation.
- Updated interface method name from
-
lib/store/stores/bg_names_store.dart:
- Renamed method
get
togetAll
for consistency with the repository and interface changes.
- Renamed method
This commit centralizes common functionalities into reusable components (PsFunctions
), enhances code clarity, and reduces redundancy. These changes improve the overall maintainability of the codebase, ensuring consistency in error handling, user management, and data access control. Additionally, better focus control in form fields and optimized sorting of board games contribute to a more seamless user experience.
This commit introduces changes aimed at simplifying the data models and repository architecture, eliminating redundant fields and improving the overall consistency of the code. The modifications streamline the handling of IDs across models, ensuring a more uniform approach for data identification and storage.
-
assets/data/bgBazzar.db:
- Updated the binary data of the SQLite database.
-
assets/data/bgBazzar2.db:
- Removed the deprecated
bgBazzar2.db
database file.
- Removed the deprecated
-
lib/common/models/ad.dart:
- Modified
mechanicsString
to usemec.id
instead ofmec.psId
for consistency with other models.
- Modified
-
lib/common/models/bg_name.dart:
- Removed the
bgId
field and replacedid
type fromint
toString
to align with other models.
- Removed the
-
lib/common/models/mechanic.dart:
- Removed the
psId
field and replacedid
type fromint
toString
to standardize data representation.
- Removed the
-
lib/features/boardgame/boardgame_controller.dart:
- Updated
isSelected
andselectBGId
methods to usebg.id
instead ofbg.bgId
.
- Updated
-
lib/features/boardgame/widgets/search_card.dart:
- Modified the
onTap
callback to usebgBoard.id
instead ofbgBoard.bgId
.
- Modified the
-
lib/features/check_mechanics/check_controller.dart:
- Replaced
mech.psId
withmech.id
in theget
method for mechanics.
- Replaced
-
lib/features/check_mechanics/check_page.dart:
- Updated the display of mechanic IDs to use
mech.id
instead ofmech.psId
.
- Updated the display of mechanic IDs to use
-
lib/features/mechanics/mechanics_controller.dart:
- Updated
isSelectedIndex
andtoogleSelectionIndex
methods to usemechanics[index].id
instead ofmechanics[index].psId
.
- Updated
-
lib/get_it.dart:
- Added imports for
i_favorite_repository.dart
andps_favorite_repository.dart
. - Registered
ILocalMechanicRepository
andIFavoriteRepository
inGetIt
for dependency injection.
- Added imports for
-
lib/manager/boardgames_manager.dart:
- Updated references to
bgId
to useid
in methods like_initializeBGNames
and_updateLocalDatabaseIfNeeded
. - Added a comment for better clarity in the
_sortingBGNames
method.
- Updated references to
-
lib/manager/favorites_manager.dart:
- Replaced direct use of
PSFavoriteRepository
withfavoriteRepository
to decouple the implementation.
- Replaced direct use of
-
lib/manager/mechanics_manager.dart:
- Removed usage of
psId
in favor ofid
for mechanics throughout the manager.
- Removed usage of
-
lib/repository/interfaces/i_favorite_repository.dart (New file):
- Created an interface
IFavoriteRepository
to handle adding and deleting favorites.
- Created an interface
-
lib/repository/parse_server/common/parse_to_model.dart:
- Updated parsing logic for
BGNameModel
andMechanicModel
to useid
instead ofbgId
orpsId
.
- Updated parsing logic for
-
lib/repository/parse_server/ps_favorite_repository.dart:
- Implemented
IFavoriteRepository
to manage favorite-related operations.
- Implemented
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Modified
saveMechanic
method to usemech.id
instead ofmech.psId
.
- Modified
-
lib/repository/sqlite/bg_names_repository.dart:
- Removed setting
bg.id
after adding a new boardgame to the SQLite database.
- Removed setting
-
lib/repository/sqlite/mechanic_repository.dart:
- Removed setting
mech.id
after adding a new mechanic to the SQLite database.
- Removed setting
-
lib/store/constants/constants.dart:
- Removed constants
mechPSId
andbgBgId
as they are no longer required.
- Removed constants
-
lib/store/constants/migration_sql_scripts.dart:
- Removed migration scripts related to
mechPSId
.
- Removed migration scripts related to
-
lib/store/constants/sql_create_table.dart:
- Updated
createBgNamesTable
to usebgId
as aTEXT PRIMARY KEY
instead of an auto-incrementing integer.
- Updated
-
lib/store/stores/mechanics_store.dart:
- Removed the
mechPSId
column from the query in theget
method.
- Removed the
-
pubspec.yaml:
- Updated version from
0.7.10+65
to0.7.11+66
.
- Updated version from
These changes simplify the data structure by eliminating redundant ID fields and aligning all models to use a single id
field of type String
. This unification improves code maintainability and consistency, while also reducing potential confusion regarding different types of IDs.
This commit introduces significant updates to the dependency injection setup and several repository classes to improve the consistency and scalability of the codebase. Notable changes include the introduction of new interfaces for repositories and the implementation of dependency inversion to ensure better separation of concerns.
-
lib/get_it.dart:
- Added imports for
i_address_repository.dart
andps_address_repository.dart
. - Registered
IAddressRepository
withPSAddressRepository
inGetIt
for Parse Server dependencies. - Introduced
SQFLite Repositories
with theSqliteBGNamesRepository
registration.
- Added imports for
-
lib/manager/address_manager.dart:
- Replaced direct use of
PSAddressRepository
withIAddressRepository
to decouple the implementation from theAddressManager
. - Utilized
getIt<IAddressRepository>()
to obtain the repository instance for handling CRUD operations.
- Replaced direct use of
-
lib/manager/mechanics_manager.dart:
- Added import for
i_local_mechanic_repository.dart
. - Introduced
localMechRepository
for handling operations via the local SQLite database. - Replaced direct references to
SqliteMechanicRepository
withlocalMechRepository
to use dependency injection for better scalability.
- Added import for
-
lib/repository/interfaces/i_address_repository.dart (New file):
- Created an interface
IAddressRepository
defining the contract for saving, deleting, and fetching user addresses. - Introduced
AddressRepositoryException
to handle errors related to the address repository.
- Created an interface
-
lib/repository/parse_server/ps_address_repository.dart:
- Implemented
IAddressRepository
to provide the address-related functionality specific to Parse Server. - Changed methods (
save
,delete
,getUserAddresses
) fromstatic
to instance methods, aligning them with the interface implementation.
- Implemented
-
lib/repository/sqlite/local_interfaces/i_local_mechanic_repository.dart (New file):
- Created an interface
ILocalMechanicRepository
for handling SQLite operations related to game mechanics. - Defined methods for retrieving, adding, and updating mechanics within the local database.
- Created an interface
-
lib/repository/sqlite/mechanic_repository.dart:
- Updated
SqliteMechanicRepository
to implementILocalMechanicRepository
. - Converted static methods (
get
,add
,update
) to instance methods to comply with the interface requirements.
- Updated
These modifications enhance modularity and flexibility by decoupling specific implementations from the core logic through the use of interfaces. This approach ensures that future changes in the repository implementations are less intrusive, thus promoting easier testing and maintenance.
This commit introduces several key changes to enhance the maintainability of the boardgame application, focusing on improving local storage handling, modularizing state management, and refining UI elements.
-
lib/features/boardgame/boardgame_controller.dart:
- Updated the getter for the list of board games (
bgs
) to referencebgManager.localBGList
instead ofbgManager.bgs
.
- Updated the getter for the list of board games (
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Added logic to check if
boardgame.id
isnull
to decide whether to update an existing board game or save a new one.
- Added logic to check if
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart:
- Wrapped the
ImageView
widget in aClipRRect
with a border radius of 12 to add rounded corners, enhancing UI consistency.
- Wrapped the
-
lib/get_it.dart:
- Removed redundant import of
ps_ad_repository.dart
. - Added a new import for
bg_names_repository.dart
and registeredIBgNamesRepository
to enhance dependency management.
- Removed redundant import of
-
lib/manager/boardgames_manager.dart:
- Refactored the board game manager to use a new local SQLite repository (
IBgNamesRepository
) for managing board game names. - Added methods to handle initialization, saving, updating, and local database synchronization.
- Modularized image processing logic to make board game saving and updating more consistent and maintainable.
- Refactored the board game manager to use a new local SQLite repository (
-
lib/repository/parse_server/ps_user_repository.dart:
- Introduced
_handleError
method for centralized error logging and handling.
- Introduced
-
lib/repository/sqlite/bg_names_repository.dart:
- Implemented the
IBgNamesRepository
interface, includingget
,add
, andupdate
methods for board game names.
- Implemented the
-
lib/repository/sqlite/local_interfaces/i_bg_names_repository.dart (new file):
- Created an interface (
IBgNamesRepository
) to standardize SQLite operations for board game names, ensuring modularity and testability.
- Created an interface (
These updates improve the consistency of state management, enhance the user experience with improved UI elements, and standardize the handling of local board game names. The refactoring also modularizes the code, making future updates easier to manage and enhancing error handling across the application.
This commit introduces multiple updates to improve code modularity, maintainability, and add new features to the boardgame application. Changes include modifications to build configurations, models, form fields, new feature additions, and the refactoring of various components and screens.
-
android/app/build.gradle:
- Enabled configurations for code shrinking, obfuscation, and optimization in release builds.
- Added rules to use
proguard-rules.pro
for ProGuard settings. - Added comments to clarify configurations that are not part of the official documentation, to assist with potential troubleshooting in production.
-
android/app/proguard-rules.pro:
- Created a new ProGuard configuration file with a rule to keep the
androidx.lifecycle.DefaultLifecycleObserver
class.
- Created a new ProGuard configuration file with a rule to keep the
-
lib/common/models/boardgame.dart:
- Removed the
views
property fromBoardgameModel
. - Added a factory constructor
BoardgameModel.clean()
to return a default, clean instance of the model. - Introduced
copyWith
method to enable easy cloning and modification ofBoardgameModel
instances.
- Removed the
-
lib/components/form_fields/custom_long_form_field.dart:
- Added
onChanged
callback toCustomLongFormField
for flexibility in form interactions. - Updated the
onChanged
function to use the providedonChanged
callback directly.
- Added
-
lib/components/form_fields/custom_names_form_field.dart:
- Added
onChanged
and updated theonSubmitted
callback to pass the current value. - Updated
onChanged
to use the provided callback directly.
- Added
-
lib/components/others_widgets/spin_box_field.dart:
- Added
onChange
callback to handle changes in the spin box values. - Updated
_increment
and_decrement
methods to call_updateOnChange
whenever values are adjusted.
- Added
-
lib/features/boardgame/boardgame_screen.dart:
- Replaced the
OverflowBar
for Floating Action Buttons with a newCustomFloatingActionBar
widget to improve code reuse and consistency.
- Replaced the
-
lib/features/boardgame/widgets/custom_floating_action_bar.dart (new file):
- Introduced a new widget
CustomFloatingActionBar
to manage the floating action buttons for boardgame operations.
- Introduced a new widget
-
lib/features/edit_ad/edit_ad_controller.dart.old (deleted):
- Removed old and unused file
edit_ad_controller.dart.old
to clean up the project.
- Removed old and unused file
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Refactored
EditBoardgameController
to decouple the state management from the controller logic. - Integrated
EditBoardgameStore
to handle stateful logic, improving separation of concerns.
- Refactored
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart (new file):
- Created a new
EditBoardgameForm
widget to encapsulate the form fields and related logic for editing a boardgame.
- Created a new
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form_controller.dart (new file):
- Created a new controller
EditBoardgameFormController
to manage the logic forEditBoardgameForm
, providing better modularity.
- Created a new controller
-
lib/features/edit_boardgame/edit_boardgame_screen.dart:
- Updated to use
EditBoardgameForm
andCustomFilledButton
, enhancing maintainability by breaking down responsibilities.
- Updated to use
-
lib/features/edit_boardgame/edit_boardgame_state.dart (deleted):
- Removed the obsolete state management file in favor of using the new
EditBoardgameStore
.
- Removed the obsolete state management file in favor of using the new
-
lib/features/edit_boardgame/edit_boardgame_store.dart (new file):
- Added
EditBoardgameStore
to handle the boardgame state, including validation and status tracking for editing operations.
- Added
-
lib/features/edit_boardgame/get_image/get_image.dart (new file):
- Added a new widget
GetImage
to handle image selection, allowing users to either input a path manually or pick a file using a dialog. - Includes functionality for picking local files via the
FilePicker
package.
- Added a new widget
-
lib/features/edit_boardgame/widgets/custom_filled_button.dart (new file):
- Introduced
CustomFilledButton
widget to provide a consistent styled button for actions throughout the boardgame edit flow.
- Introduced
-
lib/features/mechanics/mechanics_screen.dart:
- Updated the Floating Action Buttons to provide a consistent layout, replacing the
OverflowBar
with individualPadding
widgets for better spacing control.
- Updated the Floating Action Buttons to provide a consistent layout, replacing the
-
lib/get_it.dart:
- Registered
IBoardgameRepository
withPSBoardgameRepository
for dependency injection, enhancing the consistency of repository management.
- Registered
-
lib/manager/boardgames_manager.dart:
- Updated to use
IBoardgameRepository
instead of directly accessingPSBoardgameRepository
. - Improved dependency injection and separation of concerns.
- Updated to use
-
lib/repository/interfaces/i_ad_repository.dart:
- Added detailed comments to document each method, clarifying their purpose and expected behavior for maintainability.
-
lib/repository/interfaces/i_boardgame_repository.dart (new file):
- Created an interface for
IBoardgameRepository
to define the contract for managing boardgame data, promoting modularity and testability.
- Created an interface for
-
lib/repository/interfaces/i_mechanic_repository.dart:
- Added comprehensive documentation for all methods to improve code clarity and ease of use.
-
lib/repository/parse_server/common/constants.dart:
- Removed
keyBgViews
as it is no longer needed in the updatedBoardgameModel
.
- Removed
-
lib/repository/parse_server/common/parse_to_model.dart:
- Updated
ParseToModel.boardgameModel()
to remove the mapping forviews
since it is no longer part of the model.
- Updated
-
lib/repository/parse_server/ps_ad_repository.dart:
- Removed redundant comments and added new error handling to the
delete()
method for better consistency.
- Removed redundant comments and added new error handling to the
-
lib/repository/parse_server/ps_boardgame_repository.dart:
- Implemented
IBoardgameRepository
interface and refactored methods for better consistency and error handling. - Added private helper methods to modularize repetitive tasks such as creating ACLs and preparing
ParseObject
instances.
- Implemented
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Improved code documentation, modularized methods for ACL creation and current user fetching, and enhanced error handling.
-
pubspec.yaml:
- Added
file_picker
dependency (version8.1.3
) to support local file selection.
- Added
-
pubspec.lock:
- Updated to include the
file_picker
package (version8.1.3
).
- Updated to include the
These changes improve the maintainability and modularity of the boardgame application, making it easier to manage forms, UI components, and state. The addition of new callbacks provides greater flexibility, while the refactoring ensures that state management is more streamlined and separated from UI logic.
This commit refactors and enhances several UI components and navigation flows, with a focus on improving code reuse, consistency, and user interaction. These updates primarily affect form submission behaviors and the handling of navigation within the app.
-
lib/components/custom_drawer/custom_drawer.dart:
- Added a
setPageTitle
callback parameter to improve flexibility when updating the page title after drawer interaction. - Modified
_navAccountScreen
method to use the newsetPageTitle
callback.
- Added a
-
lib/components/form_fields/custom_form_field.dart:
- Enhanced the
onFieldSubmitted
method to advance focus to the next form field, ensuring a smoother form filling experience.
- Enhanced the
-
lib/components/form_fields/password_form_field.dart:
- Updated
onFieldSubmitted
to advance focus to the next form field and callonFieldSubmitted
if it is not null, similar tocustom_form_field.dart
.
- Updated
-
lib/features/shop/shop_screen.dart:
- Renamed
navToLoginScreen
to_navToLoginScreen
to reflect private method naming conventions. - Updated drawer instantiation to pass the
setPageTitle
function instead of directly using the controller method. - Refactored floating action button behavior to use
_navToLoginScreen
method.
- Renamed
-
lib/features/signin/signin_screen.dart:
- Refactored UI to include a new
BigButton
for login action and moved the registration button into a more accessible area. - Simplified the form and navigation flow for better usability.
- Refactored UI to include a new
-
lib/features/signin/widgets/signin_form.dart:
- Converted
SignInForm
from aStatelessWidget
to aStatefulWidget
to manageFocusNode
for better form control. - Added
nextFocusNode
parameter to the email field to improve user experience. - Moved the password field's submission behavior to advance focus and initiate login.
- Converted
-
lib/features/signup/signup_screen.dart:
- Renamed
signupUser
method to_signupUser
to follow private method naming conventions. - Commented out and removed social media registration buttons (e.g., Facebook) for simplification.
- Renamed
-
lib/features/signup/widgets/signup_form.dart:
- Converted
SignUpForm
from aStatelessWidget
to aStatefulWidget
to manageFocusNode
. - Added focus control between password and confirm password fields, allowing for smoother form navigation.
- Moved the "Sign Up" button to the main
SignUpScreen
for better separation of concerns.
- Converted
The changes introduced in this commit significantly enhance the user experience when interacting with forms by improving focus management and simplifying navigation. Additionally, UI refactorings ensure a consistent look and feel across the application, while adhering to best practices for code organization and reuse.
This commit introduces several important refactorings and improvements across multiple files in the Parse server repositories, focusing on modularizing error handling, refining query logic, and optimizing code readability and maintainability.
-
lib/repository/parse_server/common/parse_to_model.dart:
- Added
ParseObjectExtensions
extension to allow setting non-null fields onParseObject
using thesetNonNull
method.
- Added
-
lib/repository/parse_server/ps_ad_repository.dart:
- Updated
moveAdsAddressTo
method to perform multiple ad updates in parallel usingFuture.wait
, improving efficiency. - Refactored
adsInAddress
,updateStatus
,getMyAds
,get
,save
, andupdate
methods to use a more consistent error handling approach with_handleError
. - Introduced new helper methods
_parseCurrentUser
,_parseAddress
,_parseBoardgame
,_createDefaultAcl
,_prepareAdForSaveOrUpdate
, and_handleError
to modularize repetitive logic, improve code readability, and facilitate reuse. - Modified
_saveImages
to return directly as a list ofParseFile
objects instead of wrapping the result in aDataResult
, and refactored it for clarity and simplicity. - Added
_prepareAdForSaveOrUpdate
to centralize ad creation or update logic, usingsetNonNull
for all fields to prevent unnecessary null checks. - Created new methods to generate
ParseObject
representations of address and board game (_parseAddress
,_parseBoardgame
) to improve maintainability.
- Updated
-
lib/repository/parse_server/ps_user_repository.dart:
- Renamed parameter
message
tomodule
in_handleError
method to standardize error handling parameters and improve log clarity.
- Renamed parameter
These changes enhance the modularity and maintainability of the code by encapsulating repeated logic into well-defined helper methods and extensions. Additionally, the adoption of batch updates and parallelism in operations significantly improves performance, while consistent error handling across the repository ensures better error tracking and debugging.
This commit focuses on the restructuring and refactoring of the advertisement and board game models, as well as the migration from PSAdRepository
to the use of a repository interface (IAdRepository
). It also includes improvements to state management in the editing advertisements flow, specifically targeting modularity and reusability.
-
lib/common/models/ad.dart:
- Removed attributes related to board game details (
yearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,designer
,artist
), and moved them to theBoardgameModel
to enhance modularity. - Replaced
mechanicsPSIds
withmechanicsIds
to unify the naming convention. - Adjusted constructors, copy methods, and properties to reflect these changes.
- Updated the
toString
method to reflect the removal of board game details, simplifying the output.
- Removed attributes related to board game details (
-
lib/common/models/boardgame.dart:
- Renamed the
bgId
attribute toid
to maintain consistency throughout the codebase. - Updated all references to
bgId
in related classes and methods toid
to ensure consistency.
- Renamed the
-
lib/features/address/address_controller.dart and lib/features/address/address_screen.dart:
- Replaced
PSAdRepository
withIAdRepository
via dependency injection (getIt<IAdRepository>()
), enhancing flexibility and testing capabilities. - Updated method calls to use the injected
adRepository
instance instead of directly referencingPSAdRepository
.
- Replaced
-
lib/features/edit_ad/:
- Removed
edit_ad_controller.dart
andedit_ad_form/edit_ad_form_store.dart
, consolidating their responsibilities intoedit_ad_store.dart
andedit_ad_form.dart
to simplify the flow. - Updated
edit_ad_form_controller.dart
andedit_ad_store.dart
to integrate new methods for handling theBoardgameModel
and ensure smoother state transitions. - Added detailed error handling and validation in
EditAdStore
for fields likeimages
,price
, andaddress
to improve user input management. - Replaced deprecated and redundant attributes (
mechanicsPSIds
,imagesLength
, etc.) with more dynamic value notifiers, improving state management. - Modified the logic for setting board game information in
EditAdStore
to utilize the newBoardgameModel
reference, centralizing board game details.
- Removed
-
lib/features/edit_ad/image_list/:
- Refactored
image_list_controller.dart
and deletedimage_list_store.dart
, simplifying image management for advertisements. - Introduced new logic in
ImagesListView
to handle dynamic image updates and user feedback, such as minimum image requirements. - Updated
HorizontalImageGallery
to remove redundant parameters and make use of the newEditAdStore
for image handling, streamlining the workflow.
- Refactored
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Updated the attribute
bgId
toid
for consistency in board game management. - Adjusted the logic for saving board game details to reflect the attribute name change, ensuring all related operations are updated.
- Updated the attribute
-
lib/features/my_ads/my_ads_controller.dart and lib/features/shop/shop_controller.dart:
- Updated all references from
PSAdRepository
toIAdRepository
to maintain the new abstraction layer. - Leveraged
getIt<IAdRepository>()
for better dependency handling, ensuring all references are updated consistently. - Modified methods like
_getAds
,_getMoreAds
, and_updateAdStatus
to use the injected repository interface, enhancing code flexibility.
- Updated all references from
-
lib/repository/interfaces/i_ad_repository.dart:
- Created the
IAdRepository
interface to define methods likemoveAdsAddressTo
,adsInAddress
,updateStatus
,getMyAds
,get
,save
,update
, anddelete
, ensuring consistency in ad data operations. - Documented each method to provide clarity on its intended use and expected parameters, facilitating future maintenance and extension.
- Created the
-
lib/repository/parse_server/ps_ad_repository.dart:
- Implemented
IAdRepository
interface methods inPSAdRepository
to conform to the newly introduced abstraction. - Added the relationship between
AdModel
andBoardgameModel
to maintain integrity when saving and updating advertisements. - Updated methods like
save
andupdate
to utilizeParseObject
relationships for the board game, ensuring proper linkage between ads and their related board games. - Removed redundant attributes (
yearpublished
,minplayers
, etc.) from the Parse save logic, centralizing these details in theBoardgameModel
.
- Implemented
-
lib/repository/parse_server/common/constants.dart and parse_to_model.dart:
- Removed constants related to board game attributes from the
AdModel
and addedkeyAdBoargGame
to reflect new data handling. - Updated parsing logic to support new relationships between ads and board games, ensuring that board game details are properly retrieved and associated with the advertisement model.
- Modified the
ParseToModel
utility to handle the nestedBoardgameModel
withinAdModel
, enhancing the separation of concerns and improving data integrity.
- Removed constants related to board game attributes from the
The refactoring enhances code modularity and maintainability by separating concerns between advertisements and board games. The migration to repository interfaces (IAdRepository
) paves the way for better testing and future extensibility, while the improvements in state management contribute to a more predictable and user-friendly experience. This detailed restructuring also reduces redundancy, centralizes board game attributes, and enhances overall code readability and scalability.
This commit introduces significant refactoring and structural improvements in the codebase, focusing on the EditAd
feature. The changes enhance maintainability, readability, and efficiency while optimizing form and controller handling.
-
lib/common/models/ad.dart:
- Renamed
mechanicsId
tomechanicsPSIds
for clarity. - Added a
get mechanicsString
method for fetching mechanics as a formatted string usingMechanicsManager
. - Added a
copyWith
method to simplify the creation of modified copies ofAdModel
.
- Renamed
-
lib/common/others/validators.dart:
- Updated the
name
validation to check if the value length is at least 3 characters.
- Updated the
-
lib/components/form_fields/custom_form_field.dart:
- Added
initialValue
parameter toCustomFormField
.
- Added
-
lib/features/edit_ad/edit_ad_controller.dart:
- Simplified the controller by removing redundant methods and keeping only essential attributes.
-
lib/features/edit_ad/edit_ad_screen.dart:
- Refactored to use the newly structured
EditAdForm
, eliminating the controller dependency and simplifying the form handling.
- Refactored to use the newly structured
-
lib/features/edit_ad/widgets/ad_form.dart:
- Renamed to
edit_ad_form.dart
. - Reworked form fields to use dedicated controllers (
nameController
,descriptionController
, etc.). - Implemented proper disposal of controllers to prevent memory leaks.
- Renamed to
-
lib/features/edit_ad/widgets/horizontal_image_gallery.dart:
- Updated the icon to
Symbols.add_a_photo_rounded
for a more modern UI.
- Updated the icon to
-
lib/features/edit_boardgame/edit_boardgame_screen.dart:
- Updated floating action buttons (
FAB
) to useOverflowBar
instead of individual FABs for a better user interface.
- Updated floating action buttons (
-
Refactor Controllers and Stores:
- Created separate controllers (
EditAdFormController
,ImageListController
) and stores (EditAdFormStore
,ImageListStore
) for better separation of concerns. - Moved image handling logic to
ImageListController
and store state toImageListStore
. - Introduced
EditAdFormController
andEditAdFormStore
for managing form data and state within theEditAd
feature.
- Created separate controllers (
-
lib/repository/parse_server/common/parse_to_model.dart:
- Updated references from
mechanicsId
tomechanicsPSIds
for consistency.
- Updated references from
-
lib/repository/parse_server/ps_ad_repository.dart:
- Modified the
save
andupdate
methods to usemechanicsPSIds
instead ofmechanicsId
.
- Modified the
This refactoring enhances modularity, making the codebase more organized and maintainable. Controllers and stores have been separated for better control and state management, which also helps in reducing side effects and improving testing capabilities.
This commit refactors the EditAd
feature, introducing improvements in code structure and component reuse, as well as updating validation logic for better error handling and consistency in form management. Additionally, minor UI improvements have been made to enhance the user experience.
-
lib/features/edit_ad/edit_ad_controller.dart:
- Removed unnecessary
dispose()
method, as it was empty and redundant.
- Removed unnecessary
-
lib/features/edit_ad/edit_ad_screen.dart:
- Updated import from
widgets/ad_form.dart
towidgets/edit_ad_form.dart
. - Removed
dispose()
call onctrl
since the controller no longer requires disposal.
- Updated import from
-
lib/features/edit_ad/edit_ad_store.dart:
- Updated
_validateDescription()
,_validateAddress()
, and_validatePrice()
methods to ensure values are not null before validating their lengths. - Added a
resetStore()
method to reset all form validation error messages and image length.
- Updated
-
lib/features/edit_ad/widgets/ad_form.dart:
- Renamed file to
edit_ad_form.dart
and updated the class toEditAdForm
for better naming consistency. - Added controllers for form fields (
nameController
,descriptionController
, etc.) to manage state directly within the form. - Implemented
dispose()
method to properly dispose of all controllers to prevent memory leaks. - Updated form fields to use respective controllers for better control over user input.
- Renamed file to
-
lib/features/edit_ad/widgets/horizontal_image_gallery.dart:
- Updated the icon in the "add image" button to use
Icons.add_a_photo_rounded
for a more modern appearance. - Removed the "+ inserir" text from the button for a cleaner UI.
- Updated the icon in the "add image" button to use
-
lib/features/signup/signup_screen.dart:
- Simplified the
_navLogin()
method by consolidating theNavigator.pushNamed()
call into a single line for readability.
- Simplified the
This commit enhances the maintainability of the EditAd
feature by restructuring its components for consistency and eliminating redundancy. The improvements in validation logic ensure robust error handling, while the added controllers in EditAdForm
improve input management. The minor UI adjustments provide a more streamlined user experience.
This commit refactors the code to enhance modularity, consistency, and manageability by introducing a new store class, renaming files, and updating controllers to remove redundancy. The changes focus on improving the architecture, including the management of state and dependency injection across various components.
-
lib/common/singletons/current_user.dart:
- Updated the import path for
IUserRepository
from'iuser_repository.dart'
to'i_user_repository.dart'
for better readability and consistency.
- Updated the import path for
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart:
- Replaced the use of
BasicController
withShopController
for better specificity in managing shop-related state and logic.
- Replaced the use of
-
lib/features/favorites/favorites_screen.dart:
- Updated the import paths for
ShopController
andShopStore
. - Replaced
FavoritesController
withShopController
and addedShopStore
to manage state. - Updated
AnimatedBuilder
to usestore.state
instead ofctrl
.
- Updated the import paths for
-
lib/features/my_data/my_data_controller.dart:
- Updated the import path for
IUserRepository
.
- Updated the import path for
-
lib/features/payment_web_view/payment_web_view_page.dart:
- Renamed the file to
payment_page.dart
. - Renamed
PaymentWebViewPage
class toPaymentPage
and added a static route name for easier navigation.
- Renamed the file to
-
lib/features/shop/shop_controller.dart:
- Removed inheritance from
BasicController
. - Replaced
BasicState
management withShopStore
to handle the loading, success, and error states. - Consolidated and simplified methods for managing page title and shop data.
- Removed inheritance from
-
lib/features/shop/shop_screen.dart:
- Added
ShopStore
to manage the state ofShopController
. - Replaced
AnimatedBuilder
withListenableBuilder
to use the store state directly. - Updated methods to use
store
for state management and clean disposal.
- Added
-
lib/features/shop/shop_store.dart:
- Created a new
ShopStore
class to encapsulate state management for the shop feature. - Added methods to handle page title, loading, and success/error state transitions.
- Created a new
-
lib/features/signin/signin_controller.dart & lib/features/signup/signup_controller.dart:
- Updated the import paths for
IUserRepository
for consistency.
- Updated the import paths for
-
lib/get_it.dart:
- Removed
ShopController
from dependency registration to align with its updated instantiation in individual screens. - Updated repository interface import paths to maintain consistency.
- Updated repository class names (
PSUserRepository
andPSMechanicsRepository
) for better readability.
- Removed
-
lib/manager/mechanics_manager.dart:
- Updated the import path for
IMechanicRepository
.
- Updated the import path for
-
lib/my_material_app.dart:
- Added routing for
PaymentPage
to facilitate navigation by passing apreferenceId
.
- Added routing for
-
lib/repository/interfaces/imechanic_repository.dart & iuser_repository.dart:
- Renamed files to
i_mechanic_repository.dart
andi_user_repository.dart
for improved consistency in naming conventions.
- Renamed files to
-
lib/repository/parse_server/ps_mechanics_repository.dart & ps_user_repository.dart:
- Renamed classes to
PSMechanicsRepository
andPSUserRepository
to maintain consistency with other repository class names. - Updated the import paths for the respective interfaces.
- Renamed classes to
These changes refactor the codebase to improve maintainability, modularity, and state management. The introduction of ShopStore
decouples state handling from the controller, allowing for a cleaner separation of concerns. The file renaming and dependency registration changes improve readability and align the project structure with best practices for naming conventions. This refactoring paves the way for easier scalability and enhanced consistency across the codebase.
This commit introduces a new payment integration module using Mercado Pago Bricks and WebView, along with various updates to existing code and new functionalities. The focus of this update is to enhance the payment flow, improve error handling, and add new features for better user experience in managing payments and mechanics checks.
-
docs/MP_pagamentos.md:
- Added new documentation detailing the integration of Mercado Pago Bricks using Parse Server Cloud Code and WebView in Flutter.
- Explained the general integration strategy, usage of specific Bricks, and considerations for security and implementation.
-
lib/common/abstracts/data_result.dart:
- Added a new
TimeoutFailure
class to represent a failure due to timeout when making API calls.
- Added a new
-
lib/common/models/payment.dart:
- Introduced a new
PaymentModel
class containing fields foramount
,description
, andquantity
to encapsulate payment information.
- Introduced a new
-
lib/features/check_mechanics/check_page.dart:
- Updated app bar title from
'Restaurar Mecânicas'
to'Verificar Mecânicas'
. - Added
dispose()
method to properly dispose ofstore
when the page is destroyed.
- Updated app bar title from
-
lib/features/check_mechanics/check_store.dart:
- Added
count.dispose()
to thedispose()
method to ensure proper cleanup of resources.
- Added
-
lib/features/my_account/widgets/admin_hooks.dart:
- Updated title text from
'Restaurar Mecânicas'
to'Verificar Mecânicas'
.
- Updated title text from
-
lib/features/payment_web_view/payment_controller.dart:
- Added a new
PaymentController
class to manage the interaction with WebView for payment processing. - Set up navigation delegates to handle page progress, resource errors, and control navigation to ensure a secure and user-friendly payment experience.
- Added a new
-
lib/features/payment_web_view/payment_store.dart:
- Added a new
PaymentStore
class that extendsStateStore
to manage state during payment processing in thePaymentWebView
.
- Added a new
-
lib/features/payment_web_view/payment_web_view_page.dart:
- Created a new
PaymentWebViewPage
widget to handle displaying the payment process using WebView. - Utilized
ValueListenableBuilder
to manage loading, success, and error states during payment.
- Created a new
-
lib/services/payment/payment_service.dart:
- Added a new
PaymentService
class to handle interactions with the Parse Server's Cloud Code for payment preferences. - Implemented
getPreferenceId()
method to request a preference ID from the Parse Cloud Function, with proper error handling, including timeout.
- Added a new
-
pubspec.yaml & pubspec.lock:
- Added
webview_flutter
package version^4.10.0
to integrate WebView for the payment functionality.
- Added
This commit significantly enhances the payment integration flow by utilizing Mercado Pago Bricks and a WebView approach for a secure and user-friendly experience. The added abstractions for payment models, services, and state management provide a more modular and maintainable structure for handling payments. Furthermore, proper error handling mechanisms were introduced to improve the robustness of the codebase during API interactions.
This commit brings several updates and enhancements to the application, focusing on new features, bug fixes, and improvements to maintainability, UI consistency, and underlying infrastructure changes.
-
lib/common/models/user.dart:
- Corrected a typo: renamed
createAt
tocreatedAt
for consistency. - Refactored the
UserModel
class, replacing thecopyFromUserModel
method withcopyWith
to make object modifications more flexible and idiomatic.
- Corrected a typo: renamed
-
lib/components/others_widgets/state_count_loading_message.dart:
- Added a new widget called
StateCountLoadingMessage
for displaying loading progress with a counter, improving the user feedback during lengthy operations.
- Added a new widget called
-
lib/features/address/address_controller.dart:
- Updated the
selectAddress
method to toggle selection when the address is already selected. - Fixed a typo in method name: corrected
seSelectedAddressName
tosetSelectedAddressName
.
- Updated the
-
lib/features/address/address_screen.dart:
- Replaced some material icons with
MaterialSymbols
for consistency. - Refactored
AnimatedBuilder
toListenableBuilder
to simplify state listening. - Updated the background color of selected address cards for better UI distinction.
- Replaced some material icons with
-
lib/features/address/address_store.dart:
- Fixed typo in method name: corrected
seSelectedAddressName
tosetSelectedAddressName
.
- Fixed typo in method name: corrected
-
lib/features/check_mechanics/check_controller.dart, lib/features/check_mechanics/check_page.dart, lib/features/check_mechanics/check_store.dart:
- Added new classes:
CheckController
,CheckPage
, andCheckStore
to manage the process of checking and restoring game mechanics data. - Implemented methods for comparing local mechanics data against the server, providing error handling and progress tracking.
- Added new classes:
-
lib/features/my_account/my_account_screen.dart:
- Adjusted the order of widgets: duplicated
AdminHooks
to conditionally render based on user type. - Improved widget alignment for better user experience.
- Adjusted the order of widgets: duplicated
-
lib/features/my_account/widgets/admin_hooks.dart:
- Added a new option "Restore Mechanics" for admins, linking to the newly added
CheckPage
.
- Added a new option "Restore Mechanics" for admins, linking to the newly added
-
lib/features/my_account/widgets/config_hooks.dart:
- Updated the labels for configuration items to be more concise.
-
lib/features/product/product_screen.dart:
- Updated property references to match the new naming convention (
createdAt
).
- Updated property references to match the new naming convention (
-
lib/features/signin/signin_screen.dart:
- Changed
routeName
from/login
to/signin
to better reflect the purpose of the page.
- Changed
-
lib/get_it.dart:
- Registered the
IMechanicRepository
dependency, mapping it toParseServerMechanicsRepository
. - Enhanced dependency injection setup to align with new architecture changes.
- Registered the
-
lib/manager/boardgames_manager.dart:
- Replaced calls to
BGNamesRepository
withSqliteBGNamesRepository
to enhance repository naming clarity.
- Replaced calls to
-
lib/manager/mechanics_manager.dart:
- Added support for
IMechanicRepository
using dependency injection viagetIt
. - Implemented additional methods for managing mechanics (
update
,get
) to handle various CRUD operations.
- Added support for
-
lib/my_material_app.dart:
- Added route for
CheckPage
.
- Added route for
-
lib/repository/interfaces/imechanic_repository.dart:
- Created a new interface
IMechanicRepository
defining common methods for mechanic data operations.
- Created a new interface
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Implemented
IMechanicRepository
. - Added more robust error handling and refactored CRUD methods to align with the repository pattern.
- Implemented
-
lib/repository/sqlite/bg_names_repository.dart:
- Renamed class from
BGNamesRepository
toSqliteBGNamesRepository
for clarity.
- Renamed class from
-
lib/repository/sqlite/mechanic_repository.dart:
- Renamed class from
MechanicRepository
toSqliteMechanicRepository
to differentiate between repositories more clearly.
- Renamed class from
-
pubspec.yaml, pubspec.lock:
- Updated dependencies (
get_it
,flutter_dotenv
,flutter_lints
) to the latest versions. - Added a new dependency:
material_symbols_icons
for a consistent UI icon set.
- Updated dependencies (
This commit significantly enhances the application's functionality by adding new features, improving user experience, and refining the internal architecture for better maintainability and extensibility. Additionally, repository patterns and dependency management were refactored to provide a cleaner and more scalable codebase.
This commit adds new functionalities and enhancements to improve user experience, specifically focused on user password recovery and UI improvements for error handling. Additionally, the logic for managing server settings in the main application has been updated.
-
lib/components/others_widgets/state_error_message.dart:
- Added an optional
icon
parameter to theStateErrorMessage
widget to allow customized icons for different error messages. - Modified the widget layout to make it more flexible, including text alignment and padding adjustments.
- Added an optional
-
lib/features/signin/signin_controller.dart:
- Introduced an enum
RecoverStatus
to represent different outcomes of password recovery operations. - Added a
recoverPassword
method to handle password reset requests using theuserRepository
.
- Introduced an enum
-
lib/features/signin/signin_screen.dart:
- Updated the
_navLostPassword
method to use the newrecoverPassword
functionality. - Added a dialog to provide feedback to the user when a password recovery email is sent.
- Updated the
-
lib/main.dart:
- Changed the
isLocalServer
constant fromtrue
tofalse
to switch the server configuration for production use.
- Changed the
-
lib/repository/interfaces/iuser_repository.dart:
- Added a new method
resetPassword(String email)
to theIUserRepository
interface for initiating password reset requests.
- Added a new method
-
lib/repository/parse_server/ps_user_repository.dart:
- Implemented the
resetPassword
method inParseServerUserRepository
to handle password reset requests via Parse Server. - Updated error handling in multiple methods to improve log messages for easier debugging.
- Implemented the
These changes enhance the user experience by adding password recovery functionality and allowing customized error messages. Additionally, the application has been prepared for production use by switching the server setting. Improved error handling provides better support for debugging issues.
This commit introduces significant changes across various parts of the codebase, primarily focusing on refactoring the user management logic, implementing a new repository interface, and improving error handling for user operations. These changes enhance code modularity, testability, and readability by decoupling user-related operations from their Parse Server-specific implementations.
-
lib/common/abstracts/data_result.dart:
- Updated the
Failure
abstract class to include a newcode
field to represent error codes. - Modified
GenericFailure
andAPIFailure
classes to use named parameters formessage
andcode
.
- Updated the
-
lib/common/parse_server/errors_mensages.dart:
- Refactored the
ParserServerErrors
class to use an integer error code instead of parsing a string. - Removed the
_getErroCode
function, simplifying error message handling.
- Refactored the
-
lib/common/singletons/current_user.dart:
- Added dependency injection for
IUserRepository
to manage user-related actions. - Updated
init
andlogout
methods to useuserRepository
instead ofPSUserRepository
.
- Added dependency injection for
-
lib/common/others/enums.dart renamed to lib/common/state_store/state_store.dart:
- Added a new
StateStore
class to encapsulate the logic for managing state changes withValueNotifier
.
- Added a new
-
lib/features/address/address_controller.dart:
- Updated methods to use the
StateStore
class instead of settingPageState
directly.
- Updated methods to use the
-
lib/features/address/address_store.dart:
- Refactored
AddressStore
to extendStateStore
, inheriting its state management logic.
- Refactored
-
lib/features/boardgame/boardgame_store.dart:
- Refactored
BoardgameStore
to extendStateStore
, simplifying state management.
- Refactored
-
lib/features/edit_ad/edit_ad_controller.dart:
- Replaced individual controllers (e.g.,
nameController
,descriptionController
) with fields in thestore
object for better encapsulation.
- Replaced individual controllers (e.g.,
-
lib/features/edit_ad/edit_ad_screen.dart:
- Refactored validation checks to use
store.isValid
instead of form validation logic. - Replaced
ListenableBuilder
withValueListenableBuilder
forimagesLength
and validation state.
- Refactored validation checks to use
-
lib/features/edit_ad/edit_ad_store.dart:
- Refactored
EditAdStore
to use new validation and state management fields, includingerrorName
,errorDescription
, etc., to handle error messages.
- Refactored
-
lib/features/signup/signup_controller.dart and lib/features/signup/signup_store.dart:
- Integrated
IUserRepository
for signing up users, replacing the direct dependency onPSUserRepository
.
- Integrated
-
lib/get_it.dart:
- Registered
IUserRepository
as a dependency usingParseServerUserRepository
.
- Registered
-
lib/repository/interfaces/iuser_repository.dart (new file):
- Created an interface for user-related operations to abstract the data source, allowing for easier future changes.
-
lib/repository/parse_server/ps_user_repository.dart:
- Implemented
IUserRepository
inParseServerUserRepository
. - Added detailed error handling with the new
ParserServerErrors
class. - Added
_handleError
function to centralize error handling and logging.
- Implemented
These changes decouple user management from the specific implementation of Parse Server, making the code more modular and maintainable. The use of IUserRepository
improves testability and flexibility for future backend changes, while the enhanced state management ensures better user experience and error handling.
Refactor: Rename Login Feature to SignIn and Implement SignInStore for State Management
This commit introduces major refactoring by renaming the existing login feature to signin, in order to align naming conventions with other features. The changes include modifications in controllers, screens, widgets, and routes. The state management previously handled by ChangeNotifier has also been migrated to use SignInStore, enhancing separation of concerns and improving maintainability.
-
Renaming Files and Classes: Login to SignIn
- Renamed the login feature directory and relevant files (e.g.,
login_controller.dart
tosignin_controller.dart
,login_screen.dart
tosignin_screen.dart
). - Updated class names and imports across the application to reflect the new naming scheme (e.g.,
LoginController
toSignInController
,LoginScreen
toSignInScreen
).
- Renamed the login feature directory and relevant files (e.g.,
-
Deleted Legacy State Management Classes
- Removed
login_state.dart
that contained old state definitions likeLoginStateInitial
,LoginStateLoading
, etc. - Updated state handling from using abstract classes to using the new store-based approach.
- Removed
-
Introduction of
SignInStore
- Created a new
signin_store.dart
file for state management. - Implemented
SignInStore
usingValueNotifier
to manage state (PageState
) and validation errors (e.g.,errorEmail
,errorPassword
). - Integrated
SignInStore
withinSignInController
for streamlined state management.
- Created a new
-
Simplified Form Widgets
- Removed
LoginForm
widget and createdSignInForm
which now usesSignInStore
for validation and state handling. SignInForm
is now directly responsible for managing the user input fields (email
andpassword
) throughValueListenableBuilder
for reactive UI updates.
- Removed
-
Route Updates
- Replaced all references to
LoginScreen.routeName
withSignInScreen.routeName
throughout the application. - Updated the navigation logic in
shop_screen.dart
andmy_material_app.dart
accordingly.
- Replaced all references to
-
Miscellaneous Cleanup
- Removed redundant focus nodes and controllers from
SignupController
, simplifying the code by directly leveraging theSignupStore
. - Adjusted the signup workflow to ensure a smoother user experience, reflecting the new store-based state management paradigm.
- Removed redundant focus nodes and controllers from
This refactoring aligns the feature names, improves readability, and introduces a more scalable state management approach using stores. The change also unifies the naming convention with other parts of the project, thereby improving code consistency and maintainability moving forward.
This commit introduces several changes across multiple files, focusing on improvements in code organization, modularity, and state management. Notable updates include the implementation of a new state management approach with stores replacing old states, and adjustments to enhance the maintainability and consistency of the codebase.
-
docker-compose.yml:
- Added environment variables to support Parse Server configuration, enabling better parameter control for local and remote setups.
-
lib/common/validators/validators.dart:
- Renamed to
lib/common/others/validators.dart
to better organize utility files. - Made
Validator
constructor private to prevent instantiation.
- Renamed to
-
lib/components/form_fields/custom_form_field.dart:
- Added
onChanged
andonFieldSubmitted
callbacks to allow more flexible interactions with the form fields. - Updated the implementation to use these new callbacks for cleaner code.
- Added
-
lib/components/form_fields/custom_mask_field.dart (new file):
- Introduced a new
CustomMaskField
widget to handle input fields with masked text, supporting better user input control.
- Introduced a new
-
lib/components/form_fields/password_form_field.dart:
- Updated to use optional controllers and new callbacks (
onChanged
,onFieldSubmitted
) for more modular code. - Replaced
AnimatedBuilder
withValueListenableBuilder
for better performance and readability.
- Updated to use optional controllers and new callbacks (
-
lib/features/boardgame/boardgame_controller.dart:
- Replaced
BoardgameState
withBoardgameStore
for state management. - Removed the
ChangeNotifier
inheritance to delegate state handling toBoardgameStore
.
- Replaced
-
lib/features/boardgame/boardgame_screen.dart:
- Updated to use
BoardgameStore
for managing UI state instead ofBoardgameState
.
- Updated to use
-
lib/features/boardgame/boardgame_state.dart (deleted file):
- Removed obsolete state class in favor of a new store-based state management approach.
-
lib/features/boardgame/boardgame_store.dart (new file):
- Introduced
BoardgameStore
to replace the previous state-based approach, leveragingValueNotifier
for state handling.
- Introduced
-
lib/features/edit_ad/edit_ad_controller.dart:
- Transitioned to use
EditAdStore
for state management, removing the need forChangeNotifier
. - Removed redundant
ValueNotifier
properties and replaced them with corresponding store methods.
- Transitioned to use
-
lib/features/edit_ad/edit_ad_state.dart (deleted file):
- Deleted the obsolete state file, consolidating all state handling in the new
EditAdStore
.
- Deleted the obsolete state file, consolidating all state handling in the new
-
lib/features/edit_ad/edit_ad_store.dart (new file):
- Added
EditAdStore
for better separation of concerns and modular state management.
- Added
-
lib/features/signup/signup_controller.dart:
- Updated to use
SignupStore
instead ofSignUpState
for handling UI and data states.
- Updated to use
-
lib/features/signup/signup_state.dart (deleted file):
- Removed
SignUpState
in favor ofSignupStore
.
- Removed
-
lib/features/signup/signup_store.dart (new file):
- Introduced
SignupStore
for more effective state handling in the signup flow, with specific error fields for better user feedback.
- Introduced
-
lib/get_it.dart:
- Added
ParseServerService
to the service locator for better control over Parse Server initialization.
- Added
-
lib/main.dart:
- Replaced direct Parse Server initialization with a call to
ParseServerService
for a more modular and testable setup.
- Replaced direct Parse Server initialization with a call to
-
lib/services/parse_server_server.dart:
- Refactored from
parse_server_location.dart
to include the initialization logic of Parse Server, enhancing modularity.
- Refactored from
These changes improve the overall modularity and maintainability of the codebase by adopting store-based state management, reducing redundancy, and enhancing the organization of components and services. The new approach simplifies future updates and makes the application more scalable.
This commit updates the Android build configurations, refactors existing classes for better maintainability, and improves code consistency across the application. The changes involve upgrading Gradle versions, refactoring server-related settings, and transitioning the state management approach for the address feature.
-
android/app/build.gradle:
- Updated
compileSdk
,minSdk
, andtargetSdk
to version 34 for compatibility with newer Android features.
- Updated
-
android/build.gradle:
- Added Kotlin version 1.8.10 and updated the build script dependencies.
- Added buildscript configurations to use Android Gradle plugin version 8.0.2.
-
android/gradle/wrapper/gradle-wrapper.properties:
- Upgraded Gradle distribution to version 8.1.1 for compatibility with the new build script.
-
lib/common/abstracts/data_result.dart:
- Added copyright and licensing information.
-
lib/features/address/address_state.dart → lib/common/others/enums.dart:
- Refactored
AddressState
classes into a unifiedPageState
enum to simplify state management.
- Refactored
-
lib/common/settings/back4app_server.dart:
- Deleted
back4app_server.dart
as the Back4App configuration has been refactored for better modularity.
- Deleted
-
lib/common/settings/local_server.dart → lib/common/settings/parse_server_location.dart:
- Renamed
LocalServer
toParseServerLocation
to improve clarity on the server role.
- Renamed
-
lib/features/address/address_controller.dart:
- Replaced the
AddressState
usage with the newPageState
enum. - Removed
ChangeNotifier
inheritance and usedAddressStore
for managing state.
- Replaced the
-
lib/features/address/address_screen.dart:
- Modified to use
AddressStore
for state management instead of relying onChangeNotifier
directly.
- Modified to use
-
lib/features/address/address_store.dart:
- Added new
AddressStore
class to manage the state of address operations, including state tracking and error handling.
- lib/features/shop/shop_screen.dart:
- Added a spacing line for readability.
- lib/main.dart:
- Replaced
LocalServer
references withParseServerLocation
to reflect the updated server settings class.
- lib/manager/boardgames_manager.dart:
- Updated the server configuration references from
LocalServer
toParseServerLocation
to maintain consistency across the codebase.
- pubspec.lock:
- Updated the
vm_service
package to version 14.2.5.
This refactor improves the overall code organization, especially around server configurations and state management. The upgrade of Android build settings ensures compatibility with newer Android features, while the use of the AddressStore
enhances state handling in the address feature, contributing to a more maintainable and consistent codebase.
Updated Database and Error Handling Improvements
-
assets/data/bgBazzar.db
- Updated the binary file
bgBazzar.db
to the latest version.
- Updated the binary file
-
lib/common/singletons/app_settings.dart
- Updated
_localDBVersion
from1000
to1001
to match the new database version.
- Updated
-
lib/components/others_widgets/bottom_message.dart
- Created a new widget
BottomMessage
to display messages at the bottom of the screen, compatible with both Android and iOS platforms.
- Created a new widget
-
lib/features/address/address_controller.dart
- Modified the
moveAdsAddressTo
method to handle errors usingDataResult
. - Added error handling to check for failures and throw appropriate exceptions with detailed error messages.
- Modified the
-
lib/features/address/address_screen.dart
- Improved error handling in
_removeAddress
method by replacing a placeholder exception with a more descriptive error message. - Updated UI elements such as
FloatingActionButton
to improve user experience and make the interface more intuitive.
- Improved error handling in
-
lib/features/boardgame/boardgame_screen.dart
- Added additional
FloatingActionButton
options for better navigation and action handling within the board game screen.
- Added additional
-
lib/features/boardgame/widgets/bg_info_card.dart
- Updated the
BGInfoCard
widget to display additional game mechanics using data fromMechanicsManager
.
- Updated the
-
lib/features/edit_ad/edit_ad_controller.dart
- Enhanced error handling for
update
andsave
methods by implementingDataResult
to handle potential failures. - Updated methods to include descriptive error messages for logging and debugging purposes.
- Enhanced error handling for
-
lib/features/edit_ad/edit_ad_screen.dart
- Added a new
IconButton
to the AppBar to allow for printing or debugging ads directly from the UI. - Updated UI texts to be more user-friendly.
- Added a new
-
lib/features/edit_ad/widgets/horizontal_image_gallery.dart
- Added error handling for unsupported platforms when capturing images from the camera.
- Updated to use the new
BottomMessage
widget to display error messages when necessary.
-
lib/features/mechanics/mechanics_screen.dart
- Simplified UI by replacing the
PopupMenuButton
with individualIconButton
s for toggling descriptions and selections. - Streamlined user interactions for a cleaner and more intuitive experience.
- Simplified UI by replacing the
-
lib/features/my_ads/my_ads_controller.dart
- Improved error handling in
_getAds
and_getMoreAds
methods by checking for failures and adding descriptive exceptions. - Updated methods to ensure data integrity and better error reporting.
- Improved error handling in
-
lib/features/my_ads/my_ads_screen.dart
- Updated the icon and text display when no ads are found to improve user feedback.
-
lib/features/product/product_screen.dart
- Refactored to use a local variable
ad
for easier access and code readability. - Integrated a new
GameData
widget to display detailed game information.
- Refactored to use a local variable
-
lib/features/product/widgets/description_product.dart
- Updated subtitle text to provide a more descriptive label for the product description.
-
lib/features/product/widgets/game_data.dart
- Added a new widget
GameData
to display detailed information about board games, such as player count, playtime, recommended age, designers, and artists.
- Added a new widget
-
lib/features/shop/shop_controller.dart
- Enhanced error handling in
_getAds
and_getMoreAds
methods by implementingDataResult
and descriptive error messages.
- Enhanced error handling in
-
lib/manager/mechanics_manager.dart
- Added logic to handle missing mechanics by fetching them from the server and adding them to the local repository.
- Improved logging messages for better traceability.
-
lib/repository/parse_server/ps_ad_repository.dart
- Fixed the method to return an empty list instead of throwing an exception when no ads are found, improving the flow and error handling.
-
lib/repository/parse_server/ps_mechanics_repository.dart
- Added a new method
getById
to fetch a mechanic by its ID, improving data retrieval and management capabilities. - Improved error handling to provide more specific exceptions and logs.
- Added a new method
-
lib/repository/sqlite/mechanic_repository.dart
- Updated the
add
method to returnnull
instead of throwing an exception when adding a mechanic fails, improving error handling and resilience.
- Updated the
-
lib/store/constants/migration_sql_scripts.dart
- Added a new constant
localDBVersion
set to1001
to reflect the updated database schema. - Added a
FIXME
comment to check database version consistency.
- Added a new constant
-
pubspec.yaml
- Updated the project version from
0.6.18+47
to0.6.19+48
to reflect the new changes and improvements.
- Updated the project version from
These changes aim to enhance the application's error handling, improve user experience, and ensure data consistency and reliability. Feel free to provide additional diffs or specify further adjustments if needed!
In this commit, we introduced several new assets and made significant improvements to error handling and data management across the application. The primary objective was to enhance user experience by providing more robust error handling, consistent image loading, and better structured error messages. The changes include adding new image assets, refactoring image handling logic into a new ImageView widget, and updating various controllers and repositories to utilize the DataResult type for improved error management. These updates are essential for increasing the stability, maintainability, and scalability of the application.
-
assets/images/image_not_found.png
- Added a new image file to represent missing images.
-
assets/images/image_witout.png
- Added a new image file to represent images without a specific designation.
-
assets/svg/image_error.svg
- Added a new SVG file for an error image.
- Defined SVG properties such as height, width, fill color, and style attributes.
-
assets/svg/image_not_found.svg
- Added a new SVG file to represent the "image not found" scenario.
- Defined SVG properties similar to the
image_error.svg
.
-
assets/svg/image_without.svg
- Added a new SVG file for a generic "image without" representation.
- Defined SVG properties like height, width, fill color, and style attributes.
-
lib/common/abstracts/data_result.dart
- Modified the
Failure
class to include an optionalmessage
parameter. - Updated
GenericFailure
andAPIFailure
classes to handle themessage
parameter.
- Modified the
-
lib/components/custon_field_controllers/numeric_edit_controller.dart
- Added a line to set the text representation of the numeric value in the setter
numericValue
.
- Added a line to set the text representation of the numeric value in the setter
-
lib/components/others_widgets/image_view.dart
- Added a new widget
ImageView
to handle image display with support for assets, network images, and files.
- Added a new widget
-
lib/features/address/address_screen.dart
- Updated the
_removeAddress
method to handle error scenarios more gracefully usingDataResult
.
- Updated the
-
lib/features/boardgame/boardgame_controller.dart
- Refactored
getBoardgameSelected
method to return aDataResult
type for more structured error handling.
- Refactored
-
lib/features/boardgame/boardgame_screen.dart
- Updated methods
_editBoardgame
and_viewBoardgame
to handle failures properly using exceptions.
- Updated methods
-
lib/features/boardgame/widgets/bg_info_card.dart
- Replaced direct image loading with the new
ImageView
widget for consistent error handling.
- Replaced direct image loading with the new
-
lib/features/edit_ad/edit_ad_controller.dart
- Refactored the
setBgInfo
method to handle potential failures with structured error messages.
- Refactored the
-
lib/features/edit_boardgame/edit_boardgame_controller.dart
- Updated
getBgInfo
andsaveBoardgame
methods to returnDataResult
types, ensuring better error management.
- Updated
-
lib/features/edit_boardgame/edit_boardgame_screen.dart
- Replaced manual image loading logic with the new
ImageView
widget.
- Replaced manual image loading logic with the new
-
lib/features/my_ads/my_ads_controller.dart
- Improved error handling by using
DataResult
types in methods like_getAds
,_getMoreAds
, andupdateStatus
.
- Improved error handling by using
-
lib/features/shop/shop_controller.dart
- Enhanced error handling in methods
_getAds
and_getMoreAds
using theDataResult
type.
- Enhanced error handling in methods
-
lib/manager/boardgames_manager.dart
- Refactored methods such as
getBGNames
,save
, andupdate
to utilizeDataResult
for more robust error handling.
- Refactored methods such as
-
lib/repository/parse_server/ps_ad_repository.dart
- Updated various methods (
moveAdsAddressTo
,adsInAddress
,updateStatus
, etc.) to returnDataResult
types for improved error management.
- Updated various methods (
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Refactored methods like
save
,update
,getById
, andgetNames
to useDataResult
for better error control.
- Refactored methods like
-
pubspec.yaml
- Added new asset paths for
assets/images/
.
- Added new asset paths for
-
test/common/abstracts/data_result_test.dart
- Updated unit tests to accommodate changes in
DataResult
handling and ensure tests cover both success and failure scenarios.
- Updated unit tests to accommodate changes in
-
Improved Error Handling and Messaging
- Enhanced several methods across different classes to return
DataResult
types instead of raw data or void, allowing for structured error management and more informative error messages. This approach improves the application's stability and makes debugging more straightforward.
- Enhanced several methods across different classes to return
-
Refactor of Image Handling
- Introduced the
ImageView
widget to centralize and standardize image loading across the app. This widget accommodates different image sources (assets, network, and file) and provides a fallback mechanism using placeholder images when the desired image is not found or fails to load.
- Introduced the
-
Asset Management
- Added several new assets, including SVG and PNG images, to handle scenarios where images are not found or an error occurs. This addition aims to enhance the visual feedback for users, ensuring they understand when an image fails to load or is missing.
-
DataResult Implementation
- Implemented a consistent
DataResult
type across multiple repositories and managers to encapsulate both success and failure states. This implementation allows for more predictable function outputs and enables developers to handle errors uniformly.
- Implemented a consistent
-
Test Coverage Updates
- Modified the unit tests in
data_result_test.dart
to reflect the changes made to theDataResult
class and its usage across the application. These updates ensure that the test cases validate both the success and failure paths correctly, maintaining high test coverage and reliability.
- Modified the unit tests in
-
Bug Fixes and Minor Tweaks
- Fixed minor bugs related to the old image handling logic by replacing it with the new
ImageView
component. - Adjusted import paths and removed redundant imports to streamline codebase organization and reduce compile-time dependencies.
- Fixed minor bugs related to the old image handling logic by replacing it with the new
These comprehensive updates significantly improve the application's overall stability and user experience by providing better error management and consistent asset handling. The refactoring efforts, particularly around the use of the DataResult type and the introduction of a centralized ImageView widget, ensure more predictable behavior and easier debugging. Moving forward, adopting these patterns across the codebase will help maintain consistency and reduce the likelihood of errors. This commit sets the stage for further enhancements, ensuring a robust foundation for future development.
Update ShoppingHooks with FavoritesScreen integration and minor visual enhancements. Files Modified:
lib/features/my_account/widgets/shopping_hooks.dart
- Added: Import statement for
FavoritesScreen
. - Modified: Updated
TitleProduct
widget in the ShoppingHooks with the theme's primary color for consistency. - Updated: The ListTile for 'Favoritos' now navigates to the
FavoritesScreen
when tapped, usingNavigator.pushNamed
. The color of the icon and text has been set to the primary color for visual coherence.
- Added: Import statement for
This update introduces navigation to the FavoritesScreen
from the ShoppingHooks and enhances the visual consistency by applying the primary theme color to specific UI elements. Additionally, the project version has been incremented to ensure proper version control.
Update: Improvements and Refactoring Across Multiple Components. Files and Changes:
-
lib/common/utils/utils.dart
- Added
normalizeFileName
method to standardize filenames by removing accents, replacing spaces with underscores, and removing invalid characters. - Introduced
_removeDiacritics
method to handle accent removal for various special characters.
- Added
-
lib/components/others_widgets/spin_box_field.dart
- Enhanced initialization logic to ensure the correct value is set in the
NumericEditController
when it's initially zero but should reflect a non-zero value.
- Enhanced initialization logic to ensure the correct value is set in the
-
lib/features/edit_boardgame/edit_boardgame_screen.dart
- Added floating action buttons for saving and canceling operations.
- Refined UI layout to improve user experience, including the addition of a save and cancel action bar at the bottom.
-
lib/features/mechanics/mechanics_controller.dart
- Refactored to use private fields for better encapsulation.
- Added
selectMechByName
method for selecting a mechanic by its name. - Introduced
toogleDescription
method to show or hide mechanic descriptions. - Replaced redundant state management with simplified boolean flags.
-
lib/features/mechanics/mechanics_screen.dart
- Updated the UI to include search functionality with the new
SearchMechsDelegate
. - Replaced old mechanics selection logic with a more robust implementation that includes options for showing descriptions and toggling selected items.
- Updated the UI to include search functionality with the new
-
lib/features/mechanics/widgets/search_mechs_delegate.dart
- Introduced a new widget to provide a search interface for mechanics, allowing for case-sensitive and insensitive searches.
-
lib/features/mechanics/widgets/show_all_mechs.dart
- Updated to handle displaying all mechanics with options to hide descriptions and highlight selected items.
-
lib/features/mechanics/widgets/show_selected_mechs.dart
->lib/features/mechanics/widgets/show_only_selected_mechs.dart
- Renamed file and updated logic to better reflect the functionality of displaying only selected mechanics.
-
lib/manager/boardgames_manager.dart
- Added
normalizeFileName
usage when saving board games to ensure filenames are correctly formatted. - Introduced
_sortingBGNames
method to keep the list of board games sorted alphabetically by name after any modification.
- Added
-
lib/manager/mechanics_manager.dart
- Added
mechanicOfName
method to retrieve mechanics by their name. - Updated internal logic to ensure consistency with other components.
- Added
-
lib/repository/parse_server/ps_ad_repository.dart
- Updated error logging messages to reflect the correct repository class (
PSAdRepository
) for easier debugging.
- Updated error logging messages to reflect the correct repository class (
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Incorporated
normalizeFileName
into image saving logic to ensure filenames are standardized. - Updated error handling to provide clearer exception messages.
- Incorporated
This commit introduces various improvements, including new utility methods for filename normalization, enhancements to the mechanics selection process, and improved error handling across multiple repositories. The changes ensure a more consistent and user-friendly experience, with better management of filenames and mechanic data.
Update: Refactor Mechanics IDs and Various Model Updates. Files and Changes:
-
lib/common/models/ad.dart
- Updated
mechanicsId
fromList<int>
toList<String>
to reflect changes in ID management.
- Updated
-
lib/common/models/boardgame.dart
- Renamed the
id
field tobgId
. - Updated
mechanics
tomechsPsIds
, changing the type fromList<int>
toList<String>
.
- Renamed the
-
lib/common/models/filter.dart
- Changed
mechanicsId
tomechanicsPsId
and updated its type fromList<int>
toList<String>
.
- Changed
-
lib/common/settings/local_server.dart
- Added
keyParseServerImageUrl
to manage image URLs more efficiently.
- Added
-
lib/common/singletons/app_settings.dart
- Enhanced
_saveBright()
to save brightness settings as 'dark' or 'light' strings.
- Enhanced
-
lib/components/custon_field_controllers/numeric_edit_controller.dart
- Improved the
numericValue
setter to better manage old values and trigger appropriate UI updates.
- Improved the
-
lib/components/others_widgets/spin_box_field.dart
- Refactored to use generics, allowing support for both
int
anddouble
types inSpinBoxField
.
- Refactored to use generics, allowing support for both
-
lib/features/boardgame/boardgame_screen.dart
- Refined the floating action button to allow for multiple actions with tooltips for better UX.
-
lib/features/edit_ad/edit_ad_controller.dart
- Updated
setMechanicsIds()
tosetMechanicsPsIds()
to handle the newString
ID format.
- Updated
-
lib/features/edit_ad/widgets/ad_form.dart
- Refactored to use the new
setMechanicsPsIds()
method.
- Refactored to use the new
-
lib/features/edit_boardgame/edit_boardgame_controller.dart
- Updated mechanics handling to reflect changes from
int
toString
for IDs. - Introduced a method for updating existing board games.
- Updated mechanics handling to reflect changes from
-
lib/features/edit_boardgame/edit_boardgame_screen.dart
- Modified the initialization to pass
BoardgameModel
objects where applicable.
- Modified the initialization to pass
-
lib/features/filters/filters_controller.dart
- Changed
selectedMechIds
fromList<int>
toList<String>
. - Updated method calls to align with this change.
- Changed
-
lib/features/filters/filters_screen.dart
- Refined the mechanics selection process to handle
String
IDs.
- Refined the mechanics selection process to handle
-
lib/features/mechanics/mechanics_controller.dart
- Adapted the controller to work with
String
IDs. - Updated methods for selecting and managing mechanics.
- Adapted the controller to work with
-
lib/features/mechanics/mechanics_screen.dart
- Updated arguments and state management to work with
String
IDs instead ofint
.
- Updated arguments and state management to work with
-
lib/features/mechanics/widgets/show_all_mechs.dart
- Refined to handle
String
IDs, ensuring compatibility with the rest of the application.
- Refined to handle
-
lib/features/my_account/widgets/admin_hooks.dart
- Adjusted to pass
String
IDs in the navigation arguments for mechanics management.
- Adjusted to pass
-
lib/manager/boardgames_manager.dart
- Implemented
update()
method to handle board game updates with the newString
ID format. - Renamed
saveNewBoardgame()
tosave()
for consistency.
- Implemented
-
lib/manager/mechanics_manager.dart
- Updated to handle
String
IDs for mechanics. - Modified the
add()
method to return the new mechanic after saving it to the server.
- Updated to handle
-
lib/my_material_app.dart
- Adjusted routes to pass
BoardgameModel
objects where required. - Updated mechanics selection to handle
String
IDs.
- Adjusted routes to pass
-
lib/repository/parse_server/common/constants.dart
- Removed the now redundant
keyMechId
constant.
- Removed the now redundant
-
lib/repository/parse_server/common/parse_to_model.dart
- Updated parsing logic to handle
String
IDs for mechanics and board games.
- Updated parsing logic to handle
-
lib/repository/parse_server/ps_ad_repository.dart
- Refined to work with
String
IDs for mechanics within advertisements.
- Refined to work with
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Implemented an
update()
method for board games, ensuring proper handling of the newString
IDs.
- Implemented an
-
lib/repository/parse_server/ps_mechanics_repository.dart
- Changed method names and return types to work with
String
IDs. - Removed the setting of
mechId
in theadd()
method, now relying onobjectId
.
- Changed method names and return types to work with
-
lib/store/constants/migration_sql_scripts.dart
- Added a placeholder for a future migration script (version 1002).
-
lib/store/stores/mechanics_store.dart
- Updated queries to include the new
mechPSId
column.
- Updated queries to include the new
This commit introduces significant changes to the handling of mechanics and board game IDs across the codebase, migrating from int
to String
IDs for better compatibility with the Parse server. The update also includes improvements in UI components and overall data management.
Update: Android Manifest, Database Management, and Various Model Enhancements. Files and Changes:
-
android/app/src/main/AndroidManifest.xml
- Added necessary permissions (INTERNET, CAMERA, READ/WRITE_EXTERNAL_STORAGE) as comments for potential future use.
- Integrated
UCropActivity
for image cropping functionality.
-
assets/data/bgBazzar.db
- Updated database file to include new or modified data.
-
lib/common/constants/shared_preferenses.dart
- Created new constants for managing shared preferences keys (
keySearchHistory
,keyLocalDBVersion
,keyBrightness
).
- Created new constants for managing shared preferences keys (
-
lib/common/models/ad.dart
- Reformatted the
toString
method for better readability, adding line breaks between fields.
- Reformatted the
-
lib/common/models/mechanic.dart
- Added a new
psId
field to theMechanicModel
. - Updated the
toMap
,fromMap
, andtoString
methods to reflect this change.
- Added a new
-
lib/common/singletons/app_settings.dart
- Implemented methods to manage and persist app settings, including brightness mode and local database version.
- Enhanced initialization with shared preferences support.
-
lib/common/singletons/search_history.dart
- Updated to use the new shared preferences constants for managing search history.
-
lib/common/theme/theme.dart
- Minor adjustment: changed
scaffoldBackgroundColor
to usecolorScheme.surface
instead ofcolorScheme.background
.
- Minor adjustment: changed
-
lib/components/buttons/big_button.dart
- Added support for an optional icon in the
BigButton
widget, allowing more customization.
- Added support for an optional icon in the
-
lib/components/others_widgets/state_error_message.dart
- Enhanced the
StateErrorMessage
widget to accept a custom error message.
- Enhanced the
-
lib/features/boardgame/boardgame_screen.dart
- Fixed an issue where the floating action button was displayed incorrectly based on the user’s admin status.
-
lib/features/edit_ad/edit_ad_controller.dart
- Improved the
setBgInfo
method to handle potential errors when retrieving board game data. - Added error handling and updated the UI accordingly.
- Improved the
-
lib/features/edit_ad/edit_ad_screen.dart
- Updated UI labels and buttons to reflect the current context (e.g., "Salvar" vs. "Atualizar").
- Integrated new icon options for buttons.
-
lib/features/edit_ad/widgets/ad_form.dart
- Refactored the method for retrieving board game information, ensuring proper error handling and feedback.
-
lib/features/my_account/my_account_screen.dart
- Simplified the code by renaming variables for consistency (
currentUser
touser
). - Updated the logout process to use the newly named variable.
- Simplified the code by renaming variables for consistency (
-
lib/get_it.dart
- Adjusted imports to reflect the reorganization of the database management files.
-
lib/main.dart
- Added initialization for the database provider to handle migrations and backups.
-
lib/repository/sqlite/bg_names_repository.dart
- Updated the import paths following the reorganization of store files.
-
lib/repository/sqlite/mechanic_repository.dart
- Updated the import paths following the reorganization of store files.
-
lib/store/constants/constants.dart
- Added constants for new database fields (
mechPSId
) and indices.
- Added constants for new database fields (
-
lib/store/constants/migration_sql_scripts.dart
- Added a new script for migrating the database to version 1001, including adding a
psId
field to theMechanics
table.
- Added a new script for migrating the database to version 1001, including adding a
-
lib/store/database/database_backup.dart
- Created a utility class to handle database backups and restoration.
-
lib/store/database/database_manager.dart
- Renamed and refactored to improve database initialization and management processes.
-
lib/store/database/database_migration.dart
- Added a new class to manage database migrations, applying necessary changes to keep the database schema up-to-date.
-
lib/store/database/database_provider.dart
- Created a provider class to handle database initialization, including applying migrations and managing backups.
-
lib/store/database/database_util.dart
- Added utility functions to manage database directories and configurations, abstracting platform-specific logic.
-
lib/store/bg_names_store.dart
andlib/store/mechanics_store.dart
- Updated paths and imports following the reorganization of the store files.
This commit includes significant updates across various components, focusing on database management, error handling, and UI/UX improvements. It also lays the groundwork for future enhancements by implementing robust database migration and backup strategies.
Refactor: Enhance Theme, Boardgame, Mechanics, and My Account Features. Files and Changes:
-
lib/common/theme/theme.dart
- Adjusted color scheme values across different themes to improve visual consistency.
- Updated the primary, secondary, and tertiary color tones for better contrast and readability.
- Modified the scaffold background color to match the updated theme configurations.
-
lib/components/form_fields/custom_form_field.dart
- Added
minLines
property support for text fields to allow dynamic height adjustment based on content.
- Added
-
lib/features/boardgame/boardgame_controller.dart
- Implemented
getBoardgameSelected
method to retrieve details of the selected board game. - Added a method to fetch a board game by its ID and return the corresponding model.
- Implemented
-
lib/features/boardgame/boardgame_screen.dart
- Integrated new actions in the UI to allow adding, editing, and viewing board games directly from the screen.
- Updated the floating action button behavior to reflect the current user’s role (admin or regular user).
-
lib/features/boardgame/widgets/bg_info_card.dart
- Removed outdated code related to displaying board game views and scoring.
-
lib/features/boardgame/widgets/view_boardgame.dart
- Created a new widget to display detailed information about a board game in a dedicated screen.
-
lib/features/edit_boardgame/edit_boardgame_screen.dart
- Fixed a bug that prevented the screen from closing after saving a board game.
- Streamlined the on-submit logic for fetching board game information.
-
lib/features/mechanics/mechanics_controller.dart
- Introduced a counter to track and display the number of selected mechanics.
- Implemented logic to update the counter and reflect the current selection status.
-
lib/features/mechanics/mechanics_screen.dart
- Enhanced the UI to display the number of selected mechanics in the app bar title.
- Improved the layout and padding for the mechanics list view.
-
lib/features/mechanics/widgets/mechanic_dialog.dart
- Added
minLines
andmaxLines
properties to the description text field for better usability.
- Added
-
lib/manager/boardgames_manager.dart
- Added a method to fetch and return a board game by its ID.
- Streamlined the board game addition process, including saving to the local database and updating the in-memory list.
-
lib/manager/mechanics_manager.dart
- Added methods to sort and update the mechanics list after adding new items to ensure alphabetical order.
- Separated the logic for adding mechanics to the local and Parse Server databases.
-
lib/my_material_app.dart
- Registered a new route for the
ViewBoardgame
screen. - Enhanced the app’s routing logic to handle navigation to the new board game view screen.
- Registered a new route for the
-
lib/features/my_account/my_account_screen.dart
- Added a brightness toggle action to the app bar, allowing users to switch between light and dark modes.
This commit introduces various enhancements across the theme settings, board game management, and user interface components. It also includes new functionality for viewing board games and improving the mechanics selection process, ensuring a more seamless and user-friendly experience.
Refactor: Update Boardgame Models and Controller Logic. Files and Changes:
-
lib/common/models/bg_name.dart
- Added the
toString
method to theBGNameModel
class for easier debugging. - Included a new directive to ignore
public_member_api_docs
andsort_constructors_first
lint warnings.
- Added the
-
lib/common/models/boardgame.dart
- Removed the
scoring
field from theBoardgameModel
class as it is no longer required. - Updated the
toString
method to reflect the removal of thescoring
field.
- Removed the
-
lib/features/boardgame/boardgame_controller.dart
- Refactored the controller to manage the search and selection of board games.
- Removed the
bgName
text controller and replaced the search functionality with a more efficient filtering method. - Added methods to manage search filters and handle the selection of board games by their ID.
-
lib/features/boardgame/boardgame_screen.dart
- Updated the UI to use the new filtering mechanism for displaying and selecting board games.
- Integrated a search dialog to allow users to search for board games by name.
- Removed the outdated text field and search button for a more streamlined search experience.
-
lib/repository/parse_server/common/constants.dart
- Removed the
keyBgScoring
constant as it is no longer used.
- Removed the
-
lib/repository/parse_server/common/parse_to_model.dart
- Updated the
boardgameModel
method to properly parse the list of mechanics from the Parse Server response.
- Updated the
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Removed the
scoring
field from the methods interacting with the Parse Server. - Improved the
getById
method to handle cases where no results are found more gracefully. - Corrected error handling and logging in the
getNames
method.
- Removed the
This commit introduces significant improvements to the board game management logic, streamlining the search and selection process. The changes include removing unused fields, enhancing data parsing, and updating the user interface to provide a more efficient and user-friendly experience.
Refactor: Rename and Reorganize Boardgame Search and Management. Files and Changes:
-
lib/features/bg_search/bg_search_controller.dart
->lib/features/boardgame/boardgame_controller.dart
- Renamed file and class from
BgController
toBoardgameController
. - Updated the state management references from
BgSearchState
toBoardgameState
.
- Renamed file and class from
-
lib/features/bg_search/bg_search_screen.dart
->lib/features/boardgame/boardgame_screen.dart
- Renamed file and class from
BgSearchScreen
toBoardgameScreen
. - Updated route name and widget class names accordingly.
- Renamed file and class from
-
lib/features/boardgames/boardgame_state.dart
->lib/features/boardgame/boardgame_state.dart
- Renamed file to reflect the updated naming conventions.
-
lib/features/bg_search/widgets/bg_info_card.dart
->lib/features/boardgame/widgets/bg_info_card.dart
- Moved the
bg_info_card.dart
widget to theboardgame
directory.
- Moved the
-
lib/features/bg_search/widgets/search_card.dart
->lib/features/boardgame/widgets/search_card.dart
- Moved the
search_card.dart
widget to theboardgame
directory.
- Moved the
-
lib/features/edit_ad/widgets/ad_form.dart
- Updated imports to reflect the renaming from
BgSearchScreen
toBoardgameScreen
.
- Updated imports to reflect the renaming from
-
lib/features/boardgames/boardgame_controller.dart
->lib/features/edit_boardgame/edit_boardgame_controller.dart
- Renamed file and class from
BoardgameController
toEditBoardgameController
. - Updated the state management references from
BoardgameState
toEditBoardgameState
.
- Renamed file and class from
-
lib/features/boardgames/boardgame_screen.dart
->lib/features/edit_boardgame/edit_boardgame_screen.dart
- Renamed file and class from
BoardgamesScreen
toEditBoardgamesScreen
. - Updated route name and widget class names accordingly.
- Renamed file and class from
-
lib/features/bg_search/bg_search_state.dart
->lib/features/edit_boardgame/edit_boardgame_state.dart
- Renamed file and class from
BgSearchState
toEditBoardgameState
. - Updated the state management classes to reflect the new context.
- Renamed file and class from
-
lib/features/my_account/widgets/admin_hooks.dart
- Updated import and navigation references from
BgSearchScreen
toBoardgameScreen
.
- Updated import and navigation references from
-
lib/my_material_app.dart
- Updated route mappings to reflect the renaming from
BgSearchScreen
toBoardgameScreen
and fromBoardgamesScreen
toEditBoardgamesScreen
.
- Updated route mappings to reflect the renaming from
This commit refactors and reorganizes the boardgame search and management components, aligning file and class names with their functionalities. The changes enhance code clarity and maintain consistency throughout the project.
Refactor: Rename and Update Boardgame and Mechanics Management. Files and Changes:
-
lib/common/models/bg_name.dart
- Modified
BGNameModel
to use non-final fields. - Added
toMap
andfromMap
methods for easier conversion betweenBGNameModel
andMap<String, dynamic>
.
- Modified
-
lib/features/bg_search/bg_search_controller.dart
- Renamed the
BgNamesManager
toBoardgamesManager
. - Updated method names to reflect this change.
- Refactored method
searchBgg
tosearchBg
.
- Renamed the
-
lib/features/bg_search/bg_search_screen.dart
- Renamed
BggSearchScreen
toBgSearchScreen
. - Updated the route name and widget class names accordingly.
- Renamed
-
lib/features/boardgames/boardgame_controller.dart
- Renamed
BgNamesManager
toBoardgamesManager
. - Commented out the initialization of BGG rank to focus on the new board game management approach.
- Renamed
-
lib/features/edit_ad/edit_ad_controller.dart
- Removed the unused import of
BgNamesManager
.
- Removed the unused import of
-
lib/features/edit_ad/widgets/ad_form.dart
- Updated the route name from
BggSearchScreen.routeName
toBgSearchScreen.routeName
.
- Updated the route name from
-
lib/features/my_account/widgets/admin_hooks.dart
- Updated the
Boardgames
list tile to navigate to the updatedBgSearchScreen
.
- Updated the
-
lib/get_it.dart
- Replaced
BgNamesManager
withBoardgamesManager
in the dependency injection setup.
- Replaced
-
lib/main.dart
- Replaced
BgNamesManager
withBoardgamesManager
during initialization.
- Replaced
-
lib/manager/bg_names_manager.dart
->lib/manager/boardgames_manager.dart
- Renamed the file and class from
BgNamesManager
toBoardgamesManager
. - Added logic to manage board games both locally and from the Parse Server.
- Included methods for fetching and updating board game names.
- Renamed the file and class from
-
lib/my_material_app.dart
- Updated routes to reflect the renaming from
BggSearchScreen
toBgSearchScreen
.
- Updated routes to reflect the renaming from
-
lib/repository/sqlite/bg_names_repository.dart
- Created a new repository to handle SQLite operations related to board game names.
-
lib/repository/sqlite/mechanic_repository.dart
- Renamed import from
mechanics.dart
tomechanics_store.dart
. - Improved error handling and logging.
- Renamed import from
-
lib/store/bg_names.dart
->lib/store/bg_names_store.dart
- Renamed the file to follow the updated naming conventions.
- Enhanced methods for adding and updating board game names in the local SQLite database.
-
lib/store/mechanics.dart
->lib/store/mechanics_store.dart
- Renamed the file for consistency with the new naming conventions.
This commit refactors the codebase to rename and update the management of board games and mechanics. It introduces a consistent naming convention across files and classes, while also enhancing the integration between local storage and the Parse Server.
Documentation and Code Refactor: Update README and Mechanics Features. Files and Changes:
-
README.md
- Updated the changelog with the latest version
0.6.13+37
, detailing refactoring changes and new features.
- Updated the changelog with the latest version
-
lib/common/models/mechanic.dart
- Refactored the
MechanicModel
constructor to make theid
field optional. - Simplified the
fromMap
method to remove backward compatibility checks for older field names (nome
anddescricao
).
- Refactored the
-
lib/features/mechanics/mechanics_controller.dart
- Converted
MechanicsController
into aChangeNotifier
to manage UI states. - Added methods for handling mechanics state (
MechanicsStateLoading
,MechanicsStateSuccess
, etc.). - Improved resource disposal management within the
dispose()
method.
- Converted
-
lib/features/mechanics/mechanics_screen.dart
- Refactored the mechanics screen to use the new
MechanicDialog
for adding mechanics. - Modularized the UI components into separate widgets (
ShowSelectedMechs
,ShowAllMechs
). - Integrated state management for loading and error states.
- Refactored the mechanics screen to use the new
-
lib/features/mechanics/mechanics_state.dart
- Created a new state management file to handle different states within the mechanics screen (
MechanicsStateInitial
,MechanicsStateLoading
, etc.).
- Created a new state management file to handle different states within the mechanics screen (
-
lib/features/mechanics/widgets/mechanic_dialog.dart
- Added a new widget for the mechanics dialog, allowing users to add new mechanics with name and description fields.
-
lib/features/mechanics/widgets/show_all_mechs.dart
- Created a widget to display all mechanics with selection capability.
-
lib/features/mechanics/widgets/show_selected_mechs.dart
- Created a widget to display selected mechanics.
-
lib/manager/mechanics_manager.dart
- Added new methods to fetch mechanics from both local storage and Parse Server.
- Enhanced mechanics addition logic by integrating local and server-side additions.
- Implemented
_localAdd
and_psAdd
methods for better separation of concerns.
-
lib/repository/parse_server/common/constants.dart
- Added constants for mechanics table in the Parse Server (
keyMechTable
,keyMechObjectId
,keyMechId
, etc.).
- Added constants for mechanics table in the Parse Server (
-
lib/repository/parse_server/common/parse_to_model.dart
- Added a new method
mechanic
to parseParseObject
intoMechanicModel
.
- Added a new method
-
lib/repository/parse_server/ps_ad_repository.dart
- Introduced a private constructor to prevent instantiation of
PSAdRepository
.
- Introduced a private constructor to prevent instantiation of
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Refined the method to fetch board game names by removing unnecessary null checks.
-
lib/repository/parse_server/ps_mechanics_repository.dart
- Added methods to add and retrieve mechanics from the Parse Server.
- Implemented error handling and logging for database operations.
-
lib/repository/sqlite/mechanic_repository.dart
- Renamed
getList
toget
for consistency. - Improved error handling and logging within the
get
method.
- Renamed
-
lib/store/constants/constants.dart
- Standardized table names and column names to use consistent casing (
Mechanics
,mechName
,mechDescription
).
- Standardized table names and column names to use consistent casing (
-
lib/store/database_manager.dart
- Removed obsolete code related to database versioning.
- Simplified the database initialization logic.
-
lib/store/mechanics.dart
- Renamed
queryMechs
toget
for better clarity. - Improved error logging in the database operations.
- Renamed
-
pubspec.yaml
- Updated the project version to
0.6.15+38
to reflect the latest changes.
- Updated the project version to
This commit includes updates to the documentation, refactors mechanics management, and enhances state management across the mechanics-related features. The codebase is now more modular and maintains better consistency across different components.
Refactor: Update Parse Server Repositories and Add New Features. Files and Changes:
-
assets/data/bgBazzar.db
- Updated the database file.
-
assets/old/bgBazzar.db
- Added an old backup of the
bgBazzar.db
file.
- Added an old backup of the
-
lib/common/singletons/current_user.dart
- Replaced
UserRepository
withPSUserRepository
in methodsinit
andlogout
.
- Replaced
-
lib/features/address/address_controller.dart
- Replaced
AdRepository
withPSAdRepository
in method to move advertisements.
- Replaced
-
lib/features/address/address_screen.dart
- Replaced
AdRepository
withPSAdRepository
.
- Replaced
-
lib/features/bg_search/bg_search_controller.dart
- Replaced
BoardgameRepository
withPSBoardgameRepository
in methodgetBoardInfo
.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart
- Replaced
BoardgameRepository
withPSBoardgameRepository
in methods fetching and saving board game data.
- Replaced
-
lib/features/edit_ad/edit_ad_controller.dart
- Replaced
AdRepository
withPSAdRepository
in methods to save and update advertisements.
- Replaced
-
lib/features/login/login_controller.dart
- Replaced
UserRepository
withPSUserRepository
in login method.
- Replaced
-
lib/features/mechanics/mechanics_screen.dart
- Added functionality for adding a new mechanic with input fields for name and description.
- Implemented a floating action button for admin users to add new mechanics.
-
lib/features/my_account/my_account_screen.dart
- Refactored
MyAccountScreen
to use separate widgets for different sections (AdminHooks
,ShoppingHooks
,SalesHooks
,ConfigHooks
).
- Refactored
-
lib/features/my_account/widgets/admin_hooks.dart
- Created a new widget to handle admin-related actions such as managing mechanics and board games.
-
lib/features/my_account/widgets/config_hooks.dart
- Created a new widget to handle user configuration options such as managing personal data and addresses.
-
lib/features/my_account/widgets/sales_hooks.dart
- Created a new widget to handle sales-related actions such as viewing summaries and managing ads.
-
lib/features/my_account/widgets/shopping_hooks.dart
- Created a new widget to handle shopping-related actions such as managing favorites and purchases.
-
lib/features/my_ads/my_ads_controller.dart
- Replaced
AdRepository
withPSAdRepository
in methods to fetch and update ads.
- Replaced
-
lib/features/my_data/my_data_controller.dart
- Replaced
UserRepository
withPSUserRepository
in method to save user data.
- Replaced
-
lib/features/shop/shop_controller.dart
- Replaced
AdRepository
withPSAdRepository
in methods to fetch ads.
- Replaced
-
lib/features/signup/signup_controller.dart
- Replaced
UserRepository
withPSUserRepository
in signup method.
- Replaced
-
lib/manager/address_manager.dart
- Replaced
AddressRepository
withPSAddressRepository
in methods for managing addresses.
- Replaced
-
lib/manager/bg_names_manager.dart
- Replaced
BoardgameRepository
withPSBoardgameRepository
in methods for managing board game names.
- Replaced
-
lib/manager/favorites_manager.dart
- Replaced
FavoriteRepository
withPSFavoriteRepository
in methods for managing favorites.
- Replaced
-
lib/manager/mechanics_manager.dart
- Added new methods to add and update mechanics.
- Implemented
ManagerStatus
enum to manage mechanic status.
-
lib/repository/parse_server/ad_repository.dart
->lib/repository/parse_server/ps_ad_repository.dart
- Renamed file and refactored class to
PSAdRepository
.
- Renamed file and refactored class to
-
lib/repository/parse_server/address_repository.dart
->lib/repository/parse_server/ps_address_repository.dart
- Renamed file and refactored class to
PSAddressRepository
.
- Renamed file and refactored class to
-
lib/repository/parse_server/boardgame_repository.dart
->lib/repository/parse_server/ps_boardgame_repository.dart
- Renamed file and refactored class to
PSBoardgameRepository
.
- Renamed file and refactored class to
-
lib/repository/parse_server/favorite_repository.dart
->lib/repository/parse_server/ps_favorite_repository.dart
- Renamed file and refactored class to
PSFavoriteRepository
.
- Renamed file and refactored class to
-
lib/repository/parse_server/user_repository.dart
->lib/repository/parse_server/ps_user_repository.dart
- Renamed file and refactored class to
PSUserRepository
.
- Renamed file and refactored class to
-
lib/repository/sqlite/mechanic_repository.dart
- Added new methods to add and update mechanics in the database.
- Updated queries to match the new schema.
-
lib/store/constants/constants.dart
- Removed unused columns
mechIndexNome
andmechDescricao
. - Updated constants related to the mechanics table.
- Removed unused columns
-
lib/store/constants/sql_create_table.dart
- Added SQL scripts to create tables for BG names, DB version, and mechanics.
-
lib/store/database_manager.dart
- Updated database manager to handle the creation of new tables and database versions.
-
lib/store/mechanics.dart
- Added new methods to insert, update, and delete mechanics in the SQLite database.
This commit refactors the codebase to adopt a consistent naming convention for Parse Server repositories, introduces new widgets for modularization in the MyAccountScreen
, and enhances mechanics management features. The database schema and initialization logic have also been updated to support new features.
Update database file name and refactor project components for better organization and functionality.
-
assets/data/bgg.db
- Renamed to
assets/data/bgBazzar.db
. - Binary content of the file has changed.
- Renamed to
-
lib/common/models/bg_name.dart
- Updated
BGNameModel
:- Changed
id
type fromString?
toint?
. - Added
bgId
field of typeString?
.
- Changed
- Updated
-
lib/common/models/boardgame.dart
- Updated
BoardgameModel
:- Replaced
weight
field withviews
of typeint
and set default value to0
. - Adjusted
toString
method to reflect these changes.
- Replaced
- Updated
-
lib/common/singletons/current_user.dart
- Added
isAdmin
getter to return whether the current user is an admin.
- Added
-
lib/components/custon_field_controllers/numeric_edit_controller.dart
- Modified
NumericEditController
:- Made it generic to support both
int
anddouble
types. - Improved validation and handling of numeric input based on the type.
- Refactored
_validateNumber
method for better clarity.
- Made it generic to support both
- Modified
-
lib/components/form_fields/custom_form_field.dart
- Added
labelStyle
parameter for customizing the text style of the label.
- Added
-
lib/components/form_fields/custom_long_form_field.dart
- Introduced a new
CustomLongFormField
widget to handle multi-line text input with various customization options.
- Introduced a new
-
lib/components/form_fields/custom_names_form_field.dart
- Added
labelStyle
parameter for text style customization of the label.
- Added
-
lib/components/others_widgets/spin_box_field.dart
- Refactored the widget:
- Removed redundant
SizedBox
wrappers. - Replaced
TextField
withListenableBuilder
to dynamically display numeric values.
- Removed redundant
- Refactored the widget:
-
lib/features/bg_search/bg_search_controller.dart
- Updated to include
CurrentUser
for checking admin rights. - Adjusted methods to match updated data models.
- Updated to include
-
lib/features/bg_search/bg_search_screen.dart
- Updated UI to support admin functionality:
- Added FAB to add a new board game if the user is an admin.
- Refactored padding and UI components for better spacing.
- Updated UI to support admin functionality:
-
lib/features/bg_search/widgets/bg_info_card.dart
- Commented out the display of
views
andscoring
for further adjustments.
- Commented out the display of
-
lib/features/bg_search/widgets/search_card.dart
- Replaced
getBoardInfo
parameter fromid
tobgId
to reflect updated data model.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart
- Refactored to use updated
NumericEditController
for various integer-based inputs. - Added methods to save board games and handle mechanics more effectively.
- Refactored to use updated
-
lib/features/boardgames/boardgame_screen.dart
- Updated UI components:
- Added fields for image upload and mechanic selection.
- Implemented save functionality with data validation.
- Updated UI components:
-
lib/manager/bg_names_manager.dart
- Refactored to handle image conversion and saving of new board games.
- Adjusted methods to support new data model changes.
-
lib/repository/parse_server/boardgame_repository.dart
- Replaced
weight
field withviews
in Parse Server operations.
- Replaced
-
lib/repository/parse_server/common/constants.dart
- Updated database constants to reflect the change from
weight
toviews
.
- Updated database constants to reflect the change from
-
lib/repository/parse_server/common/parse_to_model.dart
- Adjusted model parsing to reflect changes in the data model.
-
lib/repository/sqlite/mechanic_repository.dart
- Updated to use
MechanicsStore
for querying mechanics.
- Updated to use
-
lib/store/mech_store.dart
- Renamed to
bg_names.dart
and refactored to better align with its purpose.
- Renamed to
-
lib/store/constants/constants.dart
- Updated database configuration:
- Renamed
dbName
tobgBazzar.db
. - Updated constants related to database structure and schema.
- Renamed
- Updated database configuration:
-
lib/store/database_manager.dart
- Enhanced initialization process to support different platforms and configurations.
- Included the setup for a new directory structure on desktop platforms.
-
lib/store/mechanics.dart
- Added new store class
MechanicsStore
to handle mechanic-related database operations.
- Added new store class
-
pubspec.yaml & pubspec.lock
- Added dependencies:
sqflite_common_ffi
sqflite_common_ffi_web
image
- Updated assets path to reflect the renamed database file.
- Added dependencies:
-
web/index.html
- Included cropper.js library for handling image cropping functionality.
This commit reorganizes and enhances the project by renaming and refactoring several components. It includes updates to the database file and structure, introduces new dependencies, and enhances user interface elements to better support functionality, particularly for board game management and image handling.
Refactor project structure by organizing repositories into more descriptive directories
-
lib/repository/bgg_rank_repository.dart
- Renamed and moved to
lib/repository/bgg_xml/bgg_rank_repository.dart
to better reflect its association with BGG XML API.
- Renamed and moved to
-
lib/repository/bgg_xmlapi_repository.dart
- Renamed and moved to
lib/repository/bgg_xml/bgg_xmlapi_repository.dart
to align with other BGG-related repositories.
- Renamed and moved to
-
lib/repository/ibge_repository.dart
- Renamed and moved to
lib/repository/gov_api/ibge_repository.dart
to categorize it under government APIs.
- Renamed and moved to
-
lib/repository/viacep_repository.dart
- Renamed and moved to
lib/repository/gov_api/viacep_repository.dart
to keep it alongside other government-related APIs.
- Renamed and moved to
-
lib/repository/ad_repository.dart
- Renamed and moved to
lib/repository/parse_server/ad_repository.dart
to clearly indicate its reliance on Parse Server.
- Renamed and moved to
-
lib/repository/address_repository.dart
- Renamed and moved to
lib/repository/parse_server/address_repository.dart
for better organization under Parse Server.
- Renamed and moved to
-
lib/repository/boardgame_repository.dart
- Renamed and moved to
lib/repository/parse_server/boardgame_repository.dart
to group all Parse Server-related repositories together.
- Renamed and moved to
-
lib/repository/common/constants.dart
- Renamed and moved to
lib/repository/parse_server/common/constants.dart
to keep constants within the Parse Server directory.
- Renamed and moved to
-
lib/repository/common/parse_to_model.dart
- Renamed and moved to
lib/repository/parse_server/common/parse_to_model.dart
to keep model parsing logic within Parse Server.
- Renamed and moved to
-
lib/repository/favorite_repository.dart
- Renamed and moved to
lib/repository/parse_server/favorite_repository.dart
to be consistent with other Parse Server repositories.
- Renamed and moved to
-
lib/repository/user_repository.dart
- Renamed and moved to
lib/repository/parse_server/user_repository.dart
to maintain consistency in the Parse Server directory.
- Renamed and moved to
-
lib/repository/mechanic_repository.dart
- Renamed and moved to
lib/repository/sqlite/mechanic_repository.dart
to clarify its use of SQLite.
- Renamed and moved to
-
lib/store/bgg_rank_store.dart
- Renamed and moved to
lib/repository/sqlite/store/bgg_rank_store.dart
to better categorize store-related files under SQLite.
- Renamed and moved to
-
lib/store/constants/constants.dart
- Renamed and moved to
lib/repository/sqlite/store/constants/constants.dart
to align with SQLite-related stores.
- Renamed and moved to
-
lib/store/database_manager.dart
- Renamed and moved to
lib/repository/sqlite/store/database_manager.dart
to centralize database management under SQLite.
- Renamed and moved to
-
lib/store/mech_store.dart
- Renamed and moved to
lib/repository/sqlite/store/mech_store.dart
to group all mechanic-related stores within SQLite.
- Renamed and moved to
This commit reorganizes the project structure by categorizing repositories and stores into more descriptive directories, improving the clarity and maintainability of the codebase.
Refactor project to rename from xlo_parse_server
to bgbazzar
and update related files
-
README.md
- Renamed project title from
xlo_parse_server
tobgbazzar
. - Updated references in the TODO list and project description.
- Renamed project title from
-
android/app/build.gradle
- Changed
namespace
frombr.dev.rralves.xlo_parse_server
tobr.dev.rralves.bgbazzar
. - Updated
applicationId
tobr.dev.rralves.bgbazzar
.
- Changed
-
android/app/src/main/AndroidManifest.xml
- Updated
package
attribute tobr.dev.rralves.bgbazzar
. - Changed
android:label
tobgbazzar
.
- Updated
-
android/app/src/main/kotlin/br/dev/rralves/bgbazzar/MainActivity.kt
- Renamed package from
br.dev.rralves.xlo_parse_server
tobr.dev.rralves.bgbazzar
.
- Renamed package from
-
ios/Runner.xcodeproj/project.pbxproj
- Updated
PRODUCT_BUNDLE_IDENTIFIER
references fromcom.example.xloParseServer
tobr.dev.rralves.xloParseServer
.
- Updated
-
ios/Runner/AppDelegate.swift
- Changed the annotation from
@UIApplicationMain
to@main
.
- Changed the annotation from
-
lib/common/abstracts/data_result.dart
- Added a new abstract class
DataResult
for handling either success or failure outcomes, inspired by Swift and Dart implementations. - Introduced
Failure
,GenericFailure
,APIFailure
,_SuccessResult
, and_FailureResult
classes.
- Added a new abstract class
-
lib/common/models/ad.dart
- Removed
bggId
property fromAdModel
. - Reorganized
toString
method to include new properties likeyearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,designer
, andartist
.
- Removed
-
lib/common/models/boardgame.dart
- Refactored properties: replaced
id
,name
,yearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,designer
,artist
with new names and types for better clarity. - Updated
toString
method to reflect these changes.
- Refactored properties: replaced
-
lib/components/others_widgets/ad_list_view/widgets/dismissible_ad.dart
- Added a
FIXME
comment to indicate the need to select direction to disable unnecessary shifts.
- Added a
-
lib/features/bgg_search/bgg_search_screen.dart
- Replaced
BigButton
withOverflowBar
to allow more granular control of buttons likeSelecionar
andCancelar
.
- Replaced
-
lib/features/bgg_search/widgets/bg_info_card.dart
- Reorganized UI layout in
BGInfoCard
, added image display, and adjusted text fields with new board game properties. - Improved layout responsiveness and added
TextOverflow.ellipsis
to designer and artist fields.
- Reorganized UI layout in
-
lib/features/boardgames/boardgame_controller.dart
- Updated method
loadBoardInfo
to accommodate new property names for board game details.
- Updated method
-
lib/features/edit_ad/edit_ad_controller.dart
- Removed
bggId
handling from the ad editing logic. - Updated properties to use new naming conventions like
publishYear
,minPlayers
,maxPlayers
, etc.
- Removed
-
lib/repository/ad_repository.dart
- Removed deprecated
bggId
from the ad repository. - Added logic to save additional properties such as
yearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,designer
, andartist
.
- Removed deprecated
-
lib/repository/bgg_xmlapi_repository.dart
- Included
image
property in the parsing logic. - Removed unnecessary properties and refined model creation logic for
BoardgameModel
.
- Included
-
lib/repository/boardgame_repository.dart
- Added new repository class
BoardgameRepository
to handle CRUD operations for board games.
- Added new repository class
-
lib/repository/common/constants.dart
- Added constants related to
BoardgameModel
to handle new properties.
- Added constants related to
-
lib/repository/common/parse_to_model.dart
- Added parsing logic for
BoardgameModel
. - Removed
bggId
related parsing from ad model creation.
- Added parsing logic for
-
pubspec.yaml
- Renamed project from
xlo_mobx
tobgbazzar
. - Added
equatable
package dependency.
- Renamed project from
-
test/common/abstracts/data_result_test.dart
- Added test cases for
DataResult
class, including success, failure, and edge cases.
- Added test cases for
-
test/repository/ibge_repository_test.dart
- Updated import path from
xlo_mobx
tobgbazzar
.
- Updated import path from
-
web/index.html
- Renamed project references from
xlo_parse_server
tobgbazzar
.
- Renamed project references from
-
web/manifest.json
- Updated
name
andshort_name
fromxlo_parse_server
tobgbazzar
.
- Updated
The project has been successfully refactored to transition from xlo_parse_server
to bgbazzar
, with corresponding updates across all relevant files.
Integrated Boardgame Functionality and Enhanced AdModel Structure
-
lib/common/models/ad.dart
- Imported
boardgame.dart
. - Updated
AdModel
:- Changed
owner
to be nullable. - Added
boardgame
,yearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,designer
, andartist
fields. - Modified the constructor to initialize the new fields.
- Updated
toString
method to include the new fields.
- Changed
- Imported
-
lib/common/models/bgg_boards.dart
- Created
BGGBoardsModel
class withobjectid
,name
, andyearpublished
fields.
- Created
-
lib/common/models/boardgame.dart
- Updated
BoardgameModel
:- Added new nullable fields
id
,designer
, andartist
. - Renamed
boardgamemechanic
tomechanics
. - Renamed
boardgamecategory
tocategories
. - Removed
toMap
andfromMap
methods.
- Added new nullable fields
- Updated
-
lib/components/others_widgets/ad_list_view/widgets/ad_card_view.dart
- Updated
AdCardView
:- Made
address
fields nullable when accessingcity
andstate
.
- Made
- Updated
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart
- Updated
AdShopView
:- Made
owner
nullable when accessingname
.
- Made
- Updated
-
lib/features/bgg_search/bgg_search_controller.dart
- Created
BggController
:- Added state management for BGG search and selection.
- Implemented search functionality using
BggXMLApiRepository
. - Added methods to handle errors and fetch board game details.
- Created
-
lib/features/bgg_search/bgg_search_screen.dart
- Created
BggSearchScreen
:- Implemented UI for searching and displaying BGG board games.
- Integrated
BggController
for state management and data handling.
- Created
-
lib/features/bgg_search/bgg_search_state.dart
- Created state classes for BGG search:
- Added
BggSearchStateInitial
,BggSearchStateLoading
,BggSearchStateSuccess
, andBggSearchStateError
.
- Added
- Created state classes for BGG search:
-
lib/features/bgg_search/widgets/bg_info_card.dart
- Created
BGInfoCard
widget:- Displays detailed information about a selected board game.
- Created
-
lib/features/bgg_search/widgets/search_card.dart
- Created
SearchCard
widget:- Displays a list of search results from BGG.
- Created
-
lib/features/boardgames/boardgame_controller.dart
- Updated
BoardgameController
:- Added disposal for additional controllers.
- Adjusted
getBggInfo
to handle new mechanics field inBoardgameModel
.
- Updated
-
lib/features/boardgames/boardgame_screen.dart
- Updated
BoardgamesScreen
:- Added BGG search button and navigation to
BggSearchScreen
. - Disposed of
BoardgameController
properly.
- Added BGG search button and navigation to
- Updated
-
lib/features/edit_ad/edit_ad_controller.dart
- Updated
EditAdController
:- Integrated
BoardgameModel
data into Ad creation and editing. - Added
setBggInfo
method to apply board game information to an ad.
- Integrated
- Updated
-
lib/features/edit_ad/widgets/ad_form.dart
- Updated
AdForm
:- Added functionality to fetch and apply BGG information using the new BGG search feature.
- Updated
-
lib/features/product/product_screen.dart
- Updated
ProductScreen
:- Made
owner
andaddress
fields nullable when accessed.
- Made
- Updated
-
lib/features/product/widgets/description_product.dart
- Updated
DescriptionProduct
:- Changed subtitle text to "Descrição:".
- Updated
-
lib/features/product/widgets/sub_title_product.dart
- Updated
SubTitleProduct
:- Adjusted the font size and style for subtitles.
- Updated
-
lib/my_material_app.dart
- Added route for
BggSearchScreen
.
- Added route for
-
lib/repository/ad_repository.dart
- Updated
AdRepository
:- Made
address
fields nullable when saving and updating ads.
- Made
- Updated
-
lib/repository/bgg_xmlapi_repository.dart
- Updated
BggXMLApiRepository
:- Added methods to fetch and parse board game data from BGG XML API.
- Created a search method to retrieve board games by name.
- Updated
This commit enhances the application by integrating Boardgame functionality into the Ad model, allowing for more detailed and relevant data management.
Refactor AdvertModel
to AdModel
Across Project Files
This commit refactors the codebase by renaming AdvertModel
to AdModel
, ensuring consistency and clarity in the model naming convention throughout the project. Modified Files and Changes:
-
lib/common/basic_controller/basic_controller.dart
- Renamed
AdvertModel
references toAdModel
.
- Renamed
-
lib/common/models/advert.dart
→lib/common/models/ad.dart
- Renamed the file from
advert.dart
toad.dart
. - Updated class name from
AdvertModel
toAdModel
. - Renamed
AdvertStatus
toAdStatus
.
- Renamed the file from
-
lib/common/models/filter.dart
- Updated import statement from
advert.dart
toad.dart
.
- Updated import statement from
-
lib/components/custom_drawer/custom_drawer.dart
- Renamed navigation functions from
EditAdvertScreen
toEditAdScreen
.
- Renamed navigation functions from
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart
- Updated all references of
AdvertModel
toAdModel
. - Updated status references from
AdvertStatus
toAdStatus
.
- Updated all references of
-
lib/features/address/address_controller.dart
- Updated repository references from
AdvertRepository
toAdRepository
.
- Updated repository references from
-
lib/features/address/address_screen.dart
- Updated repository references from
AdvertRepository
toAdRepository
.
- Updated repository references from
-
lib/features/edit_advert/edit_advert_controller.dart
→lib/features/edit_ad/edit_ad_controller.dart
- Renamed file and updated references from
AdvertModel
toAdModel
. - Updated repository references from
AdvertRepository
toAdRepository
.
- Renamed file and updated references from
-
lib/features/edit_advert/edit_advert_screen.dart
→lib/features/edit_ad/edit_ad_screen.dart
- Renamed file and updated references from
AdvertModel
toAdModel
.
- Renamed file and updated references from
-
lib/features/edit_advert/edit_advert_state.dart
→lib/features/edit_ad/edit_ad_state.dart
- Renamed file and updated references from
EditAdvertState
toEditAdState
.
- Renamed file and updated references from
-
lib/features/edit_advert/widgets/advert_form.dart
→lib/features/edit_ad/widgets/ad_form.dart
- Renamed file and updated form references from
AdvertForm
toAdForm
.
- Renamed file and updated form references from
-
lib/features/favorites/favorites_controller.dart
- Updated model references from
AdvertModel
toAdModel
.
- Updated model references from
-
lib/features/filters/filters_controller.dart
- Updated import statements and model references.
-
lib/features/my_ads/my_ads_controller.dart
- Updated model and repository references to
AdModel
andAdRepository
.
- Updated model and repository references to
-
lib/features/my_ads/my_ads_screen.dart
- Updated navigation and model references to
EditAdScreen
andAdModel
.
- Updated navigation and model references to
-
lib/features/product/product_screen.dart
- Updated model references from
AdvertModel
toAdModel
.
- Updated model references from
-
lib/features/shop/shop_controller.dart
- Updated repository and model references to
AdRepository
andAdModel
.
- Updated repository and model references to
-
lib/my_material_app.dart
- Updated routing references from
EditAdvertScreen
toEditAdScreen
. - Updated model references from
AdvertModel
toAdModel
.
- Updated routing references from
-
lib/repository/advert_repository.dart
→lib/repository/ad_repository.dart
- Renamed file and updated all function references from
AdvertModel
toAdModel
.
- Renamed file and updated all function references from
-
lib/repository/common/constants.dart
- Updated constants related to
Advert
to reflect theAd
naming convention.
- Updated constants related to
-
lib/repository/common/parse_to_model.dart
- Updated parsing functions to reference
AdModel
instead ofAdvertModel
.
- Updated parsing functions to reference
-
lib/repository/favorite_repository.dart
- Updated repository and model references to
AdModel
andAdRepository
.
- Updated repository and model references to
This commit is part of the ongoing effort to maintain consistency in the codebase by standardizing model naming conventions.
Note: This refactor only changes the naming conventions and does not introduce any new features or functionality.
The changes introduced in this commit ensure a consistent naming convention across the codebase, improving code readability and maintainability. The model AdvertModel
is now consistently referred to as AdModel
, and related classes, files, and references have been updated accordingly. This refactor is crucial for future scalability and ease of understanding for developers working on the project.
Refactor and Add New Features
-
assets/data/bgg.db
- Updated the database binary file with new data.
-
lib/common/models/boardgame.dart
- Changed
description
fromfinal
to a mutable field. - Updated
fromMap
method to usecleanDescription
fordescription
field. - Added
cleanDescription
method to sanitize and format the description text.
- Changed
-
lib/components/buttons/big_button.dart
- Renamed
onPress
callback toonPressed
for consistency.
- Renamed
-
lib/components/custon_field_controllers/numeric_edit_controller.dart
- Created a new
NumericEditController
class to manage numeric input with validation.
- Created a new
-
lib/components/form_fields/custom_names_form_field.dart
- Added
onSubmitted
callback to handle form submission events.
- Added
-
lib/components/others_widgets/spin_box_field.dart
- Created a new
SpinBoxField
widget for numeric input with increment and decrement functionality.
- Created a new
-
lib/features/boardgames/boardgame_controller.dart
- Refactored to replace
bggName
withnameController
. - Added controllers for various board game properties (
minPlayersController
,maxPlayersController
, etc.). - Implemented
loadBoardInfo
method to populate controllers fromBoardgameModel
. - Adjusted
getBggInfo
to load board game information into the controller.
- Refactored to replace
-
lib/features/boardgames/boardgame_screen.dart
- Integrated new controllers and widgets (
SpinBoxField
,SubTitleProduct
) for enhanced UI and interaction. - Refactored
AppBar
to include a back button.
- Integrated new controllers and widgets (
-
lib/features/edit_advert/edit_advert_screen.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage. - Adjusted button labels for better clarity.
- Renamed
-
lib/features/edit_advert/widgets/advert_form.dart
- Integrated
BigButton
for navigation toBoardgamesScreen
. - Updated label text to clarify the input fields.
- Integrated
-
lib/features/filters/filters_screen.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/features/login/login_screen.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/features/login/widgets/login_form.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/features/my_data/my_data_screen.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/features/product/widgets/sub_title_product.dart
- Added support for custom colors and padding in
SubTitleProduct
.
- Added support for custom colors and padding in
-
lib/features/signup/signup_screen.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/features/signup/widgets/signup_form.dart
- Renamed
onPress
toonPressed
for consistency inBigButton
usage.
- Renamed
-
lib/manager/mechanics_manager.dart
- Added
namesFromIdListString
method to convert list of mechanic IDs to a comma-separated string.
- Added
-
lib/repository/bgg_rank_repository.dart
- Removed instance of
BggRankStore
and used static methods instead.
- Removed instance of
-
lib/repository/bgg_xmlapi_repository.dart
- Used
BoardgameModel.cleanDescription
to sanitize the description text from the XML API.
- Used
-
lib/repository/common/constants.dart
- Corrected table names from
AdSale
toAdsSale
and fromFavorite
toFavorites
. - Added constants for database version management.
- Corrected table names from
-
lib/repository/common/parse_to_model.dart
- Cleaned up commented-out code related to mechanics parsing.
-
lib/repository/mechanic_repository.dart
- Removed instance of
MechStore
and used static methods instead.
- Removed instance of
-
lib/store/bgg_rank_store.dart
- Changed all methods to static and updated method signatures accordingly.
-
lib/store/constants/constants.dart
- Added constants related to database versioning.
-
lib/store/database_manager.dart
- Refactored to include database version checking and copying logic.
- Introduced
_copyBggDb
andgetDBVerion
methods for better database management.
-
lib/store/mech_store.dart
- Changed all methods to static and updated method signatures accordingly.
This commit includes multiple refactors and feature additions, particularly focused on improving the consistency of the codebase and adding new UI components.
2024/08/08 - version: 0.6.6+29
This commit introduces significant enhancements and new functionalities related to BGG ranks and board games, improving the overall functionality and user experience.
-
Makefile
- Added
git add .
togit_diff
target. - Modified
git_push
to includegit add .
and changed commit file fromcommit.txt
tocommit
.
- Added
-
lib/common/models/advert.dart
- Imported
foundation.dart
. - Added
bggId
field toAdvertModel
. - Modified constructor to include
bggId
. - Updated
toString
method to includebggId
.
- Imported
-
lib/common/models/bgg_rank.dart
- Created new model
BggRankModel
with fieldsid
,gameName
,yearPublished
,rank
,bayesAverage
,average
,usersRated
,isExpansion
,abstractsRank
,cgsRank
,childrensGamesrank
,familyGamesRank
,partyGamesRank
,strategyGamesRank
,thematicRank
,warGamesRank
. - Added factory methods
fromMap
andtoMap
. - Implemented
toString
method.
- Created new model
-
lib/common/models/boardgame.dart
- Created new model
BoardgameModel
with fieldsname
,yearpublished
,minplayers
,maxplayers
,minplaytime
,maxplaytime
,age
,description
,average
,bayesaverage
,averageweight
,boardgamemechanic
,boardgamecategory
. - Added factory methods
fromMap
andtoMap
. - Implemented
toString
method.
- Created new model
-
lib/components/form_fields/custom_form_field.dart
- Added
suffixText
andprefixText
parameters. - Updated constructor to include
suffixText
andprefixText
. - Modified
build
method to usesuffixText
andprefixText
.
- Added
-
lib/components/form_fields/custom_names_form_field.dart
- Created new widget
CustomNamesFormField
. - Added fields
labelText
,hintText
,controller
,names
,validator
,keyboardType
,textInputAction
,textCapitalization
,nextFocusNode
,fullBorder
,maxLines
,floatingLabelBehavior
,readOnly
,suffixIcon
,errorText
. - Implemented
StatefulWidget
logic to show suggestions based on input.
- Created new widget
-
lib/components/others_widgets/state_error_message.dart
- Added
closeDialog
callback toStateErrorMessage
. - Updated constructor to include
closeDialog
. - Added a button to close the dialog.
- Added
-
lib/features/address/address_controller.dart
- Added
closeErroMessage
method to change state toAddressStateSuccess
.
- Added
-
lib/features/address/address_screen.dart
- Replaced
ButtonBar
withOverflowBar
. - Updated to use
StateErrorMessage
withcloseDialog
callback.
- Replaced
-
lib/features/address/widgets/destiny_address_dialog.dart
- Replaced
ButtonBar
withOverflowBar
.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart
- Created
BoardgameController
withBoardgameState
,rankManager
, andbggName
. - Added methods to handle BGG rank initialization and fetching.
- Created
-
lib/features/boardgames/boardgame_screen.dart
- Created
BoardgamesScreen
to display board game details. - Integrated
BoardgameController
for managing state and interactions.
- Created
-
lib/features/boardgames/boardgame_state.dart
- Created
BoardgameState
abstract class withBoardgameStateInitial
,BoardgameStateLoading
,BoardgameStateSuccess
, andBoardgameStateError
.
- Created
-
lib/features/edit_advert/edit_advert_controller.dart
- Added
bggName
andrankManager
fields. - Modified
init
method to includebggName
. - Updated methods to handle
bggId
.
- Added
-
lib/features/edit_advert/edit_advert_screen.dart
- Replaced
ButtonBar
withOverflowBar
. - Added navigation to
BoardgamesScreen
.
- Replaced
-
lib/features/edit_advert/widgets/advert_form.dart
- Added
CustomFormField
for board game name. - Added button to navigate to
BoardgamesScreen
.
- Added
-
lib/features/login/login_controller.dart
- Added
closeErroMessage
method to change state toLoginStateSuccess
.
- Added
-
lib/features/login/login_screen.dart
- Updated controller usage to match naming conventions.
-
lib/features/mecanics/mecanics_screen.dart
- Replaced
ButtonBar
withOverflowBar
.
- Replaced
-
lib/features/my_ads/my_ads_controller.dart
- Added
closeErroMessage
method to change state toBasicStateSuccess
.
- Added
-
lib/features/my_ads/my_ads_screen.dart
- Updated to use
StateErrorMessage
withcloseDialog
callback.
- Updated to use
-
lib/features/new_address/new_address_screen.dart
- Replaced
ButtonBar
withOverflowBar
.
- Replaced
-
lib/features/shop/shop_controller.dart
- Added
closeErroMessage
method to change state toBasicStateSuccess
.
- Added
-
lib/features/shop/shop_screen.dart
- Updated to use
StateErrorMessage
withcloseDialog
callback.
- Updated to use
-
lib/get_it.dart
- Registered
BggRankManager
in dependency injection.
- Registered
-
lib/manager/bgg_rank_manager.dart
- Created
BggRankManager
to handle BGG rank data fetching and management.
- Created
-
lib/my_material_app.dart
- Added route for
BoardgamesScreen
.
- Added route for
-
lib/repository/advert_repository.dart
- Updated to set
bggId
inAdvertRepository
.
- Updated to set
-
lib/repository/bgg_rank_repository.dart
- Created
BggRankRepository
for interacting with BGG rank data.
- Created
-
lib/repository/bgg_xmlapi_repository.dart
- Created
BggXMLApiRepository
to fetch and parse BGG XML API data.
- Created
-
lib/repository/common/constants.dart
- Added
keyAdvertBggId
.
- Added
-
lib/repository/common/parse_to_model.dart
- Updated to parse
bggId
inAdvertModel
.
- Updated to parse
-
lib/store/bgg_rank_store.dart
- Created
BggRankStore
for database interactions related to BGG ranks.
- Created
-
lib/store/constants/constants.dart
- Updated constant
rankGameName
.
- Updated constant
-
lib/store/mech_store.dart
- Added spacing for readability.
-
pubspec.yaml
- Added
xml
dependency for XML parsing.
- Added
-
lib/common/models/advert.dart
- Added import for
foundation.dart
to supportlistEquals
.
- Added import for
-
lib/features/address/widgets/destiny_address_dialog.dart
- Replaced
ButtonBar
withOverflowBar
for consistent UI.
- Replaced
-
lib/features/boardgames/boardgame_screen.dart
- Improved layout and added detailed fields for board game information.
-
lib/features/edit_advert/edit_advert_screen.dart
- Enhanced form validation and user feedback for better user experience.
-
lib/features/my_ads/my_ads_screen.dart
- Added proper handling of error messages using
StateErrorMessage
.
- Added proper handling of error messages using
-
lib/features/new_address/new_address_screen.dart
- Updated UI components for better usability.
-
lib/repository/advert_repository.dart
- Improved error handling and added support for
bggId
.
- Improved error handling and added support for
-
lib/repository/bgg_xmlapi_repository.dart
- Added comprehensive error logging to facilitate debugging.
-
lib/store/bgg_rank_store.dart
- Optimized database queries for better performance.
These changes ensure a more robust and user-friendly application, addressing several pain points and enhancing the overall functionality.
Additionally, several improvements and bug fixes have been made across various files to enhance code quality and maintainability.
Implement Favorite Button and User-Specific Features, Improve Scrolling and Mechanics Handling
The favorite button now appears only for logged-in users and is positioned over the product images in the current layout. On the "My Ads" page, buttons to edit and delete an ad are available, but only for ads with a pending or sold status. Active products cannot be edited or deleted. In the ShopScreen, reactivity has been added to adjust the display of favorites and the page header name based on whether the user is logged in or not.
Scrolling adjustments have been made to the ShopGridView and AdListView widgets to ensure smoother scrolling when loading new ads. The control of mechanics has been migrated from the Parse server to a local SQLite database. These mechanics consist of relatively static information that does not change frequently, hence they have been incorporated into the app. Data from BGG and the annual ranking table have also been integrated into the application.
These changes enhance user-specific features and optimize the handling of mechanics by migrating data control to a local SQLite database. The integration of user-specific features and the optimization of mechanics handling ensure a more efficient and user-friendly experience. This set of changes introduces significant improvements to user interactions, performance enhancements, and the transition to local storage for mechanics, providing a more robust and efficient application experience.
Deletions primarily focus on removing configuration files and setups specific to Flutter's macOS, windows and Linux descktop implementations, cleaning up the project and reducing dependencies. Additional deletions continue the clean-up process by removing configuration files and assets specific to the macOS platform, further simplifying the project and focusing on the core Flutter application. The final batch of deletions completes the removal of configuration files, scripts, and assets specific to the macOS and Windows platforms. This clean-up aligns the project with the focus on core Flutter application development, eliminating unnecessary platform-specific files.
Below is a breakdown of the changes:
-
.env
- Added environment variables for Parse Server configuration:
PARSE_SERVER_DATABASE_URI
PARSE_SERVER_APPLICATION_ID
PARSE_SERVER_MASTER_KEY
PARSE_SERVER_CLIENT_KEY
PARSE_SERVER_JAVASCRIPT_KEY
PARSE_SERVER_REST_API_KEY
PARSE_SERVER_FILE_KEY
PARSE_SERVER_URL
PARSE_SERVER_MASTER_KEY_IPS
PARSE_PORT
- Added environment variables for Parse Server configuration:
-
assets/data/bgg.db
- Added SQLite database file for mechanics and rank data.
-
docker-compose.yml
- Updated Parse Server configuration to use environment variables.
-
lib/common/models/advert.dart
- Changed
mechanicsId
type fromList<String>
toList<int>
.
- Changed
-
lib/common/models/filter.dart
- Changed
mechanicsId
type fromList<String>
toList<int>
.
- Changed
-
lib/common/models/mechanic.dart
- Updated
MechanicModel
class:- Changed
id
type fromString?
toint?
. - Changed
name
type fromString?
toString
. - Added methods
toMap
andfromMap
.
- Changed
- Updated
-
lib/common/settings/local_server.dart
- Updated Parse Server URL and keys for back4app.com.
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart
- Removed
ButtonBehavior
enum. - Updated item button logic for ads:
- Added
_editButton
and_deleteButton
methods. - Added
_showAd
method for navigation. - Added logic to show buttons based on
buttonBehavior
flag.
- Added
- Improved scrolling behavior:
- Renamed
_scrollListener2
to_scrollListener
. - Added
_isScrolling
flag to prevent multiple requests.
- Renamed
- Removed
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart
- Improved scrolling behavior:
- Renamed
_scrollListener2
to_scrollListener
. - Added
_isScrolling
flag to prevent multiple requests.
- Renamed
- Improved scrolling behavior:
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart
- Display favorite button for logged-in users only:
- Added
isLogged
getter. - Used
FavStackButton
if user is logged in.
- Added
- Display favorite button for logged-in users only:
-
lib/features/edit_advert/edit_advert_controller.dart
- Changed
selectedMechIds
type fromList<String>
toList<int>
.
- Changed
-
lib/features/edit_advert/widgets/advert_form.dart
- Updated mechanics ID handling.
-
lib/features/filters/filters_controller.dart
- Changed
selectedMechIds
type fromList<String>
toList<int>
.
- Changed
-
lib/features/filters/filters_screen.dart
- Updated mechanics ID handling.
-
lib/features/mecanics/mecanics_screen.dart
- Changed
selectedIds
type fromList<String>
toList<int>
.
- Changed
-
lib/features/my_account/my_account_screen.dart
- Fixed logout behavior:
- Moved
currentUser.logout()
to afterNavigator.pop
.
- Moved
- Fixed logout behavior:
-
lib/features/my_ads/my_ads_screen.dart
- Added loading and error states:
- Used
StateLoadingMessage
andStateErrorMessage
components.
- Used
- Added loading and error states:
-
lib/features/my_ads/widgets/my_tab_bar_view.dart
- Simplified item button logic:
- Removed
getItemButton
method. - Used boolean flag for
buttonBehavior
.
- Removed
- Simplified item button logic:
-
lib/features/product/product_screen.dart
- Display favorite button in product images for logged-in users:
- Added
isLogged
getter. - Used
FavStackButton
inStack
.
- Added
- Display favorite button in product images for logged-in users:
-
lib/features/shop/shop_controller.dart
- Added listeners for user login status to update ads and page title.
-
lib/get_it.dart
- Registered
DatabaseManager
singleton.
- Registered
-
lib/manager/mechanics_manager.dart
- Changed
mechanicsId
type fromList<String>
toList<int>
. - Updated
nameFromId
method to useint
type.
- Changed
-
lib/repository/advert_repository.dart
- Changed
mechanicsId
type fromList<String>
toList<int>
in ad saving methods.
- Changed
-
lib/repository/common/constants.dart
- Increased
maxAdsPerList
from 6 to 20.
- Increased
-
lib/repository/common/parse_to_model.dart
- Changed
mechanicsId
type fromList<String>
toList<int>
in ad parsing method.
- Changed
-
lib/repository/mechanic_repository.dart
- Refactored to use local SQLite database for mechanics data:
- Used
MechStore
for querying mechanics.
- Used
- Refactored to use local SQLite database for mechanics data:
-
lib/store/constants/constants.dart
- Added constants for SQLite database handling:
- Database name, version, and table/column names.
- Added constants for SQLite database handling:
-
lib/store/database_manager.dart
- Implemented database manager for initializing and handling SQLite database.
-
lib/store/mech_store.dart
- Implemented mechanics store for querying mechanics data from SQLite database.
-
lib/components/others_widgets/fav_button.dart
- Created
FavStackButton
widget to handle favorite actions:- Displays favorite icon based on whether the ad is favorited.
- Toggles favorite status on button press.
- Created
-
lib/repository/mechanic_repository.dart.parse
- Added legacy Parse Server mechanic repository code for reference:
- Fetches mechanics from Parse Server.
- Logs errors if the query fails.
- Added legacy Parse Server mechanic repository code for reference:
-
linux/.gitignore
- Removed unused Linux build directory from version control.
-
linux/CMakeLists.txt
- Removed unused Linux build configuration file.
-
lib/common/settings/local_server.dart
- Commented out back4app.com configuration details:
- Removed hard-coded application ID and client key.
- Defined new application ID and client key for back4app.com.
- Set Parse Server URL to back4app.com.
- Commented out back4app.com configuration details:
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart
- Updated
AdListView
to include new button behavior:- Added
_editButton
and_deleteButton
methods. - Modified
_scrollListener
for smoother scrolling. - Updated layout to include edit and delete buttons for ads.
- Added
- Updated
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart
- Updated
ShopGridView
for better scrolling performance:- Modified
_scrollListener
for smoother scrolling. - Added
_isScrolling
to prevent duplicate load calls.
- Modified
- Updated
-
lib/features/my_ads/my_ads_screen.dart
- Enhanced
MyAdsScreen
to display loading and error messages:- Added
StateLoadingMessage
andStateErrorMessage
for better state handling.
- Added
- Enhanced
-
lib/features/product/product_screen.dart
- Improved
ProductScreen
to include favorite button for logged-in users:- Added
FavStackButton
to theImageCarousel
stack.
- Added
- Improved
-
lib/repository/common/constants.dart
- Increased
maxAdsPerList
from 6 to 20 to display more ads per load.
- Increased
-
lib/store/database_manager.dart
- Created
DatabaseManager
to handle local SQLite database:- Initializes database from assets if not found.
- Provides methods to access and close the database.
- Created
-
lib/store/mech_store.dart
- Created
MechStore
to handle mechanics storage:- Queries mechanics from local SQLite database.
- Fetches mechanic descriptions based on language code.
- Created
-
linux/*
- Removed linux desktop support.
-
macos/*
- Removed macOS descktop support.
-
windows/*
- Removed Windows desktop support.
-
pubspec.yaml
- Modified file.
- Added
sqflite
andpath_provider
to dependencies. - Included assets for the project.
- Added
- Modified file.
These changes enhance user-specific features and optimize the handling of mechanics by migrating data control to a local SQLite database. This set of changes introduces significant improvements to user interactions and performance, ensuring a more efficient and user-friendly experience. The transition to local storage for mechanics provides a more robust and efficient application experience.
Deletions primarily focus on removing configuration files and setup specific to Flutter's macOS and Linux implementations, cleaning up the project and reducing dependencies. Remaining deletions continue the clean-up process by removing additional configuration files and assets specific to the macOS platform, further simplifying the project and focusing on the core Flutter application. The final batch of deletions completes the removal of configuration files, scripts, and assets specific to the macOS and Windows platforms, aligning the project with the focus on core Flutter application development and eliminating unnecessary platform-specific files.
This commit introduces multiple enhancements and fixes across various components of the project:
-
Makefile
- Added a new
build_profile
target for running the Flutter app in profile mode.
- Added a new
-
README.md
- Updated the TODO list and removed unnecessary sections to streamline the document.
-
analysis_options.yaml
- Configured the analyzer to treat deprecated member use as an error.
-
android/app/build.gradle
- Updated
compileSdk
,minSdk
, andtargetSdk
versions to 34 and 21 respectively.
- Updated
-
android/app/src/main/AndroidManifest.xml
- Added necessary permissions for internet, camera, and external storage access.
-
android/build.gradle
- Updated the Gradle plugin version to 8.5.0.
-
android/gradle/wrapper/gradle-wrapper.properties
- Updated the Gradle distribution URL to use version 8.5.
-
flutter_01.png
- Added a new image resource.
-
lib/common/app_constants.dart
- Introduced a new constant
appTitle
with the value 'BGBazzar'.
- Introduced a new constant
-
lib/common/singletons/search_filter.dart
- Refactored the
SearchFilter
class, removing redundant code and adding ahaveFilter
getter.
- Refactored the
-
lib/common/singletons/search_history.dart
- Refactored the
SearchHistory
class, removing redundant code and optimizing methods.
- Refactored the
-
lib/components/custom_drawer/custom_drawer.dart
- Added navigation methods and refactored the code to improve readability and functionality.
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart
- Adjusted the image size calculation for better UI consistency.
-
lib/features/base/base_controller.dart
,lib/features/base/base_screen.dart
,lib/features/base/base_state.dart
,lib/features/base/widgets/old/search_dialog_bar.dart
,lib/features/base/widgets/old/search_dialog_search_bar.dart
,lib/features/base/widgets/search_controller.dart
- Deleted obsolete files related to the base controller and screen.
-
lib/features/favorites/favorites_controller.dart
- Removed TODO comments and unimplemented methods.
-
lib/features/login/login_screen.dart
- Added a back button to the app bar.
-
lib/features/my_account/my_account_screen.dart
- Refactored the logout method and fixed a comment for the logout feature.
-
lib/features/product/product_screen.dart
- Added a comment for the favorite button functionality.
-
lib/features/shop/shop_controller.dart
- Major refactor, including new methods for setting the page title, cleaning search, and handling ads retrieval.
-
lib/features/shop/shop_screen.dart
- Refactored the shop screen, including the app bar, floating action button, and the main content area for better UX and code maintainability.
-
lib/features/shop/shop_state.dart
- Deleted the redundant shop state file.
-
lib/features/base/widgets/search_dialog.dart
->lib/features/shop/widgets/search/search_dialog.dart
- Renamed and refactored the search dialog for better modularity.
-
lib/features/signup/signup_screen.dart
- Added a back button to the app bar.
-
lib/get_it.dart
- Updated dependency registration, replacing
BaseController
withShopController
.
- Updated dependency registration, replacing
-
lib/my_material_app.dart
- Changed the initial route to
ShopScreen
.
- Changed the initial route to
-
pubspec.lock
,pubspec.yaml
- Updated
shared_preferences
package to version 2.3.0.
- Updated
These changes collectively improve the project’s structure, enhance user experience, and maintain code consistency.
This commit introduces the Favorites feature and refactors various components to enhance functionality and code organization:
-
lib/components/custom_drawer/custom_drawer.dart
- Imported
FavoritesScreen
to enable navigation. - Updated the "Favoritos" list tile to use
Navigator.pushNamed
for navigation.
- Imported
-
lib/features/base/base_controller.dart
- Removed "Favoritos" from the
titles
list.
- Removed "Favoritos" from the
-
lib/features/base/base_screen.dart
- Removed the
FavoritesScreen
from the list of screens managed byBaseScreen
.
- Removed the
-
lib/features/favorites/favorites_controller.dart
- New file: Added
FavoritesController
to manage the state and data of the Favorites feature.
- New file: Added
-
lib/features/favorites/favorites_screen.dart
- Implemented the
FavoritesScreen
with state management and display logic usingFavoritesController
andShopGridView
.
- Implemented the
-
lib/features/shop/shop_screen.dart
- Removed the
showImage
method as it is now redundant with theShopGridView
implementation.
- Removed the
-
lib/get_it.dart
- Added disposal of
FavoritesManager
in thedisposeDependencies
method.
- Added disposal of
-
lib/manager/favorites_manager.dart
- Added the
ads
getter to expose the list of favorite ads. - Added a
dispose
method to properly clean up thefavNotifier
.
- Added the
-
lib/my_material_app.dart
- Added a route for
FavoritesScreen
in the route table.
- Added a route for
-
pubspec.yaml
- Updated the version from
0.6.1+26
to0.6.2+27
.
- Updated the version from
These changes collectively add the Favorites feature, allowing users to manage and view their favorite ads. The code refactoring improves maintainability and clarity.
This commit introduces updates, new functionalities, and refactorings across multiple files to improve user management and advertisement features:
-
lib/common/singletons/current_user.dart
- Added
FavoritesManager
integration for managing user favorites. - Renamed
isLoged
toisLogged
. - Added
login
method for handling user login logic. - Updated
logout
method to clear user favorites and addresses.
- Added
-
lib/components/custom_drawer/custom_drawer.dart
- Renamed
isLoged
toisLogged
to ensure consistent naming. - Updated button interactions based on user login status.
- Renamed
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart
- Renamed
isLoged
toisLogged
for consistency.
- Renamed
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart
- New file: Added
ShopGridView
widget for displaying advertisements in a grid view.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart
- New file: Added
AdShopView
widget for displaying individual advertisements.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/owner_rating.dart
- New file: Added
OwnerRating
widget to display owner ratings.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/shop_text_price.dart
- New file: Added
ShopTextPrice
widget to display advertisement prices.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/shop_text_title.dart
- New file: Added
ShopTextTitle
widget to display advertisement titles.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/show_image.dart
- New file: Added
ShowImage
widget to handle image display.
- New file: Added
-
lib/features/base/base_screen.dart
- Renamed
isLoged
toisLogged
to ensure consistent naming.
- Renamed
-
lib/features/edit_advert/edit_advert_screen.dart
- Updated title to reflect editing state.
- Added
StateLoadingMessage
andStateErrorMessage
for better state handling. - Fixed controller reference in
ImagesListView
.
-
lib/features/edit_advert/widgets/image_list_view.dart
- Fixed controller reference to
ctrl
for consistency.
- Fixed controller reference to
-
lib/features/shop/shop_screen.dart
- Replaced
AdListView
withShopGridView
for better advertisement display.
- Replaced
-
lib/get_it.dart
- Registered
FavoritesManager
for dependency injection.
- Registered
-
lib/manager/address_manager.dart
- Added methods
login
andlogout
to manage user login state.
- Added methods
-
lib/manager/favorites_manager.dart
- New file: Added
FavoritesManager
to manage user favorites, including methods to add, remove, and fetch favorites.
- New file: Added
-
lib/repository/constants.dart
- Updated
maxAdsPerList
to 6 for better pagination.
- Updated
-
lib/repository/favorite_repository.dart
- Updated
add
method to useadId
directly. - Added
getFavorites
method to fetch user's favorite advertisements.
- Updated
-
lib/repository/parse_to_model.dart
- Renamed
favotire
tofavorite
for correct spelling. - Added type annotation for
mechanic
method.
- Renamed
These changes collectively enhance user management, improve advertisement handling, and introduce a new favorites feature.
This commit introduces several updates, new functionalities, and refactorings across multiple files:
-
lib/common/models/favorite.dart
- New file: Added
FavoriteModel
class to represent favorite advertisements with attributesid
andadId
.
- New file: Added
-
lib/features/address/address_controller.dart
- Removed unnecessary delay after deleting an address in the
moveAdsAddressAndRemove
method.
- Removed unnecessary delay after deleting an address in the
-
lib/features/base/widgets/search_dialog_bar.dart
- Renamed and moved to
lib/features/base/widgets/old/search_dialog_bar.dart
for better organization.
- Renamed and moved to
-
lib/features/base/widgets/search_dialog_search_bar.dart
- Renamed and moved to
lib/features/base/widgets/old/search_dialog_search_bar.dart
for better organization.
- Renamed and moved to
-
lib/features/edit_advert/edit_advert_controller.dart
- Updated
mechanicsManager
to use the instance fromgetIt
for dependency injection.
- Updated
-
lib/features/filters/filters_controller.dart
- Updated
mechManager
to use the instance fromgetIt
for dependency injection.
- Updated
-
lib/features/filters/filters_screen.dart
- Fixed typo in the hint text from 'Cidate' to 'Cidade'.
-
lib/features/mecanics/mecanics_screen.dart
- Updated
mechanics
to use the instance fromgetIt
for dependency injection.
- Updated
-
lib/features/my_account/my_account_screen.dart
- Refactored
onPressed
method of the logout button to be asynchronous.
- Refactored
-
lib/features/product/product_screen.dart
- Added a favorite button to the app bar for product screens.
-
lib/features/product/widgets/image_carousel.dart
- Replaced
carousel_slider
withflutter_carousel_slider
for better functionality. - Updated the layout and behavior of the image carousel.
- Replaced
-
lib/get_it.dart
- Registered
MechanicsManager
as a lazy singleton for dependency injection.
- Registered
-
lib/main.dart
- Updated initialization process to include
MechanicsManager
.
- Updated initialization process to include
-
lib/manager/mechanics_manager.dart
- Removed singleton pattern in favor of dependency injection using
getIt
.
- Removed singleton pattern in favor of dependency injection using
-
lib/repository/constants.dart
- Added constants for the
Favorite
table and its fields.
- Added constants for the
-
lib/repository/favorite_repository.dart
- New file: Added
FavoriteRepository
with methods to add and delete favorites.
- New file: Added
-
lib/repository/parse_to_model.dart
- Added method
favorite
to convert ParseObject toFavoriteModel
.
- Added method
-
lib/repository/user_repository.dart
- Updated
update
method to handle user password changes more effectively. - Improved logout method to be asynchronous.
- Updated
-
pubspec.lock
- Removed
carousel_slider
package. - Added
flutter_carousel_slider
package.
- Removed
-
pubspec.yaml
- Removed
carousel_slider
dependency. - Added
flutter_carousel_slider
dependency.
- Removed
These changes collectively enhance the functionality and organization of the application, improve dependency management, and introduce the capability to handle favorite advertisements.
This commit introduces a range of updates and new functionalities across multiple files:
-
lib/components/dialogs/simple_question.dart
- New file: Added
SimpleQuestionDialog
widget for displaying simple question dialogs with Yes/No or Confirm/Cancel options.
- New file: Added
-
lib/features/address/address_controller.dart
- Imported
dart:developer
. - Added
AddressState
management. - Introduced
selectesAddresId
,_changeState
, andmoveAdsAddressAndRemove
methods for better address handling.
- Imported
-
lib/features/address/address_screen.dart
- Imported
dart:developer
andstate_error_message.dart
. - Updated
_removeAddress
to handle advertisements associated with the address. - Added
AnimatedBuilder
for managing loading and error states. - Included
DestinyAddressDialog
for handling the destination address when removing an address.
- Imported
-
lib/features/my_data/my_data_state.dart
- Renamed file to
lib/features/address/address_state.dart
to be consistent with the new address state management.
- Renamed file to
-
lib/features/address/widgets/destiny_address_dialog.dart
- New file: Added
DestinyAddressDialog
widget for selecting a destination address when removing an address with associated advertisements.
- New file: Added
-
lib/features/my_ads/my_ads_screen.dart
- Added
floatingActionButton
for adding new advertisements. - Introduced
_addNewAdvert
method to navigate to theEditAdvertScreen
.
- Added
-
lib/features/my_data/my_data_controller.dart
- Removed
MyDataState
management to simplify the controller. - Removed
_changeState
method.
- Removed
-
lib/features/my_data/my_data_screen.dart
- Added
backScreen
method to handle unsaved changes. - Refactored the screen layout to include
SimpleQuestionDialog
for unsaved changes.
- Added
-
lib/manager/address_manager.dart
- Added methods
deleteByName
,deleteById
, andgetAddressIdFromName
for better address management.
- Added methods
-
lib/repository/address_repository.dart
- Updated
delete
method to acceptaddressId
instead ofaddress
. - Added
moveAdsAddressTo
method for moving advertisements to another address. - Added
adsInAddress
method to retrieve advertisements associated with a specific address.
- Updated
-
lib/repository/advert_repository.dart
- Updated
delete
method to acceptadId
instead ofad
. - Added
moveAdsAddressTo
andadsInAddress
methods to support address management.
- Updated
-
pubspec.yaml
- Updated version to
0.5.3+23
.
- Updated version to
These changes collectively enhance the address management functionality, introduce new dialog widgets for better user interaction, and update the repository methods to handle advertisement associations with addresses.
This commit introduces several enhancements and fixes across multiple files:
-
lib/common/models/advert.dart
- Added
deleted
status to theAdvertStatus
enum.
- Added
-
lib/common/singletons/current_user.dart
- Imported
get_it.dart
. - Changed the initialization of
addressManager
to usegetIt<AddressManager>()
.
- Imported
-
lib/common/utils/extensions.dart
- Added a new extension method
onlyNumbers
toStringExtension
.
- Added a new extension method
-
lib/common/validators/validators.dart
- Imported
extensions.dart
. - Renamed
nickname
validation method toname
. - Enhanced
phone
validation to include various checks like length, area code, and valid mobile/landline number. - Added
DataValidator
class with methods for validating password, confirming password, name, and phone.
- Imported
-
lib/components/custom_drawer/custom_drawer.dart
- Removed redundant imports.
- Updated
CustomDrawer
constructor and properties. - Refactored
_navToLoginScreen
method intonavToLoginScreen
. - Adjusted
ListTile
items to usectrl.jumpToPage
.
-
lib/components/form_fields/password_form_field.dart
- Added
fullBorder
parameter toPasswordFormField
. - Conditional application of
OutlineInputBorder
.
- Added
-
lib/components/others_widgets/state_error_message.dart
- New file: Added
StateErrorMessage
widget for displaying error messages.
- New file: Added
-
lib/components/others_widgets/state_loading_message.dart
- New file: Added
StateLoadingMessage
widget for displaying loading messages.
- New file: Added
-
lib/features/address/address_controller.dart
- Changed the initialization of
addressManager
to usegetIt<AddressManager>()
.
- Changed the initialization of
-
lib/features/address/address_screen.dart
- Disabled
_removeAddress
button and added comments for future implementation.
- Disabled
-
lib/features/base/base_controller.dart
- Added
user
getter. - Refactored
jumpToPage
andsetPageTitle
methods. - Adjusted
titles
constant to reflect updated page titles.
- Added
-
lib/features/base/base_screen.dart
- Updated
titleWidget
to usectrl.pageTitle
. - Added
navToLoginScreen
method. - Replaced
CircularProgressIndicator
withStateLoadingMessage
.
- Updated
-
lib/features/login/login_screen.dart
- Added
StateErrorMessage
andStateLoadingMessage
for error and loading states. - Threw exception for unimplemented navigation actions.
- Added
-
lib/features/my_account/my_account_screen.dart
- Added imports for
AddressScreen
andMyDataScreen
. - Updated
ListTile
items to use the new screens.
- Added imports for
-
lib/features/my_ads/my_ads_controller.dart
- Commented out the call to
AdvertRepository.delete
and added a status update usingAdvertRepository.updateStatus
.
- Commented out the call to
-
lib/features/my_data/my_data_controller.dart
- New file: Added
MyDataController
for managing user data.
- New file: Added
-
lib/features/my_data/my_data_screen.dart
- New file: Added
MyDataScreen
for displaying and editing user data.
- New file: Added
-
lib/features/my_data/my_data_state.dart
- New file: Added
MyDataState
classes for representing different states inMyDataController
.
- New file: Added
-
lib/features/product/widgets/title_product.dart
- Added optional
color
parameter toTitleProduct
.
- Added optional
-
lib/features/shop/shop_screen.dart
- Added
StateErrorMessage
andStateLoadingMessage
for error and loading states. - Adjusted
FloatingActionButton
behavior to reinitialize the controller after login.
- Added
-
lib/features/signup/signup_controller.dart
- Renamed
nicknameController
tonameController
. - Updated focus nodes and controller disposal.
- Renamed
-
lib/features/signup/widgets/signup_form.dart
- Updated to use
nameController
andphoneFocusNode
.
- Updated to use
-
lib/get_it.dart
- Registered
AddressManager
as a lazy singleton.
- Registered
-
lib/manager/address_manager.dart
- Removed singleton pattern in favor of dependency injection.
-
lib/my_material_app.dart
- Added route for
MyDataScreen
.
- Added route for
-
lib/repository/advert_repository.dart
- Updated
updateStatus
method to useparse.update
.
- Updated
-
lib/repository/user_repository.dart
- Added
update
method for updating user information.
- Added
These changes collectively enhance functionality, improve code readability, and address various bugs.
Renamed Advertisement Features and Updated Navigation
-
Updated Navigation in
lib/components/custom_drawer/custom_drawer.dart
:- Changed import from
AdvertScreen
toEditAdvertScreen
. - Updated navigation from
AdvertScreen
toEditAdvertScreen
.
- Changed import from
-
Modified Navigation in
lib/features/base/base_screen.dart
:- Changed import from
AccountScreen
toMyAccountScreen
. - Updated the last screen in
PageView
toMyAccountScreen
.
- Changed import from
-
Renamed Advertisement Controller and State:
- Renamed
lib/features/advertisement/advert_controller.dart
tolib/features/edit_advert/edit_advert_controller.dart
. - Renamed
AdvertController
toEditAdvertController
. - Updated state management classes from
AdvertState
toEditAdvertState
.
- Renamed
-
Renamed Advertisement Screen:
- Renamed
lib/features/advertisement/advert_screen.dart
tolib/features/edit_advert/edit_advert_screen.dart
. - Renamed
AdvertScreen
toEditAdvertScreen
.
- Renamed
-
Updated Advertisement State Class Names:
- Renamed
lib/features/advertisement/advert_state.dart
tolib/features/edit_advert/edit_advert_state.dart
. - Updated state classes from
AdvertState
toEditAdvertState
.
- Renamed
-
Updated Advertisement Form and Widgets:
- Renamed advertisement form and widget files to
edit_advert
equivalents.
- Renamed advertisement form and widget files to
-
Renamed Account Screen:
- Renamed
lib/features/account/account_screen.dart
tolib/features/my_account/my_account_screen.dart
. - Renamed
AccountScreen
toMyAccountScreen
.
- Renamed
-
Updated References in My Ads Screen:
- Updated import and usage from
AdvertScreen
toEditAdvertScreen
.
- Updated import and usage from
-
Updated Shop Screen Navigation:
- Changed navigation from
AdvertScreen
toEditAdvertScreen
.
- Changed navigation from
-
Updated Main App Navigation:
- Changed import and route from
AccountScreen
toMyAccountScreen
. - Updated the route for advertisement screen to
EditAdvertScreen
.
- Changed import and route from
These changes refactor the advertisement feature by renaming relevant files and classes for better clarity and organization. Navigation has been updated accordingly to reflect these changes.
Enhanced Advertisement Features and Refactoring
-
lib/common/app_constants.dart
- Created a new file to define the
AppPage
enum with valuesshopePage
,chatPage
,favoritesPage
, andaccountPage
for better navigation handling.
- Created a new file to define the
-
lib/components/buttons/big_button.dart
- Updated the button's
borderRadius
to 32 for a more rounded appearance.
- Updated the button's
-
lib/components/custom_drawer/custom_drawer.dart
- Imported
AppPage
enum fromapp_constants.dart
andAdvertScreen
. - Replaced hard-coded page numbers with
AppPage
enum values for improved readability and maintainability.
- Imported
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart
- Added
editAd
anddeleteAd
callbacks to handle advertisement editing and deletion. - Removed logging and simplified button actions to call the new callbacks.
- Added
-
lib/features/account/account_screen.dart
- Imported
AppPage
enum fromapp_constants.dart
. - Replaced hard-coded page number with
AppPage.shopePage
for navigation after logout.
- Imported
-
lib/features/advertisement/advert_controller.dart
- Updated
init
method to usesetSelectedAddress
for setting the address. - Improved
removeImage
method to handle both URL and local file deletion. - Added
updateAds
method to update an existing advertisement. - Renamed
createAnnounce
tocreateAds
and adjusted its implementation.
- Updated
-
lib/features/advertisement/advert_screen.dart
- Added an AppBar with dynamic title based on whether the ad is new or being edited.
- Updated
_createAnnounce
method to handle both ad creation and updating, returning to the previous screen with the updated ad.
-
lib/features/advertisement/widgets/advert_form.dart
- Updated icons in
SegmentedButton
for better representation ofAdvertStatus
values.
- Updated icons in
-
lib/features/advertisement/widgets/horizontal_image_gallery.dart
- Added
showImage
method to handle displaying both network and local images. - Adjusted
_showImageEditDialog
to show either a network or local image based on the URL pattern.
- Added
-
lib/features/advertisement/widgets/image_list_view.dart
- Added
editAd
anddeleteAd
callbacks for handling ad editing and deletion.
- Added
-
lib/features/base/base_controller.dart
- Imported
AppPage
enum fromapp_constants.dart
. - Replaced
_page
type fromint
toAppPage
for better type safety and readability.
- Imported
-
lib/features/base/base_screen.dart
- Imported
AppPage
enum fromapp_constants.dart
. - Updated various navigation references to use
AppPage
enum values.
- Imported
-
lib/features/my_ads/my_ads_controller.dart
- Implemented
updateAd
method to refresh ads after an update. - Implemented
deleteAd
method to delete an advertisement and refresh the ads list.
- Implemented
-
lib/features/my_ads/my_ads_screen.dart
- Added methods
_editAd
and_deleteAd
to handle editing and deletion of advertisements with confirmation dialogs. - Updated
MyTabBarView
usage to includeeditAd
anddeleteAd
callbacks.
- Added methods
-
lib/features/my_ads/widgets/my_tab_bar.dart
- Updated icons in
Tab
widgets for better representation of advertisement statuses.
- Updated icons in
-
lib/features/my_ads/widgets/my_tab_bar_view.dart
- Added
editAd
anddeleteAd
callbacks toAdListView
.
- Added
-
lib/features/shop/shop_screen.dart
- Imported
AdvertScreen
. - Updated
FloatingActionButton
to navigate toAdvertScreen
for adding a new advertisement.
- Imported
-
lib/repository/advert_repository.dart
- Added
update
method to update an advertisement on the Parse server. - Improved
_saveImages
method to correctly identify URL patterns. - Added
delete
method to delete an advertisement from the Parse server.
- Added
These changes enhance the advertisement management features by improving navigation with the AppPage
enum, adding capabilities for editing and deleting ads, and refining the UI components for better user experience and maintainability. The refactor also ensures the codebase is more readable and easier to manage.
Enhanced Advertisement Features and Refactoring
-
lib/common/models/advert.dart
- Reordered the
title
property to appear beforestatus
in theAdvertModel
class for consistency.
- Reordered the
-
lib/components/custon_field_controllers/currency_text_controller.dart
- Added
currencyValue
setter to update the text value of the controller based on the provided currency value. This simplifies setting the currency value programmatically.
- Added
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart
- Imported
dart:developer
for logging purposes. - Added
ButtonBehavior
enum to define possible button actions (edit
,delete
). - Replaced
itemButton
parameter withbuttonBehavior
to handle different button actions dynamically. - Added
getItemButton
method to generate the appropriate button widget based onbuttonBehavior
. - Enhanced logging to include the length of ads list to aid in debugging and monitoring the list state.
- Imported
-
lib/components/others_widgets/ad_list_view/widgets/ad_card_view.dart
- Updated the
Card
widget with ashape
property, applyingRoundedRectangleBorder
to provide rounded corners for better visual appeal.
- Updated the
-
lib/features/advertisement/advert_controller.dart
- Added
init
method to initialize the controller with anAdvertModel
instance, populating various fields liketitle
,description
,hidePhone
,price
,status
,mechanicsId
,address
, andimages
. - Added
setImages
method to set the list of images in the controller, updating the_images
list and notifying listeners.
- Added
-
lib/features/advertisement/advert_screen.dart
- Updated constructor to accept an optional
AdvertModel
instance, allowing the screen to display and edit existing advertisements. - Added initialization of
AdvertController
with the providedAdvertModel
instance ininitState
to pre-fill the form fields with existing data.
- Updated constructor to accept an optional
-
lib/features/my_ads/my_ads_controller.dart
- Added placeholder methods
updateAd
anddeleteAd
with TODO comments indicating future implementation plans for updating and deleting advertisements.
- Added placeholder methods
-
lib/features/my_ads/my_ads_screen.dart
- Refactored to replace direct usage of
TabBar
andTabBarView
with custom widgetsMyTabBar
andMyTabBarView
to improve code modularity and readability. - Added custom
MyTabBar
widget to handle tab selection and update the product status in the controller. - Added custom
MyTabBarView
widget to display advertisements based on their status, with configurable dismissible actions and button behaviors.
- Refactored to replace direct usage of
-
lib/features/my_ads/widgets/my_tab_bar.dart
- Implements a custom
TabBar
widget that maps tab selection to product status changes in theMyAdsController
.
- Implements a custom
-
lib/features/my_ads/widgets/my_tab_bar_view.dart
- Implements a custom
TabBarView
widget that displays a list of advertisements with different statuses, usingAdListView
with configurable actions for each tab.
- Implements a custom
-
lib/my_material_app.dart
- Updated routing logic to handle
AdvertScreen
navigation, passing anAdvertModel
instance when navigating to allow for ad editing. - Simplified
onGenerateRoute
method for better readability, ensuring all routes handle their respective arguments correctly.
- Updated routing logic to handle
These changes enhance the advertisement management capabilities by adding the ability to edit and delete ads directly from the list, initializing controllers with existing ad data, and modularizing the UI components for better code organization and maintainability. The refactor also improves the overall user experience by making the UI more intuitive and the codebase easier to maintain and extend.
Improved Advertisement Management and Code Refactoring
-
lib/common/basic_controller/basic_controller.dart
- Added:
Future<bool> updateAdStatus(AdvertModel ad)
method to update advertisement status.
- Added:
-
lib/common/singletons/current_user.dart
- Imported:
foundation.dart
to useValueNotifier
. - Added:
_isLoged
asValueNotifier<bool>
to manage login state. - Updated:
isLoged
to use_isLoged.value
and addedisLogedListernable
getter. - Modified:
init
method to update_isLoged.value
upon initialization. - Added:
dispose
method to dispose of_isLoged
. - Updated:
logout
method to set_isLoged.value
to false.
- Imported:
-
lib/components/custom_drawer/custom_drawer.dart
- Updated: Menu item text from 'Inserir AnĂşncio' to 'Adicionar AnĂşncio'.
-
lib/features/shop/widgets/ad_list_view.dart
- Renamed: File to
lib/components/others_widgets/ad_list_view/ad_list_view.dart
. - Replaced:
ShopController
withBasicController
. - Enhanced:
AdListView
with new parameters for dismissible ads and additional properties.
- Renamed: File to
-
lib/components/others_widgets/ad_list_view/widgets/ad_card_view.dart
- New File: Handles the display of advertisement cards with various properties.
-
lib/components/others_widgets/ad_list_view/widgets/dismissible_ad.dart
- New File: Manages dismissible ads with customizable actions and status updates.
-
lib/components/others_widgets/ad_list_view/widgets/show_image.dart
- New File: Manages image display with a fallback for empty images.
-
lib/components/others_widgets/base_dismissible_container.dart
- New File: Provides a base container for dismissible actions in the UI.
-
lib/components/others_widgets/fitted_button_segment.dart
- New File: Defines a fitted button segment for use in segmented controls.
-
lib/features/advertisement/advert_controller.dart
- Added:
_adStatus
property and corresponding getter. - Refactored: Moved
_changeState
method to a different position. - Updated:
saveAd
method to includestatus
property. - Added:
setAdStatus
method to update advertisement status.
- Added:
-
lib/features/advertisement/advert_screen.dart
- Wrapped:
AdvertForm
andBigButton
inside aColumn
for better structure.
- Wrapped:
-
lib/features/advertisement/widgets/advert_form.dart
- Imported:
fitted_button_segment.dart
for custom button segments. - Added: Segmented button for selecting
AdvertStatus
.
- Imported:
-
lib/features/base/base_controller.dart
- Updated: Title from 'Criar AnĂşncio' to 'Adicionar AnĂşncio' for consistency.
-
lib/features/my_ads/my_ads_controller.dart
- Refactored:
getAds
method to use a helper method_getAds
. - Added:
_getAds
and_getMoreAds
helper methods for better code organization. - Added:
updateAdStatus
method to handle advertisement status updates.
- Refactored:
-
lib/features/my_ads/my_ads_screen.dart
- Enhanced:
AdListView
to support dismissible ads with custom status updates and icons. - Added:
physics
property toTabBarView
to disable scrolling.
- Enhanced:
-
lib/features/shop/shop_controller.dart
- Refactored:
getAds
method to reset_adPage
and clear ads. - Added:
updateAdStatus
method withUnimplementedError
.
- Refactored:
-
lib/features/shop/shop_screen.dart
- Updated: Import path for
ad_list_view.dart
. - Added:
ValueListenableBuilder
to manageFloatingActionButton
state based on login status.
- Updated: Import path for
-
lib/features/shop/widgets/ad_text_price.dart
- Removed: Unused
colorScheme
variable. - Updated: Text style for better readability.
- Removed: Unused
-
lib/features/shop/widgets/ad_text_title.dart
- Changed:
maxLines
from 3 to 2 for better layout consistency.
- Changed:
-
lib/get_it.dart
- Added:
dispose
call forCurrentUser
.
- Added:
-
lib/my_material_app.dart
- Changed: Main font from "Poppins" to "Manrope" for a refreshed UI look.
-
lib/repository/advert_repository.dart
- Added:
updateStatus
method to update advertisement status in the Parse server.
- Added:
These changes enhance the advertisement management capabilities by adding new functionalities and refactoring the code for better maintainability and usability. The updates improve user experience and ensure consistent behavior across the application.
This commit includes several adjustments to animations, a reduction in the number of AdvertStatus
options, and various other enhancements to improve code consistency and functionality. Changes:
-
lib/common/models/advert.dart
- Removed
AdvertStatus.closed
from theAdvertStatus
enum.
- Removed
-
lib/common/theme/app_text_style.dart
- Added
font14Thin
style for thinner text with font size 14.
- Added
-
lib/features/my_ads/my_ads_controller.dart
- Added properties
_adPage
,_getMorePages
, andgetMorePages
. - Implemented logic to fetch additional pages of advertisements in
getMoreAds
.
- Added properties
-
lib/features/my_ads/my_ads_screen.dart
- Updated
TabBar
length to 3 to remove the unnecessary "Fechados" tab. - Adjusted text styles for consistency.
- Enhanced error and loading state handling.
- Updated
-
lib/features/product/product_screen.dart
- Adjusted
AnimationController
duration forFloatingActionButton
to 300 milliseconds. - Simplified scroll notification handling logic.
- Adjusted
-
lib/features/shop/shop_controller.dart
- Refactored to extend
BasicController
and useBasicState
for state management. - Added initialization and pagination logic for fetching advertisements.
- Refactored to extend
-
lib/features/shop/shop_screen.dart
- Refactored to integrate
BasicState
for consistent state management. - Updated
AnimationController
duration and scroll listener logic. - Improved
FloatingActionButton
animation and visibility handling.
- Refactored to integrate
-
lib/my_material_app.dart
- Changed the text theme order in
createTextTheme
to prioritize "Poppins" over "Comfortaa".
- Changed the text theme order in
-
lib/repository/advert_repository.dart
- Removed the
maxAdsPerList
constant and relocated it toconstants.dart
.
- Removed the
-
lib/repository/constants.dart
- Added
maxAdsPerList
constant and set its value to 5 for better performance during testing.
- Added
Standardized animations for FloatingActionButton
, streamlined advertisement status options, and improved overall state management and UI consistency across various features.
This commit introduces several new files and modifications to the existing codebase, adding functionalities and enhancements, including dependency injection with get_it
. Changes:
-
lib/common/basic_controller/basic_controller.dart
- Added new file with
BasicController
abstract class. - Defined state management and basic functionalities such as
changeState
,init
,getAds
, andgetMoreAds
.
- Added new file with
-
lib/common/basic_controller/basic_state.dart
- Added new file defining
BasicState
abstract class and its concrete implementations:BasicStateInitial
,BasicStateLoading
,BasicStateSuccess
, andBasicStateError
.
- Added new file defining
-
lib/common/models/address.dart
- Added
import 'dart:convert';
. - Included
createdAt
property inAddressModel
. - Modified constructor to initialize
createdAt
. - Updated
toString
,==
, andhashCode
methods to includecreatedAt
. - Added
copyWith
method. - Added
toMap
,fromMap
,toJson
, andfromJson
methods for serialization.
- Added
-
lib/common/models/user.dart
- Removed commented out
UserType type;
and related code. - Simplified constructor initialization.
- Removed commented out
-
lib/common/singletons/app_settings.dart
- Refactored
AppSettings
to remove singleton pattern, allowing for direct instantiation.
- Refactored
-
lib/common/singletons/current_user.dart
- Refactored
CurrentUser
to remove singleton pattern, allowing for direct instantiation. - Added
logout
method to handle user logout.
- Refactored
-
lib/common/singletons/search_filter.dart
- Refactored
SearchFilter
to remove singleton pattern, allowing for direct instantiation. - Added
dispose
method to clean up resources.
- Refactored
-
lib/common/singletons/search_history.dart
- Refactored
SearchHistory
to remove singleton pattern, allowing for direct instantiation.
- Refactored
-
lib/components/custom_drawer/custom_drawer.dart
- Updated imports and added dependency injection with
getIt
. - Refactored navigation methods to use
jumpToPage
fromBaseController
. - Enhanced
ListTile
widgets to conditionally enable/disable based on user login status.
- Updated imports and added dependency injection with
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart
- Updated imports and added dependency injection with
getIt
. - Refactored
isLogin
toisLoged
for better readability.
- Updated imports and added dependency injection with
-
lib/features/account/account_screen.dart
- Converted
AccountScreen
to aStatefulWidget
. - Implemented user information display and various action items.
- Converted
-
lib/features/advertisement/advert_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/base/base_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/base/base_screen.dart
- Refactored
BaseScreen
to use dependency injection withgetIt
. - Removed redundant
_changeToPage
method and updatedCustomDrawer
.
- Refactored
-
lib/features/base/widgets/search_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/base/widgets/search_dialog.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/login/login_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/my_ads/my_ads_controller.dart
- Added new file with
MyAdsController
extendingBasicController
. - Implemented
init
,getAds
,getMoreAds
, andsetProductStatus
methods.
- Added new file with
-
lib/features/my_ads/my_ads_screen.dart
- Added new file with
MyAdsScreen
implementing a stateful widget. - Integrated
MyAdsController
and implemented UI with tabs for different ad statuses.
- Added new file with
-
lib/features/my_ads/my_ads_state.dart
- Added new file defining
MyAdsState
abstract class and its concrete implementations:MyAdsStateInitial
,MyAdsStateLoading
,MyAdsStateSuccess
, andMyAdsStateError
.
- Added new file defining
-
lib/features/my_ads/widgets/my_ad_list_view.dart
- Added new file implementing
AdListView
widget with scroll and image handling capabilities.
- Added new file implementing
-
lib/features/new_address/new_address_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/shop/shop_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/features/shop/shop_screen.dart
- Refactored
ShopScreen
to use dependency injection withgetIt
. - Removed redundant
changeToPage
method.
- Refactored
-
lib/features/signup/signup_controller.dart
- Updated imports and added dependency injection with
getIt
.
- Updated imports and added dependency injection with
-
lib/get_it.dart
- Added new file to setup and dispose dependencies using
get_it
.
- Added new file to setup and dispose dependencies using
-
lib/main.dart
- Integrated
get_it
for dependency injection. - Updated initialization to use
setupDependencies
.
- Integrated
-
lib/my_material_app.dart
- Updated imports and added dependency injection with
getIt
. - Refactored
initialRoute
andonGenerateRoute
for better route management.
- Updated imports and added dependency injection with
-
lib/repository/address_repository.dart
- Added a comment for potential fix regarding
toPointer
usage.
- Added a comment for potential fix regarding
-
lib/repository/advert_repository.dart
- Added
getMyAds
method to fetch user-specific advertisements. - Refactored query logic to use consistent naming conventions.
- Added
-
lib/repository/constants.dart
- Added
keyAddressCreatedAt
constant.
- Added
-
lib/repository/parse_to_model.dart
- Updated
ParseToModel
methods to includecreatedAt
property.
- Updated
-
pubspec.lock
- Added
get_it
dependency.
- Added
-
pubspec.yaml
- Added
get_it
to dependencies.
- Added
Implemented new controllers, refactored singletons to use dependency injection, enhanced UI components, and integrated get_it
for dependency management, improving state management and overall code maintainability.
This commit introduces enhancements to the Product and Shop screens, adds a new ReadMoreText component, and adjusts the theme colors.
-
lib/common/theme/app_text_style.dart
- Added new text styles:
font24
,font24SemiBold
, andfont24Bold
.
- Added new text styles:
-
lib/common/theme/theme.dart
- Updated various color definitions for better UI consistency:
primaryContainer
,secondary
,primaryFixed
,tertiaryFixedDim
,onPrimaryFixedVariant
,surfaceContainer
, and others.
- Updated various color definitions for better UI consistency:
-
lib/components/custom_drawer/custom_drawer.dart
- Changed the icon for 'Inserir AnĂşncio' from
Icons.edit
toIcons.camera
.
- Changed the icon for 'Inserir AnĂşncio' from
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart
- Wrapped texts in
FittedBox
for better scaling and to ensure the text fits within the designated area.
- Wrapped texts in
-
lib/components/customs_text/read_more_text.dart
- Added the new
ReadMoreText
component for handling expandable text with 'read more' and 'show less' functionality.
- Added the new
-
lib/features/base/base_screen.dart
- Updated
PageView
children to includeShopScreen(_changeToPage)
and modified theShopScreen
instantiation.
- Updated
-
lib/features/product/product_screen.dart
- Converted
ProductScreen
to aStatefulWidget
to manage animations for floating action buttons. - Added a floating action button for contacting the advertiser via phone or chat.
- Introduced various product detail widgets:
PriceProduct
,TitleProduct
,DescriptionProduct
,LocationProduct
, andUserCard
.
- Converted
-
lib/features/product/widgets/description_product.dart
- Created
DescriptionProduct
widget using theReadMoreText
component.
- Created
-
lib/features/product/widgets/duo_segmented_button.dart
- Created
DuoSegmentedButton
widget for segmented button functionality.
- Created
-
lib/features/product/widgets/image_carousel.dart
- Created
ImageCarousel
widget for displaying product images usingcarousel_slider
.
- Created
-
lib/features/product/widgets/location_product.dart
- Created
LocationProduct
widget for displaying product location details.
- Created
-
lib/features/product/widgets/price_product.dart
- Created
PriceProduct
widget for displaying product price.
- Created
-
lib/features/product/widgets/sub_title_product.dart
- Created
SubTitleProduct
widget for displaying subtitles in product details.
- Created
-
lib/features/product/widgets/title_product.dart
- Created
TitleProduct
widget for displaying the product title.
- Created
-
lib/features/product/widgets/user_card_product.dart
- Created
UserCard
widget for displaying user information related to the product.
- Created
-
lib/features/shop/shop_screen.dart
- Updated
ShopScreen
to manage animations for floating action buttons. - Added a floating action button to navigate to the advertisement screen.
- Updated
-
lib/features/shop/widgets/ad_list_view.dart
- Updated
AdListView
to use the sharedScrollController
for handling list view scroll behavior. - Added
InkWell
to navigate to theProductScreen
on ad click.
- Updated
-
lib/features/shop/widgets/ad_text_price.dart
- Removed unnecessary padding and updated text style for ad price.
-
lib/features/shop/widgets/ad_text_title.dart
- Removed unnecessary padding and updated text style for ad title.
-
lib/my_material_app.dart
- Changed default text theme from "Nunito Sans" to "Comfortaa".
- Updated route handling for
ShopScreen
to pass a callback for page changes.
-
pubspec.yaml and pubspec.lock
- Added dependency for
carousel_slider
version4.2.1
.
- Added dependency for
These changes enhance the user experience by improving the UI consistency, adding new functionalities, and optimizing existing components.
Refactored Parse Server integration for improved error handling and code maintainability. Changes made:
-
lib/common/parse_server/errors_mensages.dart
- Modified
ParserServerErrors.message
to accept aString
parameter. - Added logic to identify specific error messages.
- Modified
-
lib/common/singletons/current_user.dart
- Updated method names in
CurrentUser
to align withAddressManager
.
- Updated method names in
-
lib/components/custom_drawer/custom_drawer.dart
- Ensured drawer closes after logout.
-
lib/features/address/address_controller.dart
- Updated method calls to match
AddressManager
changes.
- Updated method calls to match
-
lib/features/home/home_controller.dart
- Changed method calls in
HomeController
to useAdvertRepository.get
.
- Changed method calls in
-
lib/features/login/login_screen.dart
- Adjusted error message handling to pass
String
.
- Adjusted error message handling to pass
-
lib/features/signup/signup_controller.dart
- Separated user signup and state change logic.
-
lib/features/signup/signup_screen.dart
- Updated error handling to pass
String
.
- Updated error handling to pass
-
lib/manager/address_manager.dart
- Added comments and updated methods for address operations.
-
lib/manager/mechanics_manager.dart
- Added logging and improved error handling.
-
lib/manager/state_manager.dart
- Added comments for clarity.
-
lib/repository/address_repository.dart
- Enhanced logging and exception messages.
- Updated methods to ensure consistency and clarity.
-
lib/repository/advert_repository.dart
- Improved logging and error handling.
- Added method comments for better understanding.
-
lib/repository/ibge_repository.dart
- Enhanced logging and exception handling.
- Added method comments for clarity.
-
lib/repository/mechanic_repository.dart
- Improved logging and error handling.
- Removed redundant parsing method.
-
lib/repository/parse_to_model.dart
- Added comments to methods for better understanding.
- Updated parsing logic for
AdvertModel
.
-
lib/repository/user_repository.dart
- Enhanced logging and error handling.
- Added
_checksPermissions
method to handle ACL settings.
-
lib/repository/viacep_repository.dart
- Enhanced logging and error handling.
- Updated method to clean CEP and handle exceptions.
This commit refactors various parts of the code related to Parse Server integration. It improves error handling, logging, and overall code maintainability by adding comments and ensuring consistent method usage.
Updated various project files to enhance functionality and improve maintainability.
-
android/app/build.gradle
- Updated
flutterVersionCode
andflutterVersionName
initialization to include default values. - Changed
namespace
andapplicationId
. - Added lint options for Java compilation.
- Added dependency for
ucrop
library.
- Updated
-
android/app/src/main/AndroidManifest.xml
- Added
package
attribute to the manifest tag.
- Added
-
android/app/src/main/kotlin/com/example/bgbazzar/MainActivity.kt
- Updated package name.
-
android/build.gradle
- Added Kotlin version and dependencies.
- Updated Gradle plugin version.
-
android/gradle.properties
- Added lint option for deprecation warnings.
- Suppressed unsupported compile SDK warning.
-
android/gradle/wrapper/gradle-wrapper.properties
- Updated Gradle distribution URL.
-
lib/common/app_info.dart
- Created a new file to handle application information and utilities such as URL launching and copying.
-
lib/common/models/address.dart
- Removed unused imports and JSON conversion methods.
-
lib/common/models/advert.dart
- Updated model structure to use
UserModel
for owner andAddressModel
for address. - Reorganized fields.
- Updated model structure to use
-
lib/common/models/filter.dart
- Added
setFilter
method to update filter model.
- Added
-
lib/common/models/user.dart
- Removed unused imports and JSON conversion methods.
-
lib/common/parse_server/errors_mensages.dart
- Removed logging.
-
lib/common/singletons/app_settings.dart
- Removed unused fields and methods.
-
lib/common/singletons/search_filter.dart
- Created a new singleton to manage search filter state.
-
lib/common/singletons/search_history.dart
- Removed logging.
-
lib/common/theme/app_text_style.dart
- Created a new file to manage application text styles.
-
lib/common/theme/text_styles.dart renamed to lib/common/utils/extensions.dart
- Renamed file and converted to manage number and datetime extensions.
-
lib/components/custom_drawer/custom_drawer.dart
- Added a new logout option in the drawer menu.
-
lib/features/advertisement/advert_controller.dart
- Updated model usage for creating advertisements.
-
lib/features/advertisement/widgets/horizontal_image_gallery.dart
- Removed logging.
-
lib/features/base/base_controller.dart
- Integrated
SearchFilter
singleton. - Updated search handling methods.
- Integrated
-
lib/features/base/base_screen.dart
- Integrated
SearchFilter
and added actions for search and filter management.
- Integrated
-
lib/features/base/widgets/search_controller.dart
- Removed logging.
-
lib/features/base/widgets/search_dialog.dart
- Removed commented code and logging.
-
lib/features/base/widgets/search_dialog_bar.dart
- Removed logging.
-
lib/features/filters/widgets/text_title.dart
- Updated import to use new text styles.
-
lib/features/home/home_controller.dart
- Integrated
SearchFilter
and updated advertisement fetching logic.
- Integrated
-
lib/features/home/home_screen.dart
- Integrated
AdListView
for displaying advertisements.
- Integrated
-
lib/features/home/widgets/ad_list_view.dart
- Created a new widget to manage advertisement list view.
-
lib/features/home/widgets/ad_text_info.dart
- Created a new widget for displaying advertisement info.
-
lib/features/home/widgets/ad_text_price.dart
- Created a new widget for displaying advertisement price.
-
lib/features/home/widgets/ad_text_subtitle.dart
- Created a new widget for displaying advertisement subtitle.
-
lib/features/home/widgets/ad_text_title.dart
- Created a new widget for displaying advertisement title.
-
lib/features/signup/signup_screen.dart
- Removed logging.
-
lib/my_material_app.dart
- Added localization support.
- Removed logging.
-
lib/repository/address_repository.dart
- Refactored to use
ParseToModel
for model conversion. - Removed redundant logging.
- Refactored to use
-
lib/repository/advert_repository.dart
- Refactored to use
ParseToModel
for model conversion. - Added pagination support for fetching advertisements.
- Refactored to use
-
lib/repository/parse_to_model.dart
- Created a new utility class for converting Parse objects to models.
-
lib/repository/user_repository.dart
- Refactored to use
ParseToModel
for model conversion. - Added logout method.
- Refactored to use
-
linux/flutter/generated_plugin_registrant.cc
- Added URL launcher plugin registration.
-
linux/flutter/generated_plugins.cmake
- Added URL launcher plugin.
-
macos/Flutter/GeneratedPluginRegistrant.swift
- Added URL launcher and SQLite plugins registration.
-
pubspec.lock
- Updated dependencies and added new ones for cached network image, URL launcher, SQLite, and localization support.
-
pubspec.yaml
- Updated version and added new dependencies for cached network image, URL launcher, and localization support.
-
windows/flutter/generated_plugin_registrant.cc
- Added URL launcher plugin registration.
-
windows/flutter/generated_plugins.cmake
- Added URL launcher plugin.
-
lib/common/models/address.dart
- Removed redundant methods
toMap
,fromMap
,toJson
, andfromJson
.
- Removed redundant methods
-
lib/common/models/advert.dart
- Consolidated imports and refactored field organization for better readability and maintainability.
-
lib/common/models/user.dart
- Removed redundant methods
toMap
,fromMap
,toJson
, andfromJson
.
- Removed redundant methods
-
lib/common/parse_server/errors_mensages.dart
- Streamlined the error message handling by removing the unnecessary logging of errors.
-
lib/features/home/home_screen.dart
- Updated the
HomeScreen
layout and integrated theAdListView
to improve user experience and performance.
- Updated the
-
lib/repository/address_repository.dart
- Improved exception handling and removed redundant code for better code quality.
-
lib/repository/advert_repository.dart
- Added pagination and improved the handling of search and filter functionality to enhance the user experience.
-
lib/repository/user_repository.dart
- Enhanced user management with a logout method and improved exception handling.
-
pubspec.lock
- Added
intl_utils
and updated various dependencies to ensure compatibility and leverage new features.
- Added
-
pubspec.yaml
- Added dependencies for
intl_utils
to facilitate localization and formatting utilities.
- Added dependencies for
This commit finalizes the enhancements to the project by ensuring all necessary changes are included and properly documented. The updates improve the application's functionality, maintainability, and user experience by integrating new dependencies, refactoring code, and enhancing existing features.
Introduced ProductCondition
Enum and Refactored Advert
Models.
-
lib/common/models/advert.dart
- Renamed
AdStatus
toAdvertStatus
. - Added new
ProductCondition
enum. - Updated
AdvertModel
to includecondition
property with default valueProductCondition.all
. - Modified constructor to initialize
condition
. - Updated
toString
method to includecondition
.
- Renamed
-
lib/common/models/filter.dart
- Imported
advert.dart
. - Removed
AdvertiserOrder
enum. - Updated
FilterModel
to includecondition
property with default valueProductCondition.all
. - Modified constructor to initialize
condition
. - Updated
isEmpty
,toString
,==
, andhashCode
methods to includecondition
.
- Imported
-
lib/common/models/user.dart
- Commented out
UserType
enum. - Removed
type
property fromUserModel
and related methods.
- Commented out
-
lib/common/singletons/app_settings.dart
- Added
search
property toAppSettings
.
- Added
-
lib/features/advertisement/advert_controller.dart
- Added
_condition
property with default valueProductCondition.used
. - Added getter for
condition
. - Updated
saveAdvert
method to includecondition
. - Added
setCondition
method.
- Added
-
lib/features/advertisement/widgets/advert_form.dart
- Imported
advert.dart
. - Updated variable name
controller
toctrl
. - Added UI components to select product condition.
- Updated form fields to use
ctrl
.
- Imported
-
lib/features/base/base_controller.dart
- Updated
search
property to useapp.search
. - Updated
setSearch
method to useapp.search
.
- Updated
-
lib/features/filters/filters_controller.dart
- Imported
advert.dart
. - Updated
advertiser
property and related methods to usecondition
.
- Imported
-
lib/features/filters/filters_screen.dart
- Imported
advert.dart
. - Updated UI components to select product condition instead of advertiser.
- Imported
-
lib/features/home/home_controller.dart
- Imported
filter.dart
. - Added
filter
property toHomeController
. - Updated
search
property to useapp.search
.
- Imported
-
lib/features/home/home_screen.dart
- Imported
advert_repository.dart
. - Updated floating action button to perform search using
AdvertRepository
.
- Imported
-
lib/repository/advert_repository.dart
- Added
getAdvertisements
method to fetch ads based on filter and search criteria. - Updated
save
method to includecondition
. - Updated
_parserServerToAdSale
method to parsecondition
.
- Added
-
lib/repository/constants.dart
- Added
keyAdvertCondition
constant.
- Added
-
lib/repository/user_repository.dart
- Commented out
type
property setting and retrieval inUserRepository
.
- Commented out
-
lib/features/home/home_screen.dart
- Updated the floating action button to fetch advertisements using the new
filter
property inHomeController
. - Updated the navigation to the
FiltersScreen
to pass and receive the updatedfilter
property.
- Updated the floating action button to fetch advertisements using the new
-
lib/repository/advert_repository.dart
- Added filtering logic in
getAdvertisements
to considerProductCondition
. - Ensured all advertisement-related operations include the new
condition
property. - Updated parsing logic to correctly handle
condition
values from the server.
- Added filtering logic in
These changes enhance the flexibility of the advertisement system by allowing users to filter ads based on the condition of the product. This refactoring also simplifies the advertisement model by consolidating advertiser-related properties into the condition. Introduces the ProductCondition
enum and refactors several models and controllers to support this new property, enhancing the filtering capabilities of advertisements.
Add enhancements and refactor filter and home functionalities
-
lib/common/models/filter.dart
- Imported
foundation.dart
forlistEquals
. - Added
minPrice
andmaxPrice
toFilterModel
. - Modified the constructor to initialize
state
,city
,sortBy
,advertiser
,mechanicsId
,minPrice
, andmaxPrice
with default values. - Added
isEmpty
getter to check if the filter is empty. - Overrode
toString
,==
, andhashCode
to includeminPrice
andmaxPrice
.
- Imported
-
lib/components/custon_field_controllers/currency_text_controller.dart
- Added
decimalDigits
parameter to control the number of decimal places. - Updated
_formatter
to usecurrency
instead ofsimpleCurrency
. - Updated
_applyMask
andcurrencyValue
methods to use_getDivisionFactor
. - Added
_getDivisionFactor
method to calculate the division factor based ondecimalDigits
.
- Added
-
lib/features/filters/filters_controller.dart
- Imported
filter.dart
andcurrency_text_controller.dart
. - Added
minPriceController
andmaxPriceController
for handling price input. - Updated
init
method to accept an optionalFilterModel
. - Added
setInitialValues
method to set initial values for the filter. - Updated
submitState
andsubmitCity
methods to handle exceptions. - Updated
mechUpdateNames
method to use_joinMechNames
. - Removed unnecessary log statements.
- Imported
-
lib/features/filters/filters_screen.dart
- Updated constructor to accept a
FilterModel
. - Updated
initState
to callctrl.init
with the provided filter. - Updated
_sendFilter
method to usectrl.filter
. - Added UI components for min and max price input.
- Added validation for price range.
- Updated constructor to accept a
-
lib/features/filters/widgets/text_form_dropdown.dart
- Added
focusNode
parameter toTextFormDropdown
.
- Added
-
lib/features/home/home_controller.dart
- Removed unused methods and properties related to mechanics.
-
lib/features/home/home_screen.dart
- Updated the filter button to pass the current filter to the
FiltersScreen
. - Removed mechanics-related UI components.
- Updated the filter button to pass the current filter to the
-
lib/features/new_address/new_address_screen.dart
- Removed commented-out code.
-
lib/my_material_app.dart
- Updated
onGenerateRoute
to pass theFilterModel
to theFiltersScreen
.
- Updated
-
lib/features/filters/filters_screen.dart
- Enhanced the
FiltersScreen
UI to include new fields for price range filtering. - Added input validation for the price range to ensure logical consistency between min and max prices.
- Adjusted the
FilterModel
handling to accommodate new fields and ensure existing filter states are preserved during navigation and state changes.
- Enhanced the
-
lib/features/home/home_controller.dart
- Simplified the
HomeController
by removing mechanics-related methods and properties, focusing it solely on managing the home screen state.
- Simplified the
-
lib/features/home/home_screen.dart
- Enhanced the filter button functionality to display the current filter state.
- Simplified the UI by removing mechanics-related buttons, focusing the user interface on the primary filtering functionality.
-
lib/features/new_address/new_address_screen.dart
- Cleaned up the code by removing commented-out lines, ensuring a cleaner and more maintainable codebase.
-
lib/my_material_app.dart
- Updated the routing logic to correctly pass and handle
FilterModel
instances when navigating to theFiltersScreen
. - Included additional logging for debugging purposes, ensuring better traceability of filter state throughout the application.
- Updated the routing logic to correctly pass and handle
These updates collectively enhance the app's structure and overall architecture, improve user experience through better search and filter functionalities, and maintain consistency across the application codebase. The changes reflect ongoing efforts to provide robust and user-friendly features while ensuring a clean, maintainable, and high-performance application.
Add functionalities and general refactorings
-
Added Makefile:
- Commands to manage Docker (
docker_up
anddocker_down
). - Commands for Flutter clean (
flutter_clean
). - Commands for Git operations (
git_cached
,git_commit
, andgit_push
).
- Commands to manage Docker (
-
Added
FilterModel
inlib/common/models/filter.dart
:- Modeling filters for advertisements.
-
Refactored file and class names:
- Renamed
lib/common/models/uf.dart
tolib/common/models/state.dart
and updated class name fromUFModel
toStateBrModel
.
- Renamed
-
Added
SearchHistory
singleton inlib/common/singletons/search_history.dart
:- Manages search history with SharedPreferences.
-
Added
TextStyles
inlib/common/theme/text_styles.dart
:- Defined common text styles for the application.
-
Updated
advert_screen.dart
:- Removed unnecessary logging.
- Integrated new state management for advertisement creation.
-
Enhanced
BaseController
andBaseScreen
:- Added search functionality and integrated
SearchDialog
.
- Added search functionality and integrated
-
Added
SearchDialogController
andSearchDialog
widget:- Manages search functionality and history display.
-
Added
FiltersController
andFiltersScreen
:- Allows filtering advertisements by location, sorting, and mechanics.
-
Updated
mechanics_manager.dart
:- Added methods to retrieve mechanics names by IDs.
-
General updates and bug fixes:
- Improved state handling and UI updates.
- Refactored method names for clarity and consistency.
-
Updated
pubspec.yaml
version to 0.3.2+8. -
Updated
home_screen.dart
:- Integrated
HomeController
for state management. - Added segmented buttons for mechanics and filter selection.
- Implemented navigation to
MecanicsScreen
andFiltersScreen
.
- Integrated
-
Added
home_controller.dart
andhome_state.dart
:- Managed home screen state and mechanics selection.
-
Updated
main.dart
:- Initialized
SearchHistory
during app startup.
- Initialized
-
Updated
state_manager.dart
:- Renamed methods and classes to match updated state model.
-
Updated
my_material_app.dart
:- Added route for
FiltersScreen
.
- Added route for
-
Updated
ibge_repository.dart
:- Renamed methods and updated to use
StateBrModel
.
- Renamed methods and updated to use
-
Added tests for
IbgeRepository
inibge_repository_test.dart
:- Ensured correct functionality for state and city retrieval.
-
Refactored
home_screen.dart
:- Integrated
HomeController
for managing the state. - Added segmented buttons for mechanics and filter selection.
- Implemented navigation to
MecanicsScreen
andFiltersScreen
.
- Integrated
-
Added
home_controller.dart
andhome_state.dart
:- Managed the state of the home screen.
- Provided functionality for mechanics selection and updating the view based on the selected mechanics.
-
Updated
main.dart
:- Initialized
SearchHistory
during app startup to ensure search functionality is ready when the app launches.
- Initialized
-
Updated
state_manager.dart
:- Renamed methods and classes to align with the updated state model, enhancing code readability and consistency.
-
Updated
my_material_app.dart
:- Added a route for
FiltersScreen
to integrate the new filter functionality into the app's navigation.
- Added a route for
-
Updated
ibge_repository.dart
:- Renamed methods to use
StateBrModel
instead of the previousUFModel
, ensuring consistency with the updated data models.
- Renamed methods to use
-
Added tests for
IbgeRepository
inibge_repository_test.dart
:- Ensured the correct functionality for state and city retrieval, verifying that the refactored code behaves as expected.
-
Refactored
mechanics_manager.dart
:- Added methods
nameFromId
andnamesFromIdList
for retrieving mechanic names based on their IDs. - Enhanced functionality to manage and retrieve mechanic names, aiding in cleaner code and improved readability.
- Added methods
-
Added
text_styles.dart
:- Defined a centralized
TextStyles
class to manage text styles across the app. - Simplified text styling management and ensured consistency in text appearance.
- Defined a centralized
-
Added
search_controller.dart
andsearch_dialog.dart
:- Implemented a custom search controller and dialog for managing search history and suggestions.
- Enhanced the search experience by providing users with a history of previous searches and suggestions based on input.
-
Refactored
advert_screen.dart
:- Removed redundant log statements for a cleaner codebase.
- Ensured better readability and maintainability of the code.
-
Refactored
base_controller.dart
andbase_screen.dart
:- Integrated search functionality into the base screen.
- Improved navigation and state management within the base screen.
-
Refactored
filters_controller.dart
andfilters_screen.dart
:- Enhanced filters management with improved state handling.
- Provided a user-friendly interface for selecting filters and mechanics.
-
Updated
Makefile
:- Added common commands for Docker, Flutter, and Git operations.
- Simplified development workflows by providing reusable Makefile commands.
-
Updated
pubspec.yaml
:- Bumped the version to
0.3.2+8
to reflect the new features and improvements. - Ensured dependencies are up to date, supporting the latest features and bug fixes.
- Bumped the version to
-
Added
home_controller.dart
andhome_screen.dart
:- Introduced a home controller to manage the state and interactions on the home screen.
- Implemented UI elements to allow users to filter and select mechanics easily.
- Enhanced user experience by providing a more interactive and responsive home screen.
-
Added
filters_states.dart
:- Defined states for the filters feature to manage loading, success, and error states.
- Improved state management, making the filters feature more robust and easier to maintain.
-
Added
search_dialog_bar.dart
andsearch_dialog_search_bar.dart
:- Provided additional search dialog implementations for various UI scenarios.
- Enhanced search functionality with better UI integration and user experience.
-
Updated
state_manager.dart
:- Refactored to use
StateBrModel
instead ofUFModel
. - Improved clarity and consistency in naming conventions.
- Refactored to use
-
Updated
ibge_repository.dart
:- Refactored methods to align with the new state model naming conventions.
- Ensured consistency and clarity in data retrieval methods.
-
Refactored
my_material_app.dart
:- Added route for the new
FiltersScreen
. - Improved navigation and ensured all new screens are accessible.
- Added route for the new
-
Updated
ibge_repository_test.dart
:- Refactored tests to align with the new
StateBrModel
. - Ensured tests remain up-to-date and cover the new functionality.
- Refactored tests to align with the new
-
Added
text_styles.dart
:- Introduced a centralized file for text styles to ensure consistency across the app.
- Made it easier to manage and update text styles in one place.
-
Updated
Makefile
:- Added commands for Docker operations (
docker_up
,docker_down
), Flutter operations (flutter_clean
), and Git operations (git_cached
,git_commit
,git_push
). - Simplified and automated common development tasks, improving developer productivity.
- Added commands for Docker operations (
-
Updated
search_history.dart
:- Implemented a singleton pattern for managing search history.
- Added methods to save and retrieve search history using
SharedPreferences
. - Enhanced search functionality by providing users with suggestions based on their search history.
-
Updated
advert_screen.dart
:- Removed unnecessary imports and log statements.
- Improved readability and maintainability of the code.
-
Updated
base_controller.dart
:- Added constants for page titles and methods to manage page navigation and search functionality.
- Improved the controller's responsibility to manage state and UI updates more effectively.
-
Updated
base_screen.dart
:- Introduced a method for handling search dialog interactions.
- Enhanced the app bar to dynamically display the search bar or title based on the current page.
- Improved user experience by integrating a search functionality directly into the app bar.
-
Updated
home_screen.dart
:- Added segmented buttons for mechanics and filter selection.
- Integrated new mechanics and filter selection features into the home screen.
-
Updated
mechanics_manager.dart
:- Added methods to retrieve mechanic names by their IDs.
- Improved data handling for mechanics, making it easier to work with mechanic-related data.
-
Updated
state_manager.dart
:- Continued to refine state management by ensuring alignment with the new state model.
-
Updated
main.dart
:- Added initialization for the
SearchHistory
singleton. - Ensured all necessary initializations are done before the app runs.
- Added initialization for the
-
Incremented
pubspec.yaml
version to 0.3.2+8:- Reflecting all the changes and additions made in this update cycle.
This commit encompasses multiple additions and refactorings across the project to enhance functionality, improve code clarity, and manage state more effectively. These changes improve the overall structure, enhance user experience with better search and filter functionalities, and maintain consistency across the application. These updates further improve the app's maintainability, performance, and user experience, ensuring that the app remains robust and user-friendly. The comprehensive updates aim to improve the app’s overall architecture, enhance user experience, and maintain a clean and maintainable codebase. The addition of new models, controllers, and screens reflects ongoing efforts to provide robust and user-friendly features. These updates continue to improve the app’s structure, usability, and developer experience by refining existing features, introducing new functionalities, and ensuring consistency across the codebase.
feat: Refactor and enhance advertisement and mechanic modules
-
lib/common/models/category.dart to lib/common/models/mechanic.dart
- Renamed
CategoryModel
toMechanicModel
.
- Renamed
-
lib/components/custon_field_controllers/currency_text_controller.dart
- Added
currencyValue
getter to parse the text into a double.
- Added
-
lib/features/advertisement/advert_controller.dart
- Replaced
CategoryModel
withMechanicModel
. - Added
AdvertState
for state management. - Added methods to handle state changes and error handling.
- Replaced
-
lib/features/advertisement/advert_screen.dart
- Updated to reflect new state management.
- Added navigation to
BaseScreen
upon successful ad creation.
-
lib/features/advertisement/advert_state.dart (new)
- Added state classes for advertisement management.
-
lib/features/advertisement/widgets/advert_form.dart
- Updated to use
selectedMechIds
for mechanics selection.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated navigation to
AdvertScreen
reflecting new changes.
- Updated navigation to
-
lib/features/mecanics/mecanics_screen.dart
- Replaced
categories
withmechanics
. - Updated route name and method names to reflect mechanics instead of categories.
- Replaced
-
lib/manager/mechanics_manager.dart
- Replaced
CategoryModel
withMechanicModel
.
- Replaced
-
lib/repository/advert_repository.dart
- Renamed variables to reflect advertisement context.
- Updated methods to handle the new advert model.
-
lib/repository/constants.dart
- Updated constants to reflect advertisement context.
-
lib/repository/mechanic_repository.dart
- Renamed methods to reflect mechanics context.
-
pubspec.yaml & pubspec.lock
- Updated dependencies versions.
- Bumped project version to
0.3.1+7
.
-
lib/features/new_address/ (new)
- new_address_controller.dart: Added new address management logic, including form validation and fetching address data from ViaCEP.
- new_address_screen.dart: Created new screen for managing new addresses, including saving and validating address information.
- new_address_state.dart: Added state classes for new address management.
- widgets/address_form.dart: Added new address form for input fields related to address management.
-
lib/features/address/address_controller.dart
- Moved logic related to address state management to
AddressManager
. - Simplified the controller to delegate address operations to
AddressManager
.
- Moved logic related to address state management to
-
lib/features/address/address_screen.dart
- Updated screen to utilize
AddressManager
for fetching and managing addresses. - Added buttons for adding and removing addresses.
- Updated screen to utilize
-
lib/manager/address_manager.dart (new)
- Added a manager for handling address operations, including saving, deleting, and fetching addresses.
- Included methods to check for duplicate address names and manage address lists.
These changes collectively refactor the existing advertisement and address modules, introduce better state management, improve the mechanics handling, and streamline address-related operations. Additionally, it includes new features and improvements for handling advertisements and mechanics.
feat: Implement address management with AddressManager and new address screens
-
lib/common/singletons/current_user.dart
- Replaced
AddressRepository
withAddressManager
for managing addresses. - Removed
_loadAddresses
method, addedaddressByName
andsaveAddress
methods.
- Replaced
-
lib/features/address/address_controller.dart
- Simplified
AddressController
to delegate address management toAddressManager
. - Removed form state and validation logic, focusing on address selection and removal.
- Simplified
-
lib/features/address/address_screen.dart
- Updated to use new
NewAddressScreen
for adding addresses. - Added floating action buttons for adding and removing addresses.
- Updated to use new
-
lib/features/advertisement/advert_controller.dart
- Updated to use
CurrentUser.addressByName
for selecting addresses.
- Updated to use
-
lib/features/advertisement/widgets/advert_form.dart
- Updated address selection to use
CurrentUser.addressByName
.
- Updated address selection to use
-
lib/features/new_address/new_address_controller.dart (new)
- Added new controller for managing new address form state and validation.
-
lib/features/new_address/new_address_screen.dart (new)
- Added new screen for adding and editing addresses.
- Integrated
NewAddressController
for form management and submission.
-
lib/features/address/address_state.dart (renamed to
new_address_state.dart
)- Renamed and updated states to be used by
NewAddressController
.
- Renamed and updated states to be used by
-
lib/features/address/widgets/address_form.dart (renamed to
new_address/widgets/address_form.dart
)- Updated to use
NewAddressController
for form state management.
- Updated to use
-
lib/manager/address_manager.dart (new)
- Added new manager for handling address CRUD operations and caching.
- Implemented methods for saving, deleting, and fetching addresses.
-
lib/my_material_app.dart
- Added route for
NewAddressScreen
. - Updated
onGenerateRoute
to handle new address route.
- Added route for
-
lib/repository/address_repository.dart
- Simplified
saveAddress
method. - Added
delete
method for removing addresses. - Updated error handling and logging.
- Simplified
-
lib/repository/constants.dart
- Updated
keyAddressTable
to'Addresses'
.
- Updated
This commit message provides a detailed breakdown of changes made to each file, highlighting the specific updates and improvements in the address management system.
feat: Implement new features for address management and validation
-
lib/common/models/address.dart
- Added
operator ==
andhashCode
methods toAddressModel
for better address comparison and management.
- Added
-
lib/common/singletons/current_user.dart
- Updated to load addresses and provide access to address names.
- Improved logic for address initialization and retrieval.
-
lib/common/validators/validators.dart
- Added
AddressValidator
for validating various address fields. - Enhanced
Validator.zipCode
to clean and validate the zip code correctly.
- Added
-
lib/components/form_fields/custom_form_field.dart
- Added
textCapitalization
property toCustomFormField
.
- Added
-
lib/components/form_fields/dropdown_form_field.dart
- Added
textCapitalization
andonSelected
properties toDropdownFormField
.
- Added
-
lib/features/advertisement/widgets/advert_form.dart
- Added
textCapitalization
property toAdvertForm
.
- Added
-
lib/features/address/address_controller.dart
- Enhanced
AddressController
to manage addresses more efficiently. - Added methods for validation and setting the form from addresses.
- Included
zipFocus
to manage focus on the zip code field.
- Enhanced
-
lib/features/address/address_screen.dart
- Updated
AddressScreen
to validate and save addresses upon leaving the screen. - Integrated
PopScope
to handle back navigation and save address changes.
- Updated
-
lib/features/address/widgets/address_form.dart
- Updated
AddressForm
to useAddressValidator
. - Added logic to initialize address types from
CurrentUser
.
- Updated
-
lib/features/advertisement/advertisement_controller.dart
- Renamed
AdvertisementController
toAdvertController
. - Updated methods for address handling and validation.
- Renamed
-
lib/features/advertisement/advertisement_screen.dart
- Renamed
AdvertisementScreen
toAdvertScreen
.
- Renamed
-
lib/features/advertisement/widgets/advertisement_form.dart
- Renamed
AdvertisementForm
toAdvertForm
. - Updated address selection logic.
- Renamed
-
lib/features/advertisement/widgets/image_list_view.dart
- Updated to use
AdvertController
instead ofAdvertisementController
.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated route for
AdvertScreen
.
- Updated route for
-
lib/features/mecanics/mecanics_screen.dart
- Updated
MecanicsScreen
to handle null descriptions gracefully.
- Updated
-
lib/my_material_app.dart
- Updated routes to use
AdvertScreen
.
- Updated routes to use
-
lib/repository/ad_repository.dart
- Renamed
AdRepository
toAdvertRepository
.
- Renamed
-
lib/repository/address_repository.dart
- Enhanced
saveAddress
method to handle address name uniqueness per user. - Added
_getAddressByName
to fetch addresses by name. - Improved error handling and logging.
- Enhanced
-
lib/repository/constants.dart
- Updated
keyAddressTable
to'Addresses'
.
- Updated
This commit message provides a detailed breakdown of changes made to each file, highlighting the specific updates and improvements.
feat: Implement new features for address management, category handling, and insert functionality
-
lib/common/models/address.dart
- Added
operator ==
andhashCode
methods toAddressModel
for better address management.
- Added
-
lib/common/singletons/current_user.dart
- Updated to load addresses and provide access to address names.
-
lib/common/validators/validators.dart
- Added
AddressValidator
for validating various address fields. - Improved
Validator.zipCode
to clean and validate the zip code correctly.
- Added
-
lib/components/form_fields/custom_form_field.dart
- Added
textCapitalization
property toCustomFormField
.
- Added
-
lib/components/form_fields/dropdown_form_field.dart
- Added
textCapitalization
andonSelected
properties toDropdownFormField
.
- Added
-
lib/features/address/address_controller.dart
- Enhanced
AddressController
to manage addresses more efficiently. - Added methods for validation and setting the form from addresses.
- Added
zipFocus
to manage focus on the zip code field.
- Enhanced
-
lib/features/address/address_screen.dart
- Updated
AddressScreen
to validate and save addresses upon leaving the screen. - Included
PopScope
to handle back navigation.
- Updated
-
lib/features/address/widgets/address_form.dart
- Updated
AddressForm
to useAddressValidator
. - Added logic to initialize address types from
CurrentUser
.
- Updated
-
lib/features/advertisement/advertisement_controller.dart
- Renamed
AdvertisementController
toAdvertController
. - Updated methods for address handling and validation.
- Renamed
-
lib/features/advertisement/advertisement_screen.dart
- Renamed
AdvertisementScreen
toAdvertScreen
.
- Renamed
-
lib/features/advertisement/widgets/advertisement_form.dart
- Renamed
AdvertisementForm
toAdvertForm
. - Updated address selection logic.
- Renamed
-
lib/features/advertisement/widgets/image_list_view.dart
- Updated to use
AdvertController
instead ofAdvertisementController
.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated route for
AdvertScreen
.
- Updated route for
-
lib/features/mecanics/mecanics_screen.dart
- Updated
MecanicsScreen
to handle null descriptions gracefully.
- Updated
-
lib/my_material_app.dart
- Updated routes to use
AdvertScreen
.
- Updated routes to use
-
lib/repository/ad_repository.dart
- Renamed
AdRepository
toAdvertRepository
.
- Renamed
-
lib/repository/address_repository.dart
- Enhanced
saveAddress
method to handle address name uniqueness per user. - Added
_getAddressByName
to fetch addresses by name. - Improved error handling and logging.
- Enhanced
-
lib/repository/constants.dart
- Updated
keyAddressTable
to'Addresses'
.
- Updated
This commit message provides a detailed breakdown of changes made to each file, highlighting the specific updates and improvements.
feat: Address management updates and enhancements
This commit introduces several new features and updates to address management within the application. Key changes include:
- Added unique name verification for addresses per user.
- Implemented logic to handle address creation and updates.
- Enhanced error handling and response validation.
- Included additional model fields for address details.
Detailed Changes:
- lib/common/models/address.dart: Added new model for addresses.
- lib/common/models/category.dart: Renamed CategoryModel to MechanicModel.
- lib/common/models/city.dart: Added new model for city information.
- lib/common/models/uf.dart: Added new model for state information.
- lib/common/models/user.dart: Updated user model with address-related fields.
- lib/common/models/viacep_address.dart: Added model for ViaCEP address information.
- lib/common/singletons/app_settings.dart: Adjusted settings for address handling.
- lib/common/singletons/current_user.dart: Added singleton for current user with address information.
- lib/common/validators/validators.dart: Added validation rules for address fields.
- lib/components/buttons/big_button.dart: Added focus node for address input.
- lib/components/custom_drawer/custom_drawer.dart: Integrated current user for address display.
- lib/components/custom_drawer/widgets/custom_drawer_header.dart: Updated drawer header with address info.
- lib/components/form_fields/custom_form_field.dart: Added new fields for address input.
- lib/components/others_widgets/custom_input_formatter.dart: Added custom input formatter for address fields.
- lib/features/address/address_controller.dart: Added controller for address management.
- lib/features/address/address_screen.dart: Added screen for address input and display.
- lib/features/address/address_state.dart: Added state management for address operations.
- lib/features/insert/insert_controller.dart: Enhanced insert functionality with address handling.
- lib/features/insert/insert_screen.dart: Updated insert screen with address fields.
- lib/features/insert/widgets/image_gallery.dart: Renamed to horizontal_image_gallery.dart.
- lib/features/insert/widgets/insert_form.dart: Integrated address fields into insert form.
- lib/features/login/login_controller.dart: Integrated address handling in login process.
- lib/features/mecanics/mecanics_screen.dart: Added screen for mechanics selection.
- lib/main.dart: Integrated address management on app startup.
- lib/manager/mechanics_manager.dart: Added manager for mechanics data.
- lib/manager/uf_manager.dart: Added manager for state data.
- lib/my_material_app.dart: Updated material app with new routes and address handling.
- lib/repository/address_repository.dart: Added repository for address data handling.
- lib/repository/constants.dart: Updated constants for address fields.
- lib/repository/ibge_repository.dart: Added repository for state and city data.
- lib/repository/mechanic_repository.dart: Renamed from category_repository and updated for mechanics data.
- lib/repository/user_repository.dart: Updated user repository with address handling.
- lib/repository/viacep_repository.dart: Added repository for ViaCEP data.
- pubspec.yaml: Added dependencies for address management.
- test/repository/ibge_repository_test.dart: Added tests for IBGE repository.
This commit significantly enhances the application's ability to manage user addresses, providing a robust framework for address-related data and operations.
feat: Implemented new features for address management, category handling, and insert functionality
This commit introduces several new features and updates, including address management, category handling, and enhancements to the insert functionality. It also includes modifications to existing models and components to support the new functionality.
Detailed Changes:
-
lib/common/models/address.dart:
- Created a new
AddressModel
to handle address-related data. - Implemented methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
). - Added a
toString
method for debugging and logging purposes.
- Created a new
-
lib/common/models/category.dart:
- Renamed
CategoryModel
toMechanicModel
. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created a new
CityModel
to represent city data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
). - Added a
toString
method for debugging and logging purposes.
- Created a new
-
lib/common/models/uf.dart:
- Created
RegionModel
andUFModel
to represent region and state data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
). - Added
toString
methods for debugging and logging purposes.
- Created
-
lib/common/models/user.dart:
- Added serialization and deserialization methods (
toMap
,fromMap
,toJson
,fromJson
). - Implemented a
copyFromUserModel
method for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created a new
ViaCEPAddressModel
to handle address data from the ViaCEP API. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
). - Added a
toString
method for debugging and logging purposes.
- Created a new
-
lib/common/singletons/app_settings.dart:
- Removed user-related properties and methods to simplify the singleton class.
-
lib/common/singletons/current_user.dart:
- Created a new
CurrentUser
singleton to manage the current user and their address. - Included methods for initializing and loading user and address data (
init
,_loadUserAndAddress
).
- Created a new
-
lib/common/validators/validators.dart:
- Added new validators for form fields (
title
,description
,mechanics
,address
,zipCode
,cust
).
- Added new validators for form fields (
-
lib/components/buttons/big_button.dart:
- Added
focusNode
property to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUser
for login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUser
for displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly
,suffixIcon
, anderrorText
properties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatter
to format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressController
to manage address-related state and logic. - Implemented methods for handling address retrieval and saving (
getAddress
,saveAddressFrom
,_checkZipCodeReady
).
- Created a new
-
lib/features/address/address_screen.dart:
- Created a new
AddressScreen
to provide a UI for managing user addresses. - Integrated with
AddressController
to handle form submission and state changes.
- Created a new
-
lib/features/address/address_state.dart:
- Defined different states for address-related operations (
AddressStateInitial
,AddressStateLoading
,AddressStateSuccess
,AddressStateError
).
- Defined different states for address-related operations (
-
lib/common/models/address.dart:
- Created
AddressModel
to manage address-related data. - Implemented methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/category.dart:
- Renamed
CategoryModel
toMechanicModel
. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created
CityModel
to represent city data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/uf.dart:
- Created
RegionModel
andUFModel
to represent region and state data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/user.dart:
- Added serialization and deserialization methods (
toMap
,fromMap
,toJson
,fromJson
). - Implemented a
copyFromUserModel
method for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created
ViaCEPAddressModel
to handle address data from the ViaCEP API. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/singletons/app_settings.dart:
- Removed user-related properties and methods to simplify the singleton class.
-
lib/common/singletons/current_user.dart:
- Created a new
CurrentUser
singleton to manage the current user and their address. - Included methods for initializing and loading user and address data (
init
,_loadUserAndAddress
).
- Created a new
-
lib/common/validators/validators.dart:
- Added new validators for form fields (
title
,description
,mechanics
,address
,zipCode
,cust
).
- Added new validators for form fields (
-
lib/components/buttons/big_button.dart:
- Added
focusNode
property to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUser
for login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUser
for displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly
,suffixIcon
, anderrorText
properties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatter
to format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressController
to manage address-related state and logic. - Implemented methods for handling address retrieval and saving (
getAddress
,saveAddressFrom
,_checkZipCodeReady
).
- Created a new
-
lib/features/address/address_screen.dart:
- Created a new
AddressScreen
to provide a UI for managing user addresses. - Integrated with
AddressController
to handle form submission and state changes.
- Created a new
-
lib/features/address/address_state.dart:
- Defined different states for address-related operations (
AddressStateInitial
,AddressStateLoading
,AddressStateSuccess
,AddressStateError
).
- Defined different states for address-related operations (
-
lib/features/insert/insert_controller.dart:
- Enhanced
InsertController
with new methods and properties for managing categories and images. - Added methods for form validation (
formValidate
) and managing selected categories (getCategoriesIds
).
- Enhanced
-
lib/features/insert/insert_screen.dart:
- Updated to initialize address data from
CurrentUser
. - Added logic for handling form submission (
_createAnnounce
).
- Updated to initialize address data from
-
lib/features/insert/widgets/horizontal_image_gallery.dart:
- Renamed from
image_gallery.dart
. - Updated widget structure to handle horizontal image gallery.
- Renamed from
-
lib/features/insert/widgets/insert_form.dart:
- Enhanced to include additional fields and validation logic.
- Integrated navigation for adding mechanics and addresses.
-
lib/features/login/login_controller.dart:
- Updated to use
CurrentUser
for managing login state.
- Updated to use
-
lib/features/mecanics/mecanics_screen.dart:
- Created a new
MecanicsScreen
to handle mechanic selection.
- Created a new
-
lib/main.dart:
- Updated main entry point to initialize
CurrentUser
and other managers. - Added new routes for address and mechanic screens.
- Updated main entry point to initialize
-
lib/manager/mechanics_manager.dart:
- Created
MechanicsManager
to manage mechanic data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/manager/uf_manager.dart:
- Created
UFManager
to manage state (UF) data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/my_material_app.dart:
- Added new routes for address and mechanic screens.
- Updated to support dynamic route generation for mechanic screen.
-
lib/repository/address_repository.dart:
- Created
AddressRepository
to manage address-related data operations. - Implemented methods for saving and retrieving address data from both local storage and the server.
- Created
-
lib/repository/constants.dart:
- Updated constants to support new address and mechanic data models.
-
lib/repository/ibge_repository.dart:
- Created
IbgeRepository
to manage data retrieval from the IBGE API. - Implemented methods for retrieving state and city data.
- Created
-
lib/repository/mechanic_repository.dart:
- Renamed from
category_repositories.dart
. - Updated to support new mechanic data model.
- Renamed from
-
lib/common/models/address.dart:
- Created
AddressModel
to manage address-related data. - Implemented methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/category.dart:
- Renamed
CategoryModel
toMechanicModel
. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created
CityModel
to represent city data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/uf.dart:
- Created
RegionModel
andUFModel
to represent region and state data. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/models/user.dart:
- Added serialization and deserialization methods (
toMap
,fromMap
,toJson
,fromJson
). - Implemented a
copyFromUserModel
method for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created
ViaCEPAddressModel
to handle address data from the ViaCEP API. - Included methods for serialization and deserialization (
toMap
,fromMap
,toJson
,fromJson
).
- Created
-
lib/common/singletons/app_settings.dart:
- Removed user-related properties and methods to simplify the singleton class.
-
lib/common/singletons/current_user.dart:
- Created a new
CurrentUser
singleton to manage the current user and their address. - Included methods for initializing and loading user and address data (
init
,_loadUserAndAddress
).
- Created a new
-
lib/common/validators/validators.dart:
- Added new validators for form fields (
title
,description
,mechanics
,address
,zipCode
,cust
).
- Added new validators for form fields (
-
lib/components/buttons/big_button.dart:
- Added
focusNode
property to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUser
for login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUser
for displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly
,suffixIcon
, anderrorText
properties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatter
to format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressController
to manage address-related state and logic. - Implemented methods for handling address retrieval and saving (
getAddress
,saveAddressFrom
,_checkZipCodeReady
).
- Created a new
-
lib/features/address/address_screen.dart:
- Created a new
AddressScreen
to provide a UI for managing user addresses. - Integrated with
AddressController
to handle form submission and state changes.
- Created a new
-
lib/features/address/address_state.dart:
- Defined different states for address-related operations (
AddressStateInitial
,AddressStateLoading
,AddressStateSuccess
,AddressStateError
).
- Defined different states for address-related operations (
-
lib/features/insert/insert_controller.dart:
- Enhanced
InsertController
with new methods and properties for managing categories and images. - Added methods for form validation (
formValidate
) and managing selected categories (getCategoriesIds
).
- Enhanced
-
lib/features/insert/insert_screen.dart:
- Updated to initialize address data from
CurrentUser
. - Added logic for handling form submission (
_createAnnounce
).
- Updated to initialize address data from
-
lib/features/insert/widgets/horizontal_image_gallery.dart:
- Renamed from
image_gallery.dart
. - Updated widget structure to handle horizontal image gallery.
- Renamed from
-
lib/features/insert/widgets/insert_form.dart:
- Enhanced to include additional fields and validation logic.
- Integrated navigation for adding mechanics and addresses.
-
lib/features/login/login_controller.dart:
- Updated to use
CurrentUser
for managing login state.
- Updated to use
-
lib/features/mecanics/mecanics_screen.dart:
- Created a new
MecanicsScreen
to handle mechanic selection.
- Created a new
-
lib/main.dart:
- Updated main entry point to initialize
CurrentUser
and other managers. - Added new routes for address and mechanic screens.
- Updated main entry point to initialize
-
lib/manager/mechanics_manager.dart:
- Created
MechanicsManager
to manage mechanic data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/manager/uf_manager.dart:
- Created
UFManager
to manage state (UF) data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/my_material_app.dart:
- Added new routes for address and mechanic screens.
- Updated to support dynamic route generation for mechanic screen.
-
lib/repository/address_repository.dart:
- Created
AddressRepository
to manage address-related data operations. - Implemented methods for saving and retrieving address data from both local storage and the server.
- Created
-
lib/repository/constants.dart:
- Updated constants to support new address and mechanic data models.
-
lib/repository/ibge_repository.dart:
- Created
IbgeRepository
to manage data retrieval from the IBGE API. - Implemented methods for retrieving state and city data.
- Created
-
lib/repository/mechanic_repository.dart:
- Renamed from
category_repositories.dart
. - Updated to support new mechanic data model.
- Renamed from
-
lib/repository/user_repository.dart:
- Updated to use correct generic types for getting user attributes.
-
lib/repository/viacep_repository.dart:
- Created
ViacepRepository
to handle address data retrieval from ViaCEP API. - Implemented methods for fetching address data based on CEP (postal code).
- Created
-
pubspec.yaml:
- Added new dependencies for
http
andshared_preferences
to support address and data handling.
- Added new dependencies for
-
test/repository/ibge_repository_test.dart:
- Added tests for
IbgeRepository
to ensure correct data retrieval from IBGE API.
- Added tests for
This commit significantly enhances the application's ability to manage user addresses, categories, and insert functionalities, providing a robust framework for address-related data and operations.
Implemented InsertForm widget, updated dependencies, and made platform-specific changes
This commit introduces a new InsertForm widget, updates various project dependencies, and includes necessary platform-specific changes to ensure compatibility and functionality.
Detailed Changes:
-
lib/ui/form/insert_form.dart:
- Created a new stateful widget
InsertForm
to handle user inputs. - Added
InsertController
as a required parameter for managing form data. - Implemented
CustomFormField
components for title and description inputs withlabelText
,fullBorder
, andfloatingLabelBehavior
properties. - Added a
DropdownButtonFormField
for category selection with predefined items. - Included a
ValueNotifier<bool>
namedhidePhone
to manage the visibility of the phone number input. - Overridden the
dispose
method to properly dispose of theValueNotifier
.
- Created a new stateful widget
-
pubspec.yaml:
- Added
intl: ^0.19.0
for internationalization support. - Added
image_picker: ^1.1.2
to enable image selection from the device. - Added
image_cropper: ^4.0.1
for cropping images.
- Added
-
lib/common/models/category.dart:
- Defined a Category model to encapsulate the data structure and provide methods for handling category-related data.
-
lib/components/custom_drawer/custom_drawer.dart:
- Developed a CustomDrawer widget to standardize the navigation drawer across the application.
- Included links to major sections such as Home, Insert, and Settings.
-
lib/components/form_fields/custom_form_field.dart:
- Created a reusable CustomFormField widget to ensure consistent styling and functionality across all form fields.
-
lib/controllers/insert_controller.dart:
- Implemented the InsertController class to manage form state and business logic, ensuring separation of concerns and easier testing.
-
lib/main.dart:
- Main entry point updated to include routing and integration for the new InsertForm functionality.
-
lib/screens/home_screen.dart:
- Added navigation logic to transition from the HomeScreen to the new InsertScreen.
-
lib/screens/insert_screen.dart:
- Created InsertScreen to host the InsertForm widget, integrating it into the application's navigation flow.
-
lib/services/file_service.dart:
- Implemented FileService to abstract file operations such as picking and cropping images, leveraging image_picker and image_cropper plugins.
-
lib/utilities/constants.dart:
- Updated constants to support new form and file handling features, ensuring consistent usage across the application.
-
windows/flutter/generated_plugin_registrant.cc:
- Registered
FileSelectorWindows
plugin to handle file selection on Windows.
- Registered
This commit enhances the form handling capabilities of the application by introducing a new, robust InsertForm widget. It also extends the app's functionality by adding new dependencies for internationalization and image handling. The platform-specific changes ensure that these features are fully supported on Windows, providing a consistent and seamless user experience across different environments.