Este projeto é um aplicativo de compra, venda e troca de jogos de tabuleiro usados (board games). A estrutura do projeto foi organizada para garantir modularização, manutenção fácil e expansão futura. O foco principal da arquitetura foi garantir a separação clara entre lógica de negócio, gestão de estado, interface do usuário e a manipulação de dados.
Abaixo está descrita a estrutura do projeto, organizada de acordo com os principais diretórios e suas responsabilidades.
Este diretório armazena componentes reutilizáveis que são usados em diferentes partes da aplicação. É dividido em:
- buttons: Botões customizados, como
big_button.dart. - collection_views: Visualizações de coleções, como listas e grades.
- ad_list_view e shop_grid_view contêm widgets como cartões de anúncio, exibição de imagem e ratings.
- custon_controllers: Controladores para entrada de texto com máscaras ou formatação especial, como valores monetários.
- dialogs: Diálogos simples para mensagens e perguntas.
- drawers: Componentes para barra lateral (drawer) do aplicativo.
- form_fields: Campos de formulário personalizados, incluindo campos com máscaras e senhas.
- texts: Componentes relacionados a textos longos, como
read_more_text.dart. - widgets: Componentes diversos, como botões de favoritos, mensagens de carregamento e containers dismissĂveis.
Responsável pelas funcionalidades centrais e comuns à aplicação.
- abstracts: Classes abstratas que fornecem padronizações, como
data_result.dart. - config: Configurações gerais da aplicação, como
app_info.dart, que armazena dados sobre a versão do app.- theme: Configuração de temas e estilos visuais, como cores e fontes.
- models: Definições dos modelos de dados do aplicativo (ex.:
ad.dart,boardgame.dart). Esses modelos representam os objetos principais do app. - singletons: Armazenamento de estados persistentes na aplicação, como
app_settings.dartecurrent_user.dart. - state: Classe básica de controle de estado, utilizada por outras telas.
- utils: Utilitários e extensões diversas para facilitar o desenvolvimento, como métodos de formatação e validação.
Contém os gerenciadores de dados do aplicativo. Estes elementos fazem a mediação entre a interface do usuário e os repositórios, carregando e armazenando dados necessários para a operação da aplicação.
- Inclui arquivos como
addresses_manager.dart,boardgames_manager.dartefavorites_manager.dart.
Este diretório é o mais detalhado, contendo as diferentes funcionalidades da aplicação organizadas por área.
- addresses: Implementação do cadastro e edição de endereços. Inclui controle de lógica, interface e widgets.
- chat: Tela de chat (ainda nĂŁo implementado).
- edit_ad: Funções para criar e editar anĂşncios. Divide-se em controladores de formulário, visualização de imagens e widgets especĂficos.
- favorites: Tela para exibição dos anúncios marcados como favoritos.
- filters: Controle dos filtros utilizados na pesquisa de jogos, com widgets especĂficos de filtragem.
- my_account: Inclui várias subfuncionalidades relacionadas à conta do usuário, como
boardgames,mechanics,my_adsemy_data.- boardgames e mechanics: Gerenciamento dos jogos cadastrados e suas mecânicas.
- my_ads: Gerenciamento dos anúncios do usuário.
- payment: Implementação do sistema de pagamento.
- shop: Apresentação dos produtos em grade e detalhes do produto selecionado.
- signin e signup: Telas de login e cadastro de usuários.
Contém os repositórios que interagem diretamente com as fontes de dados.
- app_data: Repositórios que armazenam preferências internas da aplicação, como tema.
- data: RepositĂłrios que interagem com o servidor Parse Server para dados principais do app.
- gov_apis: RepositĂłrios que interagem com APIs governamentais, como
ibge_repository.dart. - local_data: RepositĂłrios que usam SQLite para armazenar dados localmente, reduzindo consultas ao servidor.
Serviços auxiliares utilizados na aplicação.
- parse_server: Métodos para interação com o servidor Parse Server.
- payment: Implementação do serviço de pagamento usando Mercado Pago.
Esta camada é uma abstração para o banco de dados SQLite.
- constants: Contém nomes de tabelas, versões de esquema e scripts de criação/migração.
- database: Contém classes para gerenciar, migrar e inicializar o banco de dados.
- stores: Classes para operações CRUD em tabelas especĂficas, como
bg_names_store.dartemechanics_store.dart.
- Modularização e Encapsulamento: Cada funcionalidade é separada em subpastas dedicadas, garantindo que a manutenção de um módulo seja independente dos outros.
- Separar Lógica de Negócio, UI e Controle de Estado: Cada tela (“feature”) é dividida em três componentes principais:
controller(lógica de negócio),screen(interface de usuário) estore(gestão de estado e reatividade). - Reutilização de Componentes: Componentes compartilháveis estão localizados na pasta
components, tornando-os facilmente reutilizáveis entre diferentes partes do projeto. - Gestão de Estado Centralizada: Utilização de stores e singletons, conforme o caso, para gerenciar o estado da aplicação e manter consistência.
A estrutura apresentada permite uma manutenção eficiente do código, tornando as futuras melhorias ou adaptações mais simples de serem realizadas. Componentes reutilizáveis estão claramente organizados, enquanto os dados, a lógica de negócio e a interface do usuário estão devidamente desacoplados. Desta forma, o projeto está preparado para evoluir em complexidade sem comprometer a sua compreensão ou a qualidade do código.
This commit updates the SearchDialog widget by replacing the ShopController dependency with SearchFilter, ensuring a cleaner and more modular implementation for managing search filters. However, the bug related to filter state inconsistencies is not fully resolved. Further testing and review are required to address all edge cases.
- lib/features/shop/widgets/search/search_dialog.dart:
- Removed the
ShopControllerdependency and replaced it withSearchFilter. - Updated the
_filterSearchmethod to useSearchFilterfor managing filters. - Modified the
_filterCleanmethod to reset the filters usingSearchFilter. - Adjusted
ListenableBuilderand filter comparison logic to work withSearchFilter.
- Removed the
- Investigate potential issues with filter state updates not reflecting correctly in the UI.
- Test edge cases for the
_filterSearchand_filterCleanmethods to ensure expected behavior. - Review integration with other components relying on
SearchFilterto avoid regression.
These changes streamline the SearchDialog implementation by delegating filter management to SearchFilter. While the update enhances modularity, the bug is not fully fixed, requiring additional testing and adjustments to ensure stability and correctness.
This commit introduces multiple changes across the project, including enhancements in the ShopGridView component, creation of new Favorites management modules, refinements in image processing for board games, dependency registrations, and adjustments to controllers and screens for improved state management and modularity.
-
assets/data/bgBazzar.db:
- Updated the database binary file with changes reflecting updated data or structure.
-
lib/components/collection_views/shop_grid_view/shop_grid_view.dart:
- Replaced the
ShopControllerdependency withadsandgetMoreAdsfor improved modularity. - Adjusted methods and properties to work with
adsdirectly instead of theShopController.
- Replaced the
-
lib/components/widgets/state_loading_message.dart:
- Extracted a reusable method
containerCircularProgressIndicatorfor generating a loading container. - Updated the
buildmethod to use the new helper method for better code readability.
- Extracted a reusable method
-
lib/components/widgets/state_message.dart:
- Created a new widget
StateMessageto handle various states with customizable messages, buttons, and icons.
- Created a new widget
-
lib/core/singletons/current_user.dart:
- Added a guard in
initto prevent re-initialization if the user is already logged in.
- Added a guard in
-
lib/data_managers/boardgames_manager.dart:
- Enhanced image processing methods to support PNG format with the
forceJpgparameter. - Renamed
_convertImageToJpgto_convertImagefor broader format support. - Improved image naming standardization logic.
- Enhanced image processing methods to support PNG format with the
-
lib/features/favorites/favorites_controller.dart:
- Created a new
FavoritesControllerto manage favorite items, encapsulating state and logic.
- Created a new
-
lib/features/favorites/favorites_screen.dart:
- Integrated the new
FavoritesControllerandFavoritesStorefor managing favorites state and UI. - Improved state handling using
StateMessageandListenableBuilder.
- Integrated the new
-
lib/features/favorites/favorites_store.dart:
- Added a new
FavoritesStoreextendingStateStoreto manage favorites state.
- Added a new
-
lib/features/payment/payment_controller.dart:
- Updated
initand_initializeControllerto includeBuildContextas a parameter for better context handling.
- Updated
-
lib/features/payment/payment_screen.dart:
- Passed
BuildContextto thePaymentControllerduring initialization.
- Passed
-
lib/features/shop/shop_controller.dart:
- Removed deprecated methods
_getAdsand_getMoreAdsto streamline the code.
- Removed deprecated methods
-
lib/features/shop/shop_screen.dart:
- Adjusted
ShopGridViewinitialization to passadsandgetMoreAdsinstead ofctrl.
- Adjusted
-
lib/get_it.dart:
- Registered
BagItemStoreas an asynchronous dependency inGetIt.
- Registered
-
lib/repository/data/parse_server/ps_boardgame_repository.dart:
- Reorganized method calls for better logical flow during board game updates.
-
lib/repository/local_data/sqlite/bag_item_repository.dart:
- Switched to using
GetItfor resolvingBagItemStoredependency.
- Switched to using
These updates enhance the modularity, readability, and maintainability of the project. New modules for managing favorites improve separation of concerns, while changes to ShopGridView streamline its use. Additional refinements in image processing and dependency management ensure greater flexibility and adherence to best practices.
This commit introduces a robust payment integration flow by transitioning from PaymentPage to PaymentScreen, updating related logic and services, and enhancing the payment brick functionality. Key improvements include refined method signatures, enhanced error handling, and streamlined parameter passing.
-
lib/app.dart:
- Renamed
PaymentPagetoPaymentScreenfor better consistency. - Updated route logic to include
amountas an additional parameter forPaymentScreen.
- Renamed
-
lib/core/models/bag_item.dart:
- Added the
toMPParametermethod to transformBagItemModelinto the format expected by the payment service.
- Added the
-
lib/features/bag/bag_controller.dart:
- Added
getPreferenceIdmethod for obtaining the payment preference ID viaPaymentService. - Added
calculateAmountmethod to compute the total amount for a list of items.
- Added
-
lib/features/bag/bag_screen.dart:
- Integrated the
_makePaymentmethod to handle the payment process and navigate toPaymentScreen. - Updated UI logic to pass
preferenceIdandamountas arguments for payment navigation.
- Integrated the
-
lib/features/bag/widgets/saller_bag.dart:
- Added
makePaymentparameter to trigger payment flow from the UI. - Updated
FilledButtonto invoke themakePaymentmethod.
- Added
-
lib/features/payment/payment_controller.dart:
- Updated
initmethod to includeamountalongsidepreferenceId. - Enhanced
_initializeControllerwith better error logging and URL construction to includeamount.
- Updated
-
lib/features/payment/payment_screen.dart:
- Renamed from
PaymentPagetoPaymentScreen. - Updated initialization to include
amountand improved state error messaging.
- Renamed from
-
lib/services/payment/payment_service.dart:
- Renamed
getPreferenceIdtogeneratePreferenceId. - Updated parameter type from
PaymentModeltoBagItemModeland aligned with thetoMPParameterformat.
- Renamed
-
parse_server/cloud/main.js:
- Improved error handling and logging in the
createPaymentPreferencecloud function. - Dynamically retrieved the Mercado Pago access token from environment variables.
- Improved error handling and logging in the
-
parse_server/public/payment_page.html:
- Updated JavaScript to include
amountin the initialization and rendered payment brick settings. - Enhanced error logging for payment brick rendering.
- Updated JavaScript to include
These updates significantly improve the payment integration process, ensuring a seamless user experience with robust error handling and better parameter management. The transition to PaymentScreen enhances modularity and maintainability across the payment flow.
This commit enhances the handling of item quantities in the shopping bag, focusing on improving the BagItemModel, updating the bag management logic, and integrating new database methods for item quantity updates. Key changes include a new updateQuantity method, refactored quantity management, and alignment across the data layer.
-
lib/core/models/bag_item.dart:
- Refactored
quantityto a public field for improved access. - Modified
increaseQtanddecreaseQtmethods to return a boolean indicating success or failure. - Updated
toStringand other methods to reflect the changes inquantity.
- Refactored
-
lib/data_managers/ad_manager.dart:
- Added documentation for the
getAdByIdmethod to clarify its purpose.
- Added documentation for the
-
lib/data_managers/bag_manager.dart:
- Introduced
_loadItemsto initialize bag items and synchronize them with the latest ad statuses and quantities. - Refined
addItem,increaseQt, anddecreaseQtto handle item quantity updates more effectively. - Enhanced
_updateCountValueto dynamically adjust the overall item count. - Added comprehensive documentation for key methods.
- Introduced
-
lib/repository/local_data/interfaces/i_local_bag_item_repository.dart:
- Added the
updateQuantitymethod to the repository interface for direct quantity updates.
- Added the
-
lib/repository/local_data/sqlite/bag_item_repository.dart:
- Implemented the
updateQuantitymethod to handle quantity updates in the SQLite database.
- Implemented the
-
lib/store/stores/bag_item_store.dart:
- Added
updateQuantityfor efficient updates of item quantities in the local database. - Enhanced
addandupdatemethods with explicitwhereclauses to improve safety and clarity.
- Added
-
lib/store/stores/interfaces/i_bag_item_store.dart:
- Introduced the
updateQuantitymethod in the store interface for consistent implementation.
- Introduced the
These updates streamline the management of item quantities within the shopping bag. The new updateQuantity method ensures efficient and reliable synchronization between the app's state and the local database. Refined methods and enhanced documentation improve maintainability, setting the stage for future enhancements.
This commit introduces a comprehensive set of updates to enhance the handling of BagItemModel in the application. Key changes include adding a local repository for bag items, improving error handling, and integrating database functionality with SQFLite. These updates also refine existing models, repositories, and controllers to align with the new structure.
-
lib/components/collection_views/ad_list_view/widgets/ad_card_view.dart:
- Updated null-safe handling of
cityandstateinAdTextInfo.
- Updated null-safe handling of
-
lib/core/models/ad.dart:
- Removed unused static methods for converting mechanics names to IDs.
- Added new properties (
ownerId,ownerName, etc.) to theAdModel. - Updated
copyWithandtoMapmethods to support the new properties. - Modified the
fromMapmethod to map new fields.
-
lib/core/models/bag_item.dart:
- Refactored
BagItemModelto include private fields (_ad,_ownerId, etc.) with getters and setters. - Added methods to manage item relationships with ads.
- Updated
toMap,fromMap, andcopyWithto include new fields and logic.
- Refactored
-
lib/core/singletons/current_user.dart:
- Introduced
BagManagerintegration for managing user-specific bag items.
- Introduced
-
lib/data_managers/bag_manager.dart:
- Added full integration with a local SQLite repository.
- Implemented initialization logic and database synchronization.
- Enhanced methods for adding, increasing, and decreasing item quantities with database updates.
-
lib/features/bag/widgets/saller_bag.dart:
- Updated references to use the refactored
BagItemModel.
- Updated references to use the refactored
-
lib/features/shop/product/product_controller.dart:
- Refactored to initialize
BagItemModelusing the newadparameter.
- Refactored to initialize
-
lib/get_it.dart:
- Registered
ILocalBagItemRepositoryand its implementation,SqliteBagItemRepository.
- Registered
-
lib/repository/local_data/common/local_functions.dart:
- Added utility methods for consistent local error handling.
-
lib/repository/local_data/interfaces/i_local_bag_item_repository.dart:
- Defined an interface for local bag item repository operations.
-
lib/repository/local_data/sqlite/bag_item_repository.dart:
- Implemented SQLite-based repository for bag item management.
-
lib/store/constants/constants.dart:
- Defined constants for the
bagItemsTableand its fields.
- Defined constants for the
-
lib/store/constants/migration_sql_scripts.dart:
- Added a migration script for creating the
bagItemsTable.
- Added a migration script for creating the
-
lib/store/constants/sql_create_table.dart:
- Introduced methods for creating, dropping, and cleaning the
bagItemsTable.
- Introduced methods for creating, dropping, and cleaning the
-
lib/store/database/database_manager.dart:
- Integrated
bagItemsTablecreation and reset functionality.
- Integrated
-
lib/store/stores/bag_item_store.dart:
- Implemented the SQLite storage layer for bag items.
-
lib/store/stores/interfaces/i_bag_item_store.dart:
- Added an interface for the
BagItemStore.
- Added an interface for the
-
lib/store/stores/mechanics_store.dart:
- Corrected a method log message for consistency.
These changes establish a robust system for managing bag items locally with SQLite, enhancing performance and scalability. They also align models, controllers, and database components with the new structure, ensuring consistency and maintainability. This update sets the foundation for future improvements in bag management features.
This commit introduces a new AdManager class to centralize advertisement management, enhances the Bag module to integrate ad details dynamically, and refactors the ShopController to utilize AdManager for fetching ads. These changes improve data organization and streamline ad-related operations across the app.
-
lib/data_managers/ad_manager.dart (New file):
- Added a new
AdManagerclass to centralize ad-related operations. - Implemented methods to fetch ads (
getAdsandgetMoreAds) and retrieve ad details by ID (getAdById). - Maintains an internal list of
AdModelinstances for efficient reuse.
- Added a new
-
lib/features/bag/bag_controller.dart:
- Integrated
AdManagerfor retrieving ad details dynamically. - Added
getAdByIdmethod to fetch and manage ad details viaAdManager.
- Integrated
-
lib/features/bag/bag_screen.dart:
- Added
_openAdmethod to navigate to theProductScreenusing ad details fetched byAdManager. - Updated
SallerBagwidget to handle the new ad opening logic.
- Added
-
lib/features/bag/widgets/saller_bag.dart:
- Refactored
SallerBagto a stateful widget. - Added an
InkWellaround ad images to trigger the_openAdcallback for navigating to the ad details screen.
- Refactored
-
lib/features/shop/shop_controller.dart:
- Replaced direct ad fetching logic with
AdManagermethods. - Removed redundant methods (
_getAdsand_getMoreAds) for cleaner code.
- Replaced direct ad fetching logic with
-
lib/features/shop/shop_screen.dart:
- Added a bag icon with a badge displaying the count of items, linking to the Bag screen.
- Refactored the app bar for improved user interaction.
-
lib/get_it.dart:
- Registered
AdManageras a singleton in the service locator.
- Registered
-
lib/repository/data/interfaces/i_ad_repository.dart:
- Added
getByIdmethod to theIAdRepositoryinterface for fetching ad details by ID.
- Added
-
lib/repository/data/parse_server/ps_ad_repository.dart:
- Implemented the
getByIdmethod to query ad details from the Parse server. - Enhanced error handling and response validation.
- Implemented the
These updates establish a more cohesive and maintainable structure for managing advertisements. The new AdManager simplifies ad-related operations and eliminates redundant code. The integration of AdManager with Bag and Shop modules improves efficiency and consistency across the app.
This commit introduces significant refinements to the bag management system, including seller-based grouping, improvements to item operations, and UI enhancements for the Bag screen. The data model has also been updated to better represent advertisement details and improve flexibility.
-
lib/core/models/bag_item.dart:
- Added a private
_adIdfield to store the advertisement ID explicitly, decoupling it fromadItem.id. - Updated the constructor to initialize
_adIdusingadId(if provided) or fallback toadItem.id. - Adjusted the
toMapmethod to include_adIdfor serialization. - Modified
fromMapto correctly initialize_adIdfrom the serialized data.
- Added a private
-
lib/data_managers/bag_manager.dart:
- Refactored
_itemsinto a private list for stricter encapsulation of Bag items. - Introduced
_bagBySeller, a map grouping items by their seller ID (ownerId). - Enhanced
addItemand_checkSellersto dynamically update_bagBySellerwhen items are added or removed. - Added
sellerNameto retrieve the name of a seller based on their ID. - Updated the
totalmethod to calculate the total price for items under a specific seller.
- Refactored
-
lib/features/bag/bag_controller.dart:
- Modified
itemsto return a filtered set ofBagItemModelinstances associated with a given seller ID.
- Modified
-
lib/features/bag/bag_screen.dart:
- Integrated seller-specific logic into the Bag screen, grouping items under their respective sellers using the
SallerBagwidget. - Adjusted the layout to dynamically display seller groups.
- Integrated seller-specific logic into the Bag screen, grouping items under their respective sellers using the
-
lib/features/bag/widgets/bag_sub_total.dart:
- Updated to accept
length(number of items) andtotal(total price) directly instead of relying onValueNotifier. - Simplified rendering logic for better readability and performance.
- Updated to accept
-
lib/features/bag/widgets/saller_bag.dart:
- Enhanced the
SallerBagwidget to acceptsallerIdandsallerNamefor displaying seller-specific details. - Improved layout with card-style design, dynamically listing items associated with the seller.
- Incorporated
BagSubTotalto show a subtotal for each seller’s group.
- Enhanced the
These updates significantly improve the flexibility and maintainability of the Bag module. By introducing _adId, the advertisement ID is now decoupled from adItem, providing a clearer separation of data concerns. The seller-based grouping enhances the user experience, and the refined widgets improve the Bag screen’s overall usability.
This commit enhances the AdModel by integrating additional owner details, optimizes the bag management process, and introduces seller grouping functionality in the Bag module. Key changes also include refining Parse server integration and improving the AdsSale validation logic.
-
lib/components/collection_views/shop_grid_view/widgets/ad_shop_view.dart:
- Removed unnecessary
dart:mathimport. - Updated
OwnerRatingwidget to useownerNameandownerRateinstead ofowner.nameand a random integer.
- Removed unnecessary
-
lib/components/collection_views/shop_grid_view/widgets/owner_rating.dart:
- Replaced
startsparameter withnotefor a clearer rating representation. - Removed hardcoded
noteinitialization inside the widget.
- Replaced
-
lib/core/models/ad.dart:
- Added new owner-related fields:
ownerId,ownerName,ownerRate,ownerCity, andownerCreateAt.
- Added new owner-related fields:
-
lib/data_managers/bag_manager.dart:
- Introduced
_sellerIdsto track unique seller IDs in the bag. - Added
_checkSellersmethod to maintain the list of unique sellers dynamically. - Refactored logic in
addItemanddecreaseQtto call_checkSellerswhen items are added or removed.
- Introduced
-
lib/features/bag/bag_screen.dart:
- Replaced inline item rendering logic with a dynamic seller-based grouping using the new
SallerBagwidget. - Simplified imports for consistency.
- Replaced inline item rendering logic with a dynamic seller-based grouping using the new
-
lib/features/bag/widgets/saller_bag.dart (New file):
- Introduced
SallerBagwidget to group items by seller and display them in the Bag screen.
- Introduced
-
lib/features/edit_ad/edit_ad_controller.dart:
- Ensured
store.ad.owneris updated with the current user before saving an ad.
- Ensured
-
lib/features/shop/product/product_screen.dart:
- Updated
UserCardusage to includeownerName,ownerRate,ownerCity, andownerCreateAt.
- Updated
-
lib/features/shop/product/widgets/user_card_product.dart:
- Added
rateparameter to dynamically display the owner’s rating. - Adjusted address display to use a single string instead of an
AddressModel.
- Added
-
lib/repository/data/parse_server/common/constants.dart:
- Added constants for new owner fields:
keyAdOwnerId,keyAdOwnerName,keyAdOwnerRate,keyAdOwnerCity, andkeyAdOwnerCreatedAt. - Corrected typo in
keyAdBoardGame.
- Added constants for new owner fields:
-
lib/repository/data/parse_server/common/parse_to_model.dart:
- Enhanced
admethod to parse and populate new owner fields. - Added optional
fullparameter to control whether address and user details are fetched.
- Enhanced
-
lib/repository/data/parse_server/ps_ad_repository.dart:
- Updated
savemethod to include new owner fields in the ad creation process. - Enhanced
getmethod with afullparameter to include or exclude related objects.
- Updated
-
parse_server/cloud/main.js:
- Improved
AdsSalevalidation logic to handle missing boardgame references more gracefully. - Added conditional logic to skip validation when no boardgame is referenced.
- Improved
These updates significantly improve the Bag and Ads modules by introducing seller-based grouping, refining owner data integration, and enhancing the validation process. These changes also improve maintainability and prepare the codebase for more robust feature implementation.
This commit introduces significant enhancements and restructuring within the bgbazzar project. It focuses on replacing the CartManager and CartItemModel with the newly implemented BagManager and BagItemModel. Additional updates include the creation of new screens and controllers for managing the shopping bag, refinements in model handling, and adjustments to address dependencies.
-
assets/svg/Stars.svg:
- Updated export filename references for SVG layers to reflect new usage:
star_full,star_empty, andstar_half. - Added modifications to the layer display settings for improved visualization.
- Updated export filename references for SVG layers to reflect new usage:
-
lib/app.dart:
- Added the
BagScreenroute for navigation.
- Added the
-
lib/core/models/bag_item.dart:
- Introduced
BagItemModelto replace the previousCartItemModel, with functionality to handle quantities and pricing logic.
- Introduced
-
lib/core/models/cart_item.dart (Deleted):
- Removed the obsolete
CartItemModel.
- Removed the obsolete
-
lib/core/models/sale.dart → lib/core/models/sales.dart:
- Renamed file for consistency in naming conventions.
- Replaced usage of
SaleItemModelwithBagItemModel. - Simplified item addition and removal logic in the sales model.
-
lib/data_managers/bag_manager.dart:
- Introduced
BagManagerto handle shopping bag logic, replacingCartManager. - Added methods to manage bag items, quantities, and total calculations.
- Introduced
-
lib/data_managers/cart_manager.dart (Deleted):
- Removed the obsolete
CartManager.
- Removed the obsolete
-
lib/features/account/my_ads/my_ads_controller.dart:
- Adjusted to use
status.nameinstead ofstatus.indexfor ad status management.
- Adjusted to use
-
lib/features/account/my_ads/widgets/my_tab_bar_view.dart:
- Removed commented-out, redundant code to streamline logic.
-
lib/features/bag/bag_controller.dart:
- Added
BagControllerfor managing the shopping bag state and interaction withBagStoreandBagManager.
- Added
-
lib/features/bag/bag_screen.dart:
- Introduced a new
BagScreenfor displaying and managing the shopping bag.
- Introduced a new
-
lib/features/bag/bag_store.dart:
- Created
BagStoreextendingStateStoreto manage the bag's state.
- Created
-
lib/features/bag/widgets/bag_sub_total.dart:
- Added widget to display the bag's subtotal with item count and total price.
-
lib/features/bag/widgets/quantity_buttons.dart:
- Introduced reusable quantity adjustment buttons for bag items.
-
lib/features/shop/product/procuct_store.dart:
- Added
ProcuctStorefor state management within product-related operations.
- Added
-
lib/features/shop/product/product_controller.dart:
- Created
ProductControllerto handle product interactions, including adding items to the bag.
- Created
-
lib/features/shop/product/product_screen.dart:
- Integrated the new bag functionality, including navigation to the
BagScreenand adding items to the bag.
- Integrated the new bag functionality, including navigation to the
-
lib/features/shop/product/widgets/description_product.dart:
- Enhanced styling for the product description section.
-
lib/features/shop/product/widgets/location_product.dart (Deleted):
- Removed unused
LocationProductwidget.
- Removed unused
-
lib/features/shop/product/widgets/sub_title_product.dart:
- Improved subtitle styling with bold text.
-
lib/features/shop/product/widgets/title_product.dart:
- Adjusted title styling for better visibility.
-
lib/features/shop/product/widgets/user_card_product.dart:
- Added user location and star rating display for enhanced user interaction.
-
lib/get_it.dart:
- Replaced
CartManagerregistration withBagManager. - Ensured proper disposal of
BagManager.
- Replaced
-
lib/repository/data/interfaces/i_ad_repository.dart:
- Updated method parameters to use string-based statuses instead of integers.
-
lib/repository/data/parse_server/common/parse_to_model.dart:
- Adjusted status handling to use string values instead of indices.
-
lib/repository/data/parse_server/ps_ad_repository.dart:
- Updated ad status and condition handling to use
nameinstead ofindex.
- Updated ad status and condition handling to use
-
parse_server/cloud/main.js:
- Added logic to skip restrictions when using the MasterKey for specific cloud functions.
These changes enhance the maintainability and functionality of the shopping bag system, improve naming consistency, and integrate new features into the product and bag workflows. The updates also streamline state management and ensure alignment with updated project standards.
This commit introduces enhancements to the star rating display, adds SVG and PNG resources for visual representation, and refines functionality across various components.
-
assets/images/star_empty.png, star_full.png, star_half.png:
- Added PNG assets for empty, full, and half stars to support the star rating visualization.
-
assets/svg/Stars.svg:
- Added an SVG resource for star shapes, created with Inkscape for vector-based customization and potential export to other formats.
-
lib/components/collection_views/shop_grid_view/widgets/owner_rating.dart:
- Adjusted the
notevariable from4.5to4.2to demonstrate dynamic star ratings.
- Adjusted the
-
lib/components/collection_views/shop_grid_view/widgets/star_rating_bar.dart:
- Removed the
material_symbols_iconsdependency for icons. - Updated
_createRateRowto dynamically generate star ratings using PNG assets for empty, half, and full stars. - Added logic to handle half-star ratings by rounding the
ratevalue appropriately.
- Removed the
-
lib/components/widgets/favorite_button.dart:
- Updated the icon color logic to conditionally assign
nullwhen the ad is not a favorite, improving UI consistency.
- Updated the icon color logic to conditionally assign
This commit enhances the user experience by implementing a dynamic and visually engaging star rating system. The inclusion of SVG and PNG assets ensures flexibility for design adjustments. Additional refinements improve functionality and readability across the codebase.
This commit enhances several components and features across the project, introducing new widgets, refining functionality, and improving overall maintainability and readability.
-
lib/components/collection_views/shop_grid_view/widgets/owner_rating.dart:
- Added the import for
star_rating_bar.dart. - Replaced the manual star rating display logic with the new
StarRatingBarwidget. - Introduced a fixed note value for demonstration purposes.
- Added the import for
-
lib/components/collection_views/shop_grid_view/widgets/star_rating_bar.dart:
- Added a new widget
StarRatingBarto handle dynamic star ratings visually. - Implemented a method
_createRateRowto dynamically create star icons based on the given rating. - Designed the widget for reusability across other components.
- Added a new widget
-
lib/components/widgets/favorite_button.dart:
- Set the icon color to red for the
FavoriteStackButtonto improve visual feedback.
- Set the icon color to red for the
-
lib/core/models/ad.dart:
- Updated the default value for
conditioninAdModelfromProductCondition.alltoProductCondition.used.
- Updated the default value for
-
lib/features/edit_ad/edit_ad_controller.dart:
- Added
_loadBoardgamemethod to initialize form fields with ad data. - Integrated
_loadBoardgameinto theinitmethod to prepopulate the form.
- Added
-
lib/features/edit_ad/edit_ad_form/edit_ad_form.dart:
- Adjusted the layout of descriptive text to include ellipsis and max lines for better UX.
-
lib/features/edit_ad/edit_ad_screen.dart:
- Fixed navigation logic by passing the updated ad object when popping the screen.
- Removed unnecessary debug-related
IconButton.
-
lib/features/edit_ad/edit_ad_store.dart:
- Added
moveImageLeftandmoveImageRightmethods to handle reordering of images. - Refactored
addImageandremoveImagemethods to enhance readability and maintainability.
- Added
-
lib/features/edit_ad/image_list/image_list_controller.dart:
- Simplified URL validation logic in
removeImageby replacing regex withstartsWith.
- Simplified URL validation logic in
-
lib/features/edit_ad/image_list/image_list_view.dart:
- Integrated reordering capabilities into the
HorizontalImageGallerywidget. - Adjusted layout dimensions for better visual consistency.
- Integrated reordering capabilities into the
-
lib/features/edit_ad/widgets/horizontal_image_gallery.dart:
- Modified the widget to utilize
EditAdStorefor state management. - Implemented reordering functionality using the new
moveImageLeftandmoveImageRightmethods fromEditAdStore. - Enhanced UX by adding icons for reordering and deletion directly on images.
- Modified the widget to utilize
-
lib/features/shop/shop_screen.dart:
- Replaced inline "no ads found" message with the newly created
AdsNotFoundMessagewidget. - Removed redundant imports and comments for cleaner code.
- Replaced inline "no ads found" message with the newly created
-
lib/features/shop/widgets/ads_not_found_message.dart:
- Introduced a new reusable widget
AdsNotFoundMessageto display a "no ads found" message. - Styled the widget for consistency with the app's design system.
- Introduced a new reusable widget
These updates significantly improve code modularity, readability, and user experience. The addition of reusable components like StarRatingBar and AdsNotFoundMessage promotes maintainability, while enhancements to image handling and ad editing functionality streamline workflows for both developers and end users.
This commit introduces significant enhancements and new functionality across multiple modules, focusing on boardgame and mechanics management, Parse Server integration, and cloud function improvements.
-
lib/data_managers/boardgames_manager.dart:- Added
deletemethod to handle the deletion of boardgames from both Parse Server and local repository. - Improved error handling for boardgame-related operations.
- Added
-
lib/features/account/boardgames/boardgames_controller.dart:- Introduced
addBGandremoveBgmethods to manage boardgame addition and deletion. - Enhanced error logging and state handling for boardgame operations.
- Introduced
-
lib/features/account/boardgames/boardgames_screen.dart:- Integrated boardgame deletion confirmation with
SimpleQuestionDialog. - Refactored
editBoardgameandaddBoardgamelogic for consistency.
- Integrated boardgame deletion confirmation with
-
lib/features/account/boardgames/boardgames_store.dart:- Added
updateBGListnotifier to track boardgame list updates. - Implemented
notifiesUpadteBGListmethod to handle UI refreshes after operations.
- Added
-
lib/features/account/boardgames/widgets/dismissible_boardgame.dart:- Created a new widget to handle swipe actions for editing or deleting boardgames.
-
lib/features/account/mechanics/mechanics_controller.dart:- Renamed
resetMechstoremoveMechsfor better semantic clarity. - Added calls to
notifiesUpdateMechListafter mechanics operations.
- Renamed
-
lib/features/account/mechanics/mechanics_store.dart:- Added
updateMechListnotifier to manage mechanics list updates dynamically.
- Added
-
lib/features/edit_ad:- Moved
AdStatusandProductConditionstate management toEditAdStore. - Updated
edit_ad_controller.dart,edit_ad_form.dart, andedit_ad_store.dartfor improved separation of concerns.
- Moved
-
lib/repository/data/interfaces/i_boardgame_repository.dart:- Added
deletemethod to the boardgame repository interface.
- Added
-
lib/repository/data/parse_server:ps_boardgame_repository.dart: Implementeddeletemethod for removing boardgames from Parse Server.common/ps_functions.dart: AddedcreateSharedAclmethod for public write access to shared items.common/constants.dart: Fixed typo inkeyAdBoardGame.
-
lib/repository/local_data/sqlite/bg_names_repository.dart:- Added
deletemethod for local boardgame removal.
- Added
-
lib/store/stores:bg_names_store.dart: Added adeletemethod to support boardgame removal.interfaces/i_bg_names_store.dart: Updated the interface to include thedeletemethod.
-
parse_server/cloud/main.js:- Added multiple cloud functions:
createPaymentPreference: Generates Mercado Pago payment preferences.updateStockAndStatus: Updates stock and marks items as sold when depleted.afterSaveforParse.User: Automatically assigns new users to theuserrole.beforeSaveandbeforeDeleteforBoardgame: Restricts access to admin users only.beforeSaveforAdsSale: Validates the referenced boardgame during ad creation.
- Added multiple cloud functions:
These updates enhance the application's robustness by introducing comprehensive boardgame and mechanics management, refining the integration with Parse Server, and adding key cloud function validations. This improves maintainability, security, and user experience.
This commit enhances the mechanics management module, improves functionality across multiple files, refines code consistency, and introduces new capabilities for local database reset and CSV import. Key updates include adding the CSV library, refining methods, and improving state handling.
-
assets/data/bgBazzar.db:- Updated the binary database file.
-
lib/data_managers/boardgames_manager.dart:- Updated
image.startsWithlogic to check forkeyParseServerImageUrl. - Added a condition to prevent the deletion of remote files by skipping paths starting with
http.
- Updated
-
lib/data_managers/mechanics_manager.dart:- Renamed the method
resetDatabasetoresetLocalDatabase. - Added new methods
getMechanicsandaddLocalDatabasefor handling local database operations. - Improved exception handling for database operations.
- Renamed the method
-
lib/features/account/check_mechanics/check_controller.dart:- Integrated the new
resetLocalDatabaseandgetMechanicsmethods. - Introduced
loadCSVMechsto import mechanics from a CSV file. - Improved error handling and streamlined the mechanics reset process.
- Integrated the new
-
lib/features/account/check_mechanics/check_page.dart:- Refactored UI structure for better readability.
- Improved the mechanics count logic and loading state messages.
-
lib/features/account/check_mechanics/check_store.dart:- Added
counterMaxto enhance state tracking during operations. - Updated the
resetCountmethod to initialize the counter value.
- Added
-
lib/features/account/mechanics/mechanics_controller.dart:- Renamed
deleteMechtoresetMechsfor better semantic clarity.
- Renamed
-
lib/features/account/mechanics/mechanics_screen.dart:- Updated the call to
resetMechsto align with the renamed method.
- Updated the call to
-
lib/features/account/mechanics/widgets/mach_floating_action_button.dart:- Adjusted
heroTagvalues for floating action buttons to improve UI state management.
- Adjusted
-
pubspec.lockandpubspec.yaml:- Added the
csvlibrary (version 6.0.0) to handle CSV file operations.
- Added the
These updates significantly enhance the mechanics management module by improving local database operations, introducing CSV import capabilities, and refining UI handling. The changes ensure better code readability, state management, and overall maintainability.
This commit introduces comprehensive updates across various modules, focusing on improving functionality, refactoring code, and adding new features related to payment, cart, and user management.
-
lib/components/drawers/custom_drawer.dart:
- Removed unused
dart:developerimport. - Deleted a redundant
logstatement to clean up the logout function.
- Removed unused
-
lib/core/models/ad.dart:
- Added
quantityfield to theAdModelclass. - Implemented
toMap,fromMap,toJson, andfromJsonmethods for serialization. - Removed the
hidePhonefield.
- Added
-
lib/core/models/cart_item.dart:
- Created a new
CartItemModelclass for managing items in the cart. - Added serialization and deserialization methods.
- Created a new
-
lib/core/models/payment.dart:
- Refactored fields to include
title,unitPrice, andquantity. - Added serialization and deserialization methods.
- Refactored fields to include
-
lib/core/models/sale.dart:
- Created the
SaleModelclass to manage sales, includingSaleStatusand methods for handling sale items and status updates.
- Created the
-
lib/core/models/sale_item.dart:
- Created the
SaleItemModelclass to represent items in a sale, including basic fields liketitle,description,quantity, andunitPrice.
- Created the
-
lib/core/models/user.dart:
- Replaced
UserTypewithUserRolefor better naming clarity. - Updated serialization and related logic accordingly.
- Replaced
-
lib/data_managers:
- Added
CartManagerto handle cart-specific operations. - Enhanced
MechanicsManagerto support resetting the database.
- Added
-
lib/features:
- Introduced
CartController,CartStore, andCartScreenfor cart management. - Refactored
EditAdControllerandEditAdFormto include quantity handling. - Updated the
EditAdStoreto removehidePhoneand includequantity. - Enhanced
CheckMechanicsControllerto support resetting mechanics. - Added error handling and state management improvements in
PaymentController.
- Introduced
-
lib/repository/data:
- Refactored interfaces and repositories to use
DataResultfor consistent error handling. - Enhanced
PSUserRepositoryto include theremoveByEmailmethod andUserRolehandling.
- Refactored interfaces and repositories to use
-
lib/store:
- Added
resetDatabasemethods to stores for mechanics and board game names.
- Added
-
parse_server:
- Created new Cloud Functions for assigning users to roles and managing stock updates.
- Added support for
Payment Brickin thepayment_page.html.
These updates enhance the overall functionality, readability, and scalability of the codebase. The introduction of new models and controllers provides better modularization, while the refactorings improve maintainability and robustness.
This commit enhances the structure and functionality of the ad management features, implementing a more modular and streamlined approach to managing dismissible actions, handling empty states, and renaming the main app entry point.
-
Renamed Main App Class:
- lib/my_material_app.dart → lib/app.dart: Renamed
MyMaterialApptoAppfor a simpler, more intuitive app entry point. - lib/main.dart: Updated main entry file to reference
Appinstead ofMyMaterialApp.
- lib/my_material_app.dart → lib/app.dart: Renamed
-
Simplified Dismissible Ad Configuration:
-
lib/components/collection_views/ad_list_view/ad_list_view.dart:
- Removed redundant properties (e.g., color, icon, label for dismissible actions).
- Simplified
DismissibleAdinstantiation by passing onlyadStatus.
-
lib/components/collection_views/ad_list_view/widgets/dismissible_ad.dart:
- Removed individual configuration parameters for each side and replaced them with
MyAdsDismissible, which centralizes logic for determining dismissible properties.
- Removed individual configuration parameters for each side and replaced them with
-
-
Centralized Dismissible Properties Logic:
- lib/features/my_account/my_ads/model/my_ads_dismissible.dart:
- Created
MyAdsDismissibleto handle side-specific properties (color, icon, label, status) based onAdStatus. - Consolidates all dismissible configuration in one place, reducing code duplication and improving readability.
- Created
- lib/features/my_account/my_ads/model/my_ads_dismissible.dart:
-
Enhanced Empty State Handling:
-
lib/features/my_account/my_ads/my_ads_screen.dart:
- Replaced inlined empty state handling with the
NoAdsFoundCardwidget for consistent presentation when no ads are found.
- Replaced inlined empty state handling with the
-
lib/features/my_account/my_ads/widgets/no_ads_found_card.dart:
- Added
NoAdsFoundCardwidget to provide a reusable card UI for empty states with a message and icon.
- Added
-
-
Removed Unused Code and Improved Naming:
-
lib/features/my_account/my_ads/my_ads_controller.dart:
- Renamed
_adPageto_adsDataBasePagefor clarity. - Cleaned up redundant code related to pagination.
- Renamed
-
lib/features/my_account/my_ads/my_ads_store.dart:
- Added constants for tab indices and selected tab properties to streamline the tab management in
MyAdsStore.
- Added constants for tab indices and selected tab properties to streamline the tab management in
-
-
Streamlined Tab Bar View Logic:
- lib/features/my_account/my_ads/widgets/my_tab_bar_view.dart:
- Refactored the tab bar view to remove hardcoded configurations and integrate the new
MyAdsDismissible. - Updated logic to display
NoAdsFoundCardwhen the ads list is empty.
- Refactored the tab bar view to remove hardcoded configurations and integrate the new
- lib/features/my_account/my_ads/widgets/my_tab_bar_view.dart:
This refactor optimizes the ad management feature by reducing redundancy, improving naming conventions, and providing a modular approach to handling dismissible actions. The introduction of MyAdsDismissible centralizes logic, making future modifications easier, while the NoAdsFoundCard provides a consistent user experience for empty states.
This commit refines the ad editing functionality, improves naming conventions, and introduces enhancements in controller and store management. Key changes include renaming the EditAdFormController to EditAdController, adding ad saving functionality, and fixing typos in constants.
-
lib/features/edit_ad/edit_ad_form/edit_ad_form_controller.dart → lib/features/edit_ad/edit_ad_controller.dart:
- Renamed
EditAdFormControllertoEditAdControllerto improve naming consistency. - Added
saveAdmethod to handle the process of saving or updating ads, including error handling and status management.
- Renamed
-
lib/features/edit_ad/edit_ad_form/edit_ad_form.dart:
- Updated imports to use
EditAdController. - Modified
EditAdFormconstructor to accept the newctrl(controller) parameter, ensuring consistency.
- Updated imports to use
-
lib/features/edit_ad/edit_ad_screen.dart:
- Updated the ad save function,
_saveAd, which now leverages the newsaveAdmethod fromEditAdController. - Integrated
EditAdControllerinto the screen’s lifecycle methods (initState,dispose) to manage state properly.
- Updated the ad save function,
-
lib/features/edit_ad/edit_ad_store.dart:
- Renamed
startAdtoinitfor a clearer initialization purpose. - Refined
removeImagemethod logic to correctly update images and handle validation.
- Renamed
-
lib/repository/data/parse_server/common/constants.dart:
- Corrected typo in
keyAdBoardGameconstant (waskeyAdBoargGame), aligning the naming with conventional spelling.
- Corrected typo in
-
lib/repository/data/parse_server/ps_ad_repository.dart:
- Updated the
setNonNullmethod to use the correctedkeyAdBoardGameconstant.
- Updated the
These updates improve the readability and maintainability of the ad editing module. The renaming of classes and methods enhances clarity, while the addition of the saveAd method streamlines the ad saving process. Additionally, the correction in constants prevents potential issues with database field names.
This commit introduces several enhancements across the board games and mechanics management features, including functionality improvements, bug fixes, and modularization. Key updates include improving board game selection and editing capabilities, refining controller and store structures, and simplifying component usage in mechanics handling.
-
lib/features/my_account/boardgames/boardgames_controller.dart:
- Modified
selectBGIdmethod to be synchronous, enhancing responsiveness in selecting board games. - Updated
getBoardgameSelectedto accept an optionalbgIdparameter, improving flexibility when fetching specific board game details.
- Modified
-
lib/features/my_account/boardgames/boardgames_screen.dart:
- Enhanced
_editBoardgamemethod to accept aBGNameModelparameter for precise editing of board games. - Replaced inline
ListTilelogic with the newDismissibleBoardgamewidget for better UI handling of board game list items.
- Enhanced
-
lib/features/my_account/boardgames/widgets/custom_floating_action_bar.dart:
- Removed the
editBoardgamebutton, simplifying the floating action button's functionality.
- Removed the
-
lib/features/my_account/boardgames/widgets/dismissible_boardgame.dart:
- Introduced the
DismissibleBoardgamewidget to handle swipe actions on board games, supporting both edit and delete actions with customizable UI.
- Introduced the
-
lib/features/my_account/boardgames/edit_boardgame/edit_boardgame_controller.dart:
- Refactored references from
boardgametobgto maintain consistency with updated variable names.
- Refactored references from
-
lib/features/my_account/boardgames/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart:
- Updated
initandsetMechanicsPsIdsmethods to better integrate mechanics with the board game editing form.
- Updated
-
lib/features/my_account/boardgames/edit_boardgame/edit_boardgame_store.dart:
- Renamed
boardgamevariable tobgfor consistency and streamlined its usage across methods.
- Renamed
-
lib/features/my_account/mechanics/mechanics_controller.dart:
- Updated
initmethod to remove unnecessarypsIdsparameter, simplifying initialization logic.
- Updated
-
lib/features/my_account/mechanics/mechanics_screen.dart:
- Adjusted constructor parameter
selectedPsIdstoselectedMechIdsto better align with naming conventions. - Updated initialization to match the modified
MechanicsControllerstructure.
- Adjusted constructor parameter
-
lib/features/my_account/mechanics/mechanics_store.dart:
- Implemented
initmethod to initialize selected mechanics from a list of IDs, enhancing the store's setup flexibility.
- Implemented
-
lib/features/my_account/my_ads/my_ads_controller.dart:
- Corrected the
initmethod to properly assign the providedstoreto the instance variable, fixing initialization issues.
- Corrected the
-
lib/my_material_app.dart:
- Modified route argument for
MechanicsScreento useselectedMechIds, ensuring parameter consistency throughout the app.
- Modified route argument for
This commit significantly enhances both the board games and mechanics features by improving initialization flexibility, standardizing variable names, and introducing modular widgets for list items. These updates contribute to a more maintainable codebase and improved user experience.
This commit introduces several updates to the mechanics feature, including UI enhancements, model functionality improvements, and better modularity in code structure. Notable updates are the addition of the copyWith method to MechanicModel, the implementation of a new MechAppBar and MechFloatingActionButton, and updates to MechanicDialog for edit functionality.
-
lib/core/models/mechanic.dart:
- Added a
copyWithmethod to allow easy cloning and updating ofMechanicModelinstances. - Overridden
==andhashCodefor more reliable equality checks, comparingid,name, anddescriptionfields.
- Added a
-
lib/data_managers/mechanics_manager.dart:
- Removed an unnecessary log statement to clean up the code.
-
lib/features/my_account/mechanics/mechanics_controller.dart:
- Added an
updatemethod to handle updates toMechanicModelinstances, including setting states for loading, success, and error.
- Added an
-
lib/features/my_account/mechanics/mechanics_screen.dart:
- Replaced the custom app bar and floating action button with modularized widgets:
MechAppBarandMechFloatingActionButton. - Added
_editMechanicfunction to allow editing a mechanic by openingMechanicDialogwith pre-filled data from the selected mechanic.
- Replaced the custom app bar and floating action button with modularized widgets:
-
lib/features/my_account/mechanics/widgets/mach_floating_action_button.dart:
- Created
MechFloatingActionButtonto encapsulate floating action button functionalities, including options to add, deselect, and go back. Access is controlled based on user role.
- Created
-
lib/features/my_account/mechanics/widgets/mech_app_bar.dart:
- Developed
MechAppBarto encapsulate app bar functionalities, including title display, search, hide/show description, and filter selected mechanics.
- Developed
-
lib/features/my_account/mechanics/widgets/mechanic_dialog.dart:
- Updated
MechanicDialogto support both add and edit functionalities. Now, when editing, it displays the current values and adjusts button text and icons based on theisEditstate. - Adjusted dialog layout to improve usability, including setting padding and customizing dialog shapes.
- Updated
-
lib/features/my_account/mechanics/widgets/show_mechs/show_all_mechs.dart:
- Updated
ShowAllMechsto support the neweditMechaniccallback, allowing items to be edited directly.
- Updated
These updates enhance the user experience and maintainability of the mechanics feature. By modularizing components and adding edit functionality, the UI becomes more intuitive and flexible, and the code becomes easier to manage and extend.
This commit refines and extends various database-related classes and dependency registrations, enhancing modularity, initialization control, and error handling. Notable changes include the introduction of initialize methods for deferred asynchronous initialization, interface updates, and error message corrections.
-
lib/data_managers/boardgames_manager.dart:
- Modified
localBoardgameRepositoryto be a late final variable. - Added an asynchronous initialization of
localBoardgameRepositorywithin theinitializemethod.
- Modified
-
lib/data_managers/mechanics_manager.dart:
- Renamed
_localAddto_addLocalMechanicDatafor clarity. - Adjusted the error-checking logic to ensure mechanics are only added when the
idisnull.
- Renamed
-
lib/get_it.dart:
- Registered
IBgNamesStoreandIBgNamesRepositoryasynchronously withinitializemethods to ensure deferred loading.
- Registered
-
lib/repository/local_data/interfaces/i_bg_names_repository.dart:
- Added an
initializemethod toIBgNamesRepository, enabling asynchronous setup of repositories.
- Added an
-
lib/repository/local_data/sqlite/bg_names_repository.dart:
- Introduced
initializeto set upbgNamesStoreasynchronously. - Updated calls to
bgNamesStoremethods, replacing previous static calls with instance-based calls.
- Introduced
-
lib/store/stores/bg_names_store.dart:
- Implemented
initializeto prepare the database instance asynchronously. - Transitioned static methods (
getAll,add,update) to instance methods, aligning with theIBgNamesStoreinterface.
- Implemented
-
lib/store/stores/interfaces/i_bg_names_store.dart:
- Created a new interface
IBgNamesStore, defining methodsinitialize,getAll,add, andupdate.
- Created a new interface
-
lib/store/stores/mechanics_store.dart:
- Corrected error log messages to improve consistency and accuracy.
- Fixed an issue in the
deletemethod, adjusting thewhereclause syntax for SQL query correctness.
These changes improve the flexibility and structure of the database management modules by introducing asynchronous initialization, refined method naming, and enhanced error handling. These updates will facilitate smoother integration and setup of repositories while promoting a more modular codebase.
This commit introduces substantial improvements and refactoring to the mechanics-related features, including enhanced modularization, dependency management, and data handling. Additionally, redundant API repositories were removed, and the setup for local repositories and SQLite operations was optimized for better maintainability and performance.
-
lib/components/widgets/base_dismissible_container.dart:
- Enhanced conditional styling for
IconandTextcolor properties within the dismissible container based on theenableflag.
- Enhanced conditional styling for
-
lib/data_managers/mechanics_manager.dart:
- Refactored
initializeto load the repository asynchronously. - Updated
getAllMechanicsand related methods to useDataResultfor consistent error handling. - Added a
deletemethod for mechanics with error handling and logging improvements.
- Refactored
-
lib/features/my_account/mechanics/:
- check_mechanics files relocated under a consolidated directory.
- Updated imports across
check_controller.dart,check_page.dart, andcheck_store.dartto reflect new paths. - Adjusted UI components to support updated
MechanicsStoremethods.
-
lib/features/my_account/mechanics/widgets/show_mechs:
- Created
DismissibleMechwidget to encapsulate logic for swipe actions on mechanics with save and delete functions. - Split and organized
show_all_mechs.dartandshow_only_selected_mechs.dartundershow_mechs.
- Created
-
lib/get_it.dart:
- Modified
ILocalMechanicRepositoryregistration to use asynchronous initialization for improved dependency management.
- Modified
-
lib/repository:
- Removed unused
gov_apirepositories (ibge_repository.dartandviacep_repository.dart), streamlining the codebase and reducing external dependencies.
- Removed unused
-
lib/repository/local_data/interfaces/i_local_mechanic_repository.dart:
- Updated method signatures to return
DataResultfor enhanced error handling consistency. - Introduced an
initializemethod for repositories requiring setup.
- Updated method signatures to return
-
lib/repository/local_data/sqlite/mechanic_repository.dart:
- Refactored methods to return
DataResultfor uniform error handling. - Integrated
_mechanicsStorewith asynchronous initialization. - Implemented comprehensive error logging and custom
DataResultresponses.
- Refactored methods to return
-
lib/store/stores/interfaces/i_mechanics_store.dart:
- Defined a new interface
IMechanicsStorefor mechanics-related database operations, providing a consistent contract for SQLite operations.
- Defined a new interface
-
lib/store/stores/mechanics_store.dart:
- Refactored
MechanicsStoreto implementIMechanicsStore. - Moved SQLite initialization logic to an
initializemethod and removed static references for better dependency management. - Enhanced CRUD methods with error handling and reduced code duplication.
- Refactored
-
lib/my_material_app.dart:
- Updated import paths for
check_mechanics/check_page.dartto reflect the new directory structure.
- Updated import paths for
-
lib/repository/data/parse_server/ps_mechanics_repository.dart:
- Corrected the
deletemethod by updating the table name key, ensuring proper data manipulation on the Parse Server.
- Corrected the
This refactor streamlines data management and dependency injection, ensuring more robust error handling and simplified maintenance. The removal of unused API repositories and restructuring of SQLite interfaces significantly reduces technical debt, while the modularized codebase improves readability and scalability. These changes prepare the project for further enhancements and support a cleaner, more manageable architecture.
This commit enhances the project structure by expanding documentation in the README.md file, reorganizing files related to mechanics and payment, and updating the navigation and import paths accordingly. These changes improve clarity and make the codebase easier to navigate, while the new documentation provides a comprehensive overview for future developers.
-
README.md:
- Expanded project documentation, including an overview, folder structure, and best practices.
- Added a detailed description of each main directory and its responsibilities, such as
components,core,data_managers,features,repository,services, andstore. - Outlined the modular approach to organizing UI components, state management, and business logic, emphasizing code reusability and maintainability.
-
lib/features/check_mechanics/check_controller.dart:
- Moved to
lib/features/my_account/mechanics/check_mechanics/check_controller.dart. - Updated import paths to point to the new structure for
mechanics_managerand core models.
- Moved to
-
lib/features/check_mechanics/check_page.dart:
- Relocated to
lib/features/my_account/mechanics/check_mechanics/check_page.dart. - Updated import paths for widgets, aligning with the new folder structure.
- Relocated to
-
lib/features/check_mechanics/check_store.dart:
- Moved to
lib/features/my_account/mechanics/check_mechanics/check_store.dart. - Adjusted imports to reflect the reorganization, including paths for
mechanicmodels andstate_store.
- Moved to
-
lib/features/my_account/widgets/admin_hooks.dart:
- Updated import paths to accommodate the new location of
check_mechanics/check_page.dart.
- Updated import paths to accommodate the new location of
-
lib/features/payment_web_view/:
- Renamed
payment_web_viewtopaymentfor simplicity and consistency. - Relocated files such as
payment_controller.dart,payment_page.dart, andpayment_store.dartunderlib/features/payment/.
- Renamed
-
lib/my_material_app.dart:
- Updated import paths for
payment_pageandcheck_mechanics/check_pageto reflect the new directory structure.
- Updated import paths for
The expanded README and structural changes improve the documentation and modularity of the codebase. By clearly defining folder responsibilities and enhancing navigation paths, the project is now more maintainable, with a foundation for efficient future development. The refined structure ensures that components, state management, and logic are properly organized, supporting scalability and ease of collaboration.
This commit focuses on reorganizing the project's folder structure, renaming files, and updating import paths to enhance the modularity and maintainability of the codebase. The changes consolidate core components, data managers, and UI features, making the structure more intuitive and easier to navigate.
-
lib/features/my_data/my_data_controller.dart:
- Moved to
lib/features/my_account/my_data/my_data_controller.dart. - Updated import paths for models, singletons, and utilities, reflecting the new structure in
core,data_managers, andcomponents.
- Moved to
-
lib/features/my_data/my_data_screen.dart:
- Relocated to
lib/features/my_account/my_data/my_data_screen.dart. - Adjusted imports to match the updated folder structure and renamed paths.
- Relocated to
-
lib/features/my_account/widgets/admin_hooks.dart:
- Updated imports, reflecting renamed paths for
BoardgamesScreen,MechanicsScreen, and product widgets.
- Updated imports, reflecting renamed paths for
-
lib/features/my_account/widgets/config_hooks.dart:
- Renamed and reorganized imports for
AddressesScreenandMyDataScreen, aligning them with the new modular paths.
- Renamed and reorganized imports for
-
lib/features/my_account/widgets/sales_hooks.dart:
- Adjusted import paths for
MyAdsScreenand product widgets.
- Adjusted import paths for
-
lib/features/my_account/widgets/shopping_hooks.dart:
- Modified import paths to integrate updated
shop/productwidgets.
- Modified import paths to integrate updated
-
lib/features/payment_web_view/payment_store.dart:
- Updated import path for
StateStoreto reflect its new location incore/state.
- Updated import path for
-
lib/features/product/product_screen.dart:
- Moved to
lib/features/shop/product/product_screen.dartand adjusted imports to reflect the restructured paths.
- Moved to
-
lib/features/product/widgets/ (multiple files):
- Files under
widgetswere moved tolib/features/shop/product/widgets/and updated to reference models, themes, and components undercoreandcomponents.
- Files under
-
lib/features/shop/shop_controller.dart:
- Updated imports to utilize
coreanddata_managersfor app settings, current user, and repositories.
- Updated imports to utilize
-
lib/features/shop/shop_screen.dart:
- Updated import paths for core singletons, theme components, and renamed collection views, aligning with the new modular organization.
-
lib/get_it.dart:
- Reorganized dependency injections to align with the new
data_managersandrepositorypaths. - Changed
AddressManagertoAddressesManagerin singleton registration.
- Reorganized dependency injections to align with the new
-
lib/main.dart:
- Updated import paths for managers and providers, moving shared preferences and services under
app_dataandparse_serverrespectively.
- Updated import paths for managers and providers, moving shared preferences and services under
-
lib/my_material_app.dart:
- Updated route names and imports to match the new structure, including paths for screens such as
MyAccountScreen,ShopScreen, andBoardgamesScreen. - Replaced
NewAddressScreenwithEditAddressScreenandAddressScreenwithAddressesScreenfor consistency.
- Updated route names and imports to match the new structure, including paths for screens such as
-
lib/repository/parse_server (multiple files):
- Moved interfaces and repository files to
lib/repository/data/parse_server. - Updated all imports for models and abstracts to align with
core, and restructured files to reflect the modular setup.
- Moved interfaces and repository files to
-
lib/repository/gov_api/ibge_repository.dart:
- Moved to
lib/repository/gov_apis/ibge_repository.dartand updated imports for models to referencecore.
- Moved to
-
lib/repository/gov_api/viacep_repository.dart:
- Moved to
lib/repository/gov_apis/viacep_repository.dartand adjusted imports.
- Moved to
-
lib/repository/sqlite/ (multiple files):
- Moved SQLite repositories to
lib/repository/local_data/sqlite, consolidating all local data repositories underlocal_data. - Updated imports to align with
coreand the new paths for interfaces.
- Moved SQLite repositories to
-
lib/services/parse_server_server.dart:
- Moved to
lib/services/parse_server/parse_server_server.dart.
- Moved to
-
lib/services/payment/payment_service.dart:
- Updated imports to align with the
corestructure.
- Updated imports to align with the
-
lib/store/database/ (multiple files):
- Refactored folders within
databaseto includebackup,migration, andproviderssubfolders. - Updated imports across files to ensure consistency with the
coreanddata_managersstructure.
- Refactored folders within
-
test/common/abstracts/data_result_test.dart:
- Updated import path for
DataResulttocore.
- Updated import path for
-
test/common/utils/utils_test.dart:
- Adjusted import for
Utilsto reflect the new path incore.
- Adjusted import for
-
test/repository/ibge_repository_test.dart:
- Modified import path for
ibge_repository.dartto match the new organization undergov_apis.
- Modified import path for
This reorganization enhances the modularity and clarity of the project's folder structure, separating core logic from feature-specific code and improving maintainability. The new structure facilitates future expansion and simplifies the navigation and management of dependencies within the project.
This commit focuses on cleaning up and refining the existing codebase of the bgbazzar application. It includes deletions of unused components, renaming classes for better clarity, and making structural changes to enhance code readability and maintainability.
-
Deleted Files:
- lib/common/app_constants.dart: Removed unused constants, such as
AppPageandappTitle. - lib/components/form_fields/custom_long_form_field.dart: Deleted the custom form field widget as part of refactoring the form elements.
- lib/components/others_widgets/custom_input_formatter.dart: Removed
CustomInputFormatteras it was no longer needed in the application.
- lib/common/app_constants.dart: Removed unused constants, such as
-
lib/common/app_info.dart:
- Updated
namefrom'xlo_mobx'to'BGBazzar'. - Reformatted
privacyPolicyUrlfor better readability.
- Updated
-
lib/components/form_fields/custom_mask_field.dart:
- Updated import statements to reflect path changes for consistency.
-
lib/components/others_widgets/fav_button.dart:
- Renamed to
favorite_button.dart: The classFavStackButtonwas also renamed toFavoriteStackButtonto improve readability.
- Renamed to
-
lib/components/others_widgets/fitted_button_segment.dart:
- Added detailed documentation to describe the usage and parameters of
FittedButtonSegment. This aims to improve the understanding of the component for future developers.
- Added detailed documentation to describe the usage and parameters of
-
lib/components/others_widgets/image_view.dart:
- Added detailed documentation to the
ImageViewwidget, describing the logic for image loading and the available parameters, improving code clarity.
- Added detailed documentation to the
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart:
- Updated import statement for
favorite_button.dart. - Replaced instances of
FavStackButtonwithFavoriteStackButton.
- Updated import statement for
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart:
- Replaced
CustomLongFormFieldwithCustomFormField, and added aFIXMEcomment noting the replacement for future refactoring.
- Replaced
-
lib/features/product/product_screen.dart:
- Updated the import and usage of
FavStackButtontoFavoriteStackButton.
- Updated the import and usage of
-
lib/features/shop/shop_controller.dart:
- Replaced usage of
appTitlefromapp_constants.dartwithAppInfo.namefromapp_info.dartto streamline constant references.
- Replaced usage of
-
lib/features/shop/shop_store.dart:
- Updated the initialization of
pageTitleto useAppInfo.nameinstead ofappTitle.
- Updated the initialization of
This commit removes redundant components, enhances the code's readability by renaming classes, and updates documentation to improve maintainability. The cleanup also ensures that constants and reusable widgets are organized efficiently, contributing to a more consistent and maintainable codebase.
This commit introduces several structural changes to improve modularity, reduce redundancy, and enhance clarity within the bgbazzar codebase. It includes refactoring, renaming, and deletion of obsolete components, along with the migration of repository interfaces to more organized locations.
-
lib/common/basic_controller/basic_controller.dart:
- Deleted the
BasicControllerclass as part of streamlining the codebase. This class was no longer necessary after refactoring the controllers.
- Deleted the
-
lib/common/singletons/app_settings.dart:
- Removed direct usage of
SharedPreferencesand replaced it with a dependency-injectedIAppPreferencesRepository. - Updated the
_readAppSettingsand_saveBrightmethods to use the new repository for managing preferences.
- Removed direct usage of
-
lib/common/singletons/current_user.dart:
- Updated import paths to reflect the new location of
i_user_repositorywithin theparse_serverdirectory.
- Updated import paths to reflect the new location of
-
lib/common/singletons/search_history.dart:
- Removed the
SharedPreferencesdependency and integratedIAppPreferencesRepository. - Changed
initandgetHistoryto useprefsfromIAppPreferencesRepository.
- Removed the
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart:
- Removed dependency on
BasicControllerand replaced it with direct interactions withads,getMoreAds, andupdateAdStatus.
- Removed dependency on
-
lib/features/address/address_controller.dart:
- Updated import paths to use the
parse_serverdirectory fori_ad_repository.
- Updated import paths to use the
-
lib/features/address/address_screen.dart:
- Updated repository import paths for consistency with new directory structure.
-
lib/features/favorites/favorite_store.dart:
- Renamed and restructured
shared_preferenses.darttofavorite_store.dartand commented out legacy code to prepare for further modularization.
- Renamed and restructured
-
lib/features/favorites/favorites_controller.dart:
- Commented out the old implementation of
FavoritesController, preparing for a new modular approach.
- Commented out the old implementation of
-
lib/features/my_ads/my_ads_controller.dart:
- Removed
BasicControllerinheritance and integrated a new store-based approach for state management. - Created a dedicated
MyAdsStorefor managing state, enhancing separation of concerns. - Refactored various methods to use
storefor handling states such as loading, success, and error.
- Removed
-
lib/features/my_ads/my_ads_screen.dart:
- Integrated
MyAdsStorewith the UI usingListenableBuilderto listen to state changes. - Adjusted initialization to work with the newly refactored controller and store.
- Integrated
-
lib/features/my_ads/widgets/my_tab_bar_view.dart:
- Updated
AdListViewinstantiation to use the new propertiesadsandgetMoreAdsfrom the controller.
- Updated
-
lib/get_it.dart:
- Added registration for
IAppPreferencesRepositorytoGetIt. - Updated various repository paths to align with the new organized structure under
parse_serverandsqlite.
- Added registration for
-
lib/main.dart:
- Added initialization of
IAppPreferencesRepository. - Changed the order of initialization calls to ensure dependencies are set up correctly.
- Added initialization of
-
lib/manager/address_manager.dart:
- Updated import paths to reflect changes in repository organization.
-
lib/manager/boardgames_manager.dart:
- Renamed
initmethod toinitializefor clarity. - Updated repository import paths.
- Renamed
-
lib/manager/favorites_manager.dart:
- Updated import paths to use repositories from the
parse_serverdirectory.
- Updated import paths to use repositories from the
-
lib/manager/mechanics_manager.dart:
- Renamed
inittoinitializefor consistency. - Updated import paths for repository interfaces.
- Renamed
-
lib/repository/share_preferences/app_share_preferences_repository.dart:
- Created a new
AppSharePreferencesRepositoryclass to manage shared preferences using dependency injection. This new approach improves testing capabilities and reduces direct dependency onSharedPreferences.
- Created a new
-
lib/repository/share_preferences/i_app_preferences_repository.dart:
- Defined the
IAppPreferencesRepositoryinterface to abstract preference management operations, making it easier to replace or mock during testing.
- Defined the
-
Renamed repository interfaces:
- Moved repository interfaces from
lib/repository/interfacestolib/repository/parse_server/interfaces, and updated all references to match this change. This reorganization helps in categorizing the different data sources and their responsibilities.
- Moved repository interfaces from
This commit simplifies the code structure by refactoring legacy components, organizing repositories, and separating concerns for better maintainability. The use of dependency injection for shared preferences ensures that future changes in preference management can be handled without impacting multiple parts of the codebase. The improved modularity also facilitates better testing and reduces redundancy.
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
MechanicsStatewithMechanicsStorefor managing mechanics. - Removed
ChangeNotifierand other state-related code, makingMechanicsControllerlighter and more focused on business logic.
- Replaced
-
lib/features/mechanics/mechanics_screen.dart:
- Updated to use
MechanicsStorefor state management instead of the previousMechanicsStateapproach. - Added
_removeMechanicmethod to remove mechanics, which also logs the operation for debugging purposes.
- Updated to use
-
lib/features/mechanics/mechanics_state.dart (deleted):
- Removed
MechanicsStateand 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
MechanicsStoreto 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
SearchMechsDelegateto useMechanicsManagerdirectly for fetching mechanics names, removing the need to passmechsNamesas a parameter.
- Updated
-
lib/features/mechanics/widgets/show_all_mechs.dart:
- Converted
ShowAllMechsinto a stateful widget to work withMechanicsStore. - Integrated the
MechanicsStorefor managing selections and toggling descriptions.
- Converted
-
lib/features/mechanics/widgets/show_only_selected_mechs.dart:
- Updated to use
MechanicsStorefor 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 toIMechanicRepositoryfor deleting mechanics.
- Added a new
-
lib/repository/parse_server/ps_ad_repository.dart:
- Renamed the
deletemethod parameter fromadtoidfor better clarity. - Modified the
_prepareAdForSaveOrUpdatemethod to use a simpler conditional structure when setting theobjectId.
- Renamed the
-
lib/repository/parse_server/ps_boardgame_repository.dart:
- Simplified the
_prepareBgForSaveOrUpdatemethod by optimizing the wayParseObjectis initialized. - Updated object field setting to use
setNonNullto 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
_prepareMechForSaveOrUpdateto 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
copyWithmethod to create copies ofBGNameModelinstances with modified attributes.
- Added a
-
lib/components/form_fields/custom_long_form_field.dart:
- Added a
FocusNodeas an optional parameter toCustomLongFormFieldfor better focus control.
- Added a
-
lib/components/others_widgets/state_error_message.dart:
- Removed
marginfrom theContainerwidget and added it to theCardwidget 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
nextFocusNodeparameter toCustomLongFormFieldfor smooth focus transitions. - Assigned the newly added
FocusNodetoCustomLongFormField.
- 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
descriptionFocusin thedisposemethod.
- Added a
-
lib/manager/boardgames_manager.dart:
- Updated
_getLocalBgNamesto usegetAllinstead ofgetfor fetching board game names. - Modified
_sortingBGNamesto use a more optimized approach for sorting_localBGsList.
- Updated
-
lib/repository/parse_server/common/ps_functions.dart (new file):
- Introduced
PsFunctionsclass 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
parseAddressobject setting by replacing standardsetcalls withsetNonNullto ensure non-nullable fields are consistently handled.
- Updated
-
lib/repository/parse_server/ps_boardgame_repository.dart:
- Refactored methods to use
PsFunctionsfor 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
parseFavobject setting by replacing standardsetcalls withsetNonNullfor consistent handling of non-nullable fields.
- Updated
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Used
PsFunctionsfor 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
setNonNullfor improved consistency.
- Refactored the error handling to use
-
lib/repository/sqlite/bg_names_repository.dart:
- Renamed method
gettogetAllto better reflect its functionality and improve readability.
- Renamed method
-
lib/repository/sqlite/local_interfaces/i_bg_names_repository.dart:
- Updated interface method name from
gettogetAllto align with the implementation.
- Updated interface method name from
-
lib/store/stores/bg_names_store.dart:
- Renamed method
gettogetAllfor 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.dbdatabase file.
- Removed the deprecated
-
lib/common/models/ad.dart:
- Modified
mechanicsStringto usemec.idinstead ofmec.psIdfor consistency with other models.
- Modified
-
lib/common/models/bg_name.dart:
- Removed the
bgIdfield and replacedidtype frominttoStringto align with other models.
- Removed the
-
lib/common/models/mechanic.dart:
- Removed the
psIdfield and replacedidtype frominttoStringto standardize data representation.
- Removed the
-
lib/features/boardgame/boardgame_controller.dart:
- Updated
isSelectedandselectBGIdmethods to usebg.idinstead ofbg.bgId.
- Updated
-
lib/features/boardgame/widgets/search_card.dart:
- Modified the
onTapcallback to usebgBoard.idinstead ofbgBoard.bgId.
- Modified the
-
lib/features/check_mechanics/check_controller.dart:
- Replaced
mech.psIdwithmech.idin thegetmethod for mechanics.
- Replaced
-
lib/features/check_mechanics/check_page.dart:
- Updated the display of mechanic IDs to use
mech.idinstead ofmech.psId.
- Updated the display of mechanic IDs to use
-
lib/features/mechanics/mechanics_controller.dart:
- Updated
isSelectedIndexandtoogleSelectionIndexmethods to usemechanics[index].idinstead ofmechanics[index].psId.
- Updated
-
lib/get_it.dart:
- Added imports for
i_favorite_repository.dartandps_favorite_repository.dart. - Registered
ILocalMechanicRepositoryandIFavoriteRepositoryinGetItfor dependency injection.
- Added imports for
-
lib/manager/boardgames_manager.dart:
- Updated references to
bgIdto useidin methods like_initializeBGNamesand_updateLocalDatabaseIfNeeded. - Added a comment for better clarity in the
_sortingBGNamesmethod.
- Updated references to
-
lib/manager/favorites_manager.dart:
- Replaced direct use of
PSFavoriteRepositorywithfavoriteRepositoryto decouple the implementation.
- Replaced direct use of
-
lib/manager/mechanics_manager.dart:
- Removed usage of
psIdin favor ofidfor mechanics throughout the manager.
- Removed usage of
-
lib/repository/interfaces/i_favorite_repository.dart (New file):
- Created an interface
IFavoriteRepositoryto handle adding and deleting favorites.
- Created an interface
-
lib/repository/parse_server/common/parse_to_model.dart:
- Updated parsing logic for
BGNameModelandMechanicModelto useidinstead ofbgIdorpsId.
- Updated parsing logic for
-
lib/repository/parse_server/ps_favorite_repository.dart:
- Implemented
IFavoriteRepositoryto manage favorite-related operations.
- Implemented
-
lib/repository/parse_server/ps_mechanics_repository.dart:
- Modified
saveMechanicmethod to usemech.idinstead ofmech.psId.
- Modified
-
lib/repository/sqlite/bg_names_repository.dart:
- Removed setting
bg.idafter adding a new boardgame to the SQLite database.
- Removed setting
-
lib/repository/sqlite/mechanic_repository.dart:
- Removed setting
mech.idafter adding a new mechanic to the SQLite database.
- Removed setting
-
lib/store/constants/constants.dart:
- Removed constants
mechPSIdandbgBgIdas 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
createBgNamesTableto usebgIdas aTEXT PRIMARY KEYinstead of an auto-incrementing integer.
- Updated
-
lib/store/stores/mechanics_store.dart:
- Removed the
mechPSIdcolumn from the query in thegetmethod.
- Removed the
-
pubspec.yaml:
- Updated version from
0.7.10+65to0.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.dartandps_address_repository.dart. - Registered
IAddressRepositorywithPSAddressRepositoryinGetItfor Parse Server dependencies. - Introduced
SQFLite Repositorieswith theSqliteBGNamesRepositoryregistration.
- Added imports for
-
lib/manager/address_manager.dart:
- Replaced direct use of
PSAddressRepositorywithIAddressRepositoryto 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
localMechRepositoryfor handling operations via the local SQLite database. - Replaced direct references to
SqliteMechanicRepositorywithlocalMechRepositoryto use dependency injection for better scalability.
- Added import for
-
lib/repository/interfaces/i_address_repository.dart (New file):
- Created an interface
IAddressRepositorydefining the contract for saving, deleting, and fetching user addresses. - Introduced
AddressRepositoryExceptionto handle errors related to the address repository.
- Created an interface
-
lib/repository/parse_server/ps_address_repository.dart:
- Implemented
IAddressRepositoryto provide the address-related functionality specific to Parse Server. - Changed methods (
save,delete,getUserAddresses) fromstaticto instance methods, aligning them with the interface implementation.
- Implemented
-
lib/repository/sqlite/local_interfaces/i_local_mechanic_repository.dart (New file):
- Created an interface
ILocalMechanicRepositoryfor 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
SqliteMechanicRepositoryto 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.localBGListinstead 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.idisnullto 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
ImageViewwidget in aClipRRectwith 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.dartand registeredIBgNamesRepositoryto 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
_handleErrormethod for centralized error logging and handling.
- Introduced
-
lib/repository/sqlite/bg_names_repository.dart:
- Implemented the
IBgNamesRepositoryinterface, includingget,add, andupdatemethods 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.profor 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.DefaultLifecycleObserverclass.
- Created a new ProGuard configuration file with a rule to keep the
-
lib/common/models/boardgame.dart:
- Removed the
viewsproperty fromBoardgameModel. - Added a factory constructor
BoardgameModel.clean()to return a default, clean instance of the model. - Introduced
copyWithmethod to enable easy cloning and modification ofBoardgameModelinstances.
- Removed the
-
lib/components/form_fields/custom_long_form_field.dart:
- Added
onChangedcallback toCustomLongFormFieldfor flexibility in form interactions. - Updated the
onChangedfunction to use the providedonChangedcallback directly.
- Added
-
lib/components/form_fields/custom_names_form_field.dart:
- Added
onChangedand updated theonSubmittedcallback to pass the current value. - Updated
onChangedto use the provided callback directly.
- Added
-
lib/components/others_widgets/spin_box_field.dart:
- Added
onChangecallback to handle changes in the spin box values. - Updated
_incrementand_decrementmethods to call_updateOnChangewhenever values are adjusted.
- Added
-
lib/features/boardgame/boardgame_screen.dart:
- Replaced the
OverflowBarfor Floating Action Buttons with a newCustomFloatingActionBarwidget to improve code reuse and consistency.
- Replaced the
-
lib/features/boardgame/widgets/custom_floating_action_bar.dart (new file):
- Introduced a new widget
CustomFloatingActionBarto 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.oldto clean up the project.
- Removed old and unused file
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Refactored
EditBoardgameControllerto decouple the state management from the controller logic. - Integrated
EditBoardgameStoreto handle stateful logic, improving separation of concerns.
- Refactored
-
lib/features/edit_boardgame/edit_boardgame_form/edit_boardgame_form.dart (new file):
- Created a new
EditBoardgameFormwidget 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
EditBoardgameFormControllerto manage the logic forEditBoardgameForm, providing better modularity.
- Created a new controller
-
lib/features/edit_boardgame/edit_boardgame_screen.dart:
- Updated to use
EditBoardgameFormandCustomFilledButton, 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
EditBoardgameStoreto 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
GetImageto 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
FilePickerpackage.
- Added a new widget
-
lib/features/edit_boardgame/widgets/custom_filled_button.dart (new file):
- Introduced
CustomFilledButtonwidget 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
OverflowBarwith individualPaddingwidgets for better spacing control.
- Updated the Floating Action Buttons to provide a consistent layout, replacing the
-
lib/get_it.dart:
- Registered
IBoardgameRepositorywithPSBoardgameRepositoryfor dependency injection, enhancing the consistency of repository management.
- Registered
-
lib/manager/boardgames_manager.dart:
- Updated to use
IBoardgameRepositoryinstead 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
IBoardgameRepositoryto 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
keyBgViewsas 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 forviewssince 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
IBoardgameRepositoryinterface and refactored methods for better consistency and error handling. - Added private helper methods to modularize repetitive tasks such as creating ACLs and preparing
ParseObjectinstances.
- 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_pickerdependency (version8.1.3) to support local file selection.
- Added
-
pubspec.lock:
- Updated to include the
file_pickerpackage (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
setPageTitlecallback parameter to improve flexibility when updating the page title after drawer interaction. - Modified
_navAccountScreenmethod to use the newsetPageTitlecallback.
- Added a
-
lib/components/form_fields/custom_form_field.dart:
- Enhanced the
onFieldSubmittedmethod 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
onFieldSubmittedto advance focus to the next form field and callonFieldSubmittedif it is not null, similar tocustom_form_field.dart.
- Updated
-
lib/features/shop/shop_screen.dart:
- Renamed
navToLoginScreento_navToLoginScreento reflect private method naming conventions. - Updated drawer instantiation to pass the
setPageTitlefunction instead of directly using the controller method. - Refactored floating action button behavior to use
_navToLoginScreenmethod.
- Renamed
-
lib/features/signin/signin_screen.dart:
- Refactored UI to include a new
BigButtonfor 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
SignInFormfrom aStatelessWidgetto aStatefulWidgetto manageFocusNodefor better form control. - Added
nextFocusNodeparameter 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
signupUsermethod to_signupUserto 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
SignUpFormfrom aStatelessWidgetto aStatefulWidgetto manageFocusNode. - Added focus control between password and confirm password fields, allowing for smoother form navigation.
- Moved the "Sign Up" button to the main
SignUpScreenfor 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
ParseObjectExtensionsextension to allow setting non-null fields onParseObjectusing thesetNonNullmethod.
- Added
-
lib/repository/parse_server/ps_ad_repository.dart:
- Updated
moveAdsAddressTomethod to perform multiple ad updates in parallel usingFuture.wait, improving efficiency. - Refactored
adsInAddress,updateStatus,getMyAds,get,save, andupdatemethods to use a more consistent error handling approach with_handleError. - Introduced new helper methods
_parseCurrentUser,_parseAddress,_parseBoardgame,_createDefaultAcl,_prepareAdForSaveOrUpdate, and_handleErrorto modularize repetitive logic, improve code readability, and facilitate reuse. - Modified
_saveImagesto return directly as a list ofParseFileobjects instead of wrapping the result in aDataResult, and refactored it for clarity and simplicity. - Added
_prepareAdForSaveOrUpdateto centralize ad creation or update logic, usingsetNonNullfor all fields to prevent unnecessary null checks. - Created new methods to generate
ParseObjectrepresentations of address and board game (_parseAddress,_parseBoardgame) to improve maintainability.
- Updated
-
lib/repository/parse_server/ps_user_repository.dart:
- Renamed parameter
messagetomodulein_handleErrormethod 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 theBoardgameModelto enhance modularity. - Replaced
mechanicsPSIdswithmechanicsIdsto unify the naming convention. - Adjusted constructors, copy methods, and properties to reflect these changes.
- Updated the
toStringmethod 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
bgIdattribute toidto maintain consistency throughout the codebase. - Updated all references to
bgIdin related classes and methods toidto ensure consistency.
- Renamed the
-
lib/features/address/address_controller.dart and lib/features/address/address_screen.dart:
- Replaced
PSAdRepositorywithIAdRepositoryvia dependency injection (getIt<IAdRepository>()), enhancing flexibility and testing capabilities. - Updated method calls to use the injected
adRepositoryinstance instead of directly referencingPSAdRepository.
- Replaced
-
lib/features/edit_ad/:
- Removed
edit_ad_controller.dartandedit_ad_form/edit_ad_form_store.dart, consolidating their responsibilities intoedit_ad_store.dartandedit_ad_form.dartto simplify the flow. - Updated
edit_ad_form_controller.dartandedit_ad_store.dartto integrate new methods for handling theBoardgameModeland ensure smoother state transitions. - Added detailed error handling and validation in
EditAdStorefor fields likeimages,price, andaddressto 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
EditAdStoreto utilize the newBoardgameModelreference, centralizing board game details.
- Removed
-
lib/features/edit_ad/image_list/:
- Refactored
image_list_controller.dartand deletedimage_list_store.dart, simplifying image management for advertisements. - Introduced new logic in
ImagesListViewto handle dynamic image updates and user feedback, such as minimum image requirements. - Updated
HorizontalImageGalleryto remove redundant parameters and make use of the newEditAdStorefor image handling, streamlining the workflow.
- Refactored
-
lib/features/edit_boardgame/edit_boardgame_controller.dart:
- Updated the attribute
bgIdtoidfor 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
PSAdRepositorytoIAdRepositoryto maintain the new abstraction layer. - Leveraged
getIt<IAdRepository>()for better dependency handling, ensuring all references are updated consistently. - Modified methods like
_getAds,_getMoreAds, and_updateAdStatusto use the injected repository interface, enhancing code flexibility.
- Updated all references from
-
lib/repository/interfaces/i_ad_repository.dart:
- Created the
IAdRepositoryinterface 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
IAdRepositoryinterface methods inPSAdRepositoryto conform to the newly introduced abstraction. - Added the relationship between
AdModelandBoardgameModelto maintain integrity when saving and updating advertisements. - Updated methods like
saveandupdateto utilizeParseObjectrelationships 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
AdModeland addedkeyAdBoargGameto 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
ParseToModelutility to handle the nestedBoardgameModelwithinAdModel, 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
mechanicsIdtomechanicsPSIdsfor clarity. - Added a
get mechanicsStringmethod for fetching mechanics as a formatted string usingMechanicsManager. - Added a
copyWithmethod to simplify the creation of modified copies ofAdModel.
- Renamed
-
lib/common/others/validators.dart:
- Updated the
namevalidation to check if the value length is at least 3 characters.
- Updated the
-
lib/components/form_fields/custom_form_field.dart:
- Added
initialValueparameter 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_roundedfor a more modern UI.
- Updated the icon to
-
lib/features/edit_boardgame/edit_boardgame_screen.dart:
- Updated floating action buttons (
FAB) to useOverflowBarinstead 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
ImageListControllerand store state toImageListStore. - Introduced
EditAdFormControllerandEditAdFormStorefor managing form data and state within theEditAdfeature.
- Created separate controllers (
-
lib/repository/parse_server/common/parse_to_model.dart:
- Updated references from
mechanicsIdtomechanicsPSIdsfor consistency.
- Updated references from
-
lib/repository/parse_server/ps_ad_repository.dart:
- Modified the
saveandupdatemethods to usemechanicsPSIdsinstead 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.darttowidgets/edit_ad_form.dart. - Removed
dispose()call onctrlsince 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.dartand updated the class toEditAdFormfor 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_roundedfor 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
IUserRepositoryfrom'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
BasicControllerwithShopControllerfor better specificity in managing shop-related state and logic.
- Replaced the use of
-
lib/features/favorites/favorites_screen.dart:
- Updated the import paths for
ShopControllerandShopStore. - Replaced
FavoritesControllerwithShopControllerand addedShopStoreto manage state. - Updated
AnimatedBuilderto usestore.stateinstead 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
PaymentWebViewPageclass toPaymentPageand added a static route name for easier navigation.
- Renamed the file to
-
lib/features/shop/shop_controller.dart:
- Removed inheritance from
BasicController. - Replaced
BasicStatemanagement withShopStoreto 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
ShopStoreto manage the state ofShopController. - Replaced
AnimatedBuilderwithListenableBuilderto use the store state directly. - Updated methods to use
storefor state management and clean disposal.
- Added
-
lib/features/shop/shop_store.dart:
- Created a new
ShopStoreclass 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
IUserRepositoryfor consistency.
- Updated the import paths for
-
lib/get_it.dart:
- Removed
ShopControllerfrom dependency registration to align with its updated instantiation in individual screens. - Updated repository interface import paths to maintain consistency.
- Updated repository class names (
PSUserRepositoryandPSMechanicsRepository) 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
PaymentPageto facilitate navigation by passing apreferenceId.
- Added routing for
-
lib/repository/interfaces/imechanic_repository.dart & iuser_repository.dart:
- Renamed files to
i_mechanic_repository.dartandi_user_repository.dartfor improved consistency in naming conventions.
- Renamed files to
-
lib/repository/parse_server/ps_mechanics_repository.dart & ps_user_repository.dart:
- Renamed classes to
PSMechanicsRepositoryandPSUserRepositoryto 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
TimeoutFailureclass to represent a failure due to timeout when making API calls.
- Added a new
-
lib/common/models/payment.dart:
- Introduced a new
PaymentModelclass containing fields foramount,description, andquantityto 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 ofstorewhen 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
PaymentControllerclass 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
PaymentStoreclass that extendsStateStoreto manage state during payment processing in thePaymentWebView.
- Added a new
-
lib/features/payment_web_view/payment_web_view_page.dart:
- Created a new
PaymentWebViewPagewidget to handle displaying the payment process using WebView. - Utilized
ValueListenableBuilderto manage loading, success, and error states during payment.
- Created a new
-
lib/services/payment/payment_service.dart:
- Added a new
PaymentServiceclass 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_flutterpackage version^4.10.0to 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
createAttocreatedAtfor consistency. - Refactored the
UserModelclass, replacing thecopyFromUserModelmethod withcopyWithto 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
StateCountLoadingMessagefor 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
selectAddressmethod to toggle selection when the address is already selected. - Fixed a typo in method name: corrected
seSelectedAddressNametosetSelectedAddressName.
- Updated the
-
lib/features/address/address_screen.dart:
- Replaced some material icons with
MaterialSymbolsfor consistency. - Refactored
AnimatedBuildertoListenableBuilderto 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
seSelectedAddressNametosetSelectedAddressName.
- 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, andCheckStoreto 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
AdminHooksto 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
routeNamefrom/loginto/signinto better reflect the purpose of the page.
- Changed
-
lib/get_it.dart:
- Registered the
IMechanicRepositorydependency, mapping it toParseServerMechanicsRepository. - Enhanced dependency injection setup to align with new architecture changes.
- Registered the
-
lib/manager/boardgames_manager.dart:
- Replaced calls to
BGNamesRepositorywithSqliteBGNamesRepositoryto enhance repository naming clarity.
- Replaced calls to
-
lib/manager/mechanics_manager.dart:
- Added support for
IMechanicRepositoryusing 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
IMechanicRepositorydefining 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
BGNamesRepositorytoSqliteBGNamesRepositoryfor clarity.
- Renamed class from
-
lib/repository/sqlite/mechanic_repository.dart:
- Renamed class from
MechanicRepositorytoSqliteMechanicRepositoryto 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_iconsfor 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
iconparameter to theStateErrorMessagewidget 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
RecoverStatusto represent different outcomes of password recovery operations. - Added a
recoverPasswordmethod to handle password reset requests using theuserRepository.
- Introduced an enum
-
lib/features/signin/signin_screen.dart:
- Updated the
_navLostPasswordmethod to use the newrecoverPasswordfunctionality. - Added a dialog to provide feedback to the user when a password recovery email is sent.
- Updated the
-
lib/main.dart:
- Changed the
isLocalServerconstant fromtruetofalseto switch the server configuration for production use.
- Changed the
-
lib/repository/interfaces/iuser_repository.dart:
- Added a new method
resetPassword(String email)to theIUserRepositoryinterface for initiating password reset requests.
- Added a new method
-
lib/repository/parse_server/ps_user_repository.dart:
- Implemented the
resetPasswordmethod inParseServerUserRepositoryto 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
Failureabstract class to include a newcodefield to represent error codes. - Modified
GenericFailureandAPIFailureclasses to use named parameters formessageandcode.
- Updated the
-
lib/common/parse_server/errors_mensages.dart:
- Refactored the
ParserServerErrorsclass to use an integer error code instead of parsing a string. - Removed the
_getErroCodefunction, simplifying error message handling.
- Refactored the
-
lib/common/singletons/current_user.dart:
- Added dependency injection for
IUserRepositoryto manage user-related actions. - Updated
initandlogoutmethods to useuserRepositoryinstead ofPSUserRepository.
- Added dependency injection for
-
lib/common/others/enums.dart renamed to lib/common/state_store/state_store.dart:
- Added a new
StateStoreclass to encapsulate the logic for managing state changes withValueNotifier.
- Added a new
-
lib/features/address/address_controller.dart:
- Updated methods to use the
StateStoreclass instead of settingPageStatedirectly.
- Updated methods to use the
-
lib/features/address/address_store.dart:
- Refactored
AddressStoreto extendStateStore, inheriting its state management logic.
- Refactored
-
lib/features/boardgame/boardgame_store.dart:
- Refactored
BoardgameStoreto extendStateStore, simplifying state management.
- Refactored
-
lib/features/edit_ad/edit_ad_controller.dart:
- Replaced individual controllers (e.g.,
nameController,descriptionController) with fields in thestoreobject for better encapsulation.
- Replaced individual controllers (e.g.,
-
lib/features/edit_ad/edit_ad_screen.dart:
- Refactored validation checks to use
store.isValidinstead of form validation logic. - Replaced
ListenableBuilderwithValueListenableBuilderforimagesLengthand validation state.
- Refactored validation checks to use
-
lib/features/edit_ad/edit_ad_store.dart:
- Refactored
EditAdStoreto 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
IUserRepositoryfor signing up users, replacing the direct dependency onPSUserRepository.
- Integrated
-
lib/get_it.dart:
- Registered
IUserRepositoryas 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
IUserRepositoryinParseServerUserRepository. - Added detailed error handling with the new
ParserServerErrorsclass. - Added
_handleErrorfunction 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.darttosignin_controller.dart,login_screen.darttosignin_screen.dart). - Updated class names and imports across the application to reflect the new naming scheme (e.g.,
LoginControllertoSignInController,LoginScreentoSignInScreen).
- Renamed the login feature directory and relevant files (e.g.,
-
Deleted Legacy State Management Classes
- Removed
login_state.dartthat 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.dartfile for state management. - Implemented
SignInStoreusingValueNotifierto manage state (PageState) and validation errors (e.g.,errorEmail,errorPassword). - Integrated
SignInStorewithinSignInControllerfor streamlined state management.
- Created a new
-
Simplified Form Widgets
- Removed
LoginFormwidget and createdSignInFormwhich now usesSignInStorefor validation and state handling. SignInFormis now directly responsible for managing the user input fields (emailandpassword) throughValueListenableBuilderfor reactive UI updates.
- Removed
-
Route Updates
- Replaced all references to
LoginScreen.routeNamewithSignInScreen.routeNamethroughout the application. - Updated the navigation logic in
shop_screen.dartandmy_material_app.dartaccordingly.
- 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.dartto better organize utility files. - Made
Validatorconstructor private to prevent instantiation.
- Renamed to
-
lib/components/form_fields/custom_form_field.dart:
- Added
onChangedandonFieldSubmittedcallbacks 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
CustomMaskFieldwidget 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
AnimatedBuilderwithValueListenableBuilderfor better performance and readability.
- Updated to use optional controllers and new callbacks (
-
lib/features/boardgame/boardgame_controller.dart:
- Replaced
BoardgameStatewithBoardgameStorefor state management. - Removed the
ChangeNotifierinheritance to delegate state handling toBoardgameStore.
- Replaced
-
lib/features/boardgame/boardgame_screen.dart:
- Updated to use
BoardgameStorefor 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
BoardgameStoreto replace the previous state-based approach, leveragingValueNotifierfor state handling.
- Introduced
-
lib/features/edit_ad/edit_ad_controller.dart:
- Transitioned to use
EditAdStorefor state management, removing the need forChangeNotifier. - Removed redundant
ValueNotifierproperties 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
EditAdStorefor better separation of concerns and modular state management.
- Added
-
lib/features/signup/signup_controller.dart:
- Updated to use
SignupStoreinstead ofSignUpStatefor handling UI and data states.
- Updated to use
-
lib/features/signup/signup_state.dart (deleted file):
- Removed
SignUpStatein favor ofSignupStore.
- Removed
-
lib/features/signup/signup_store.dart (new file):
- Introduced
SignupStorefor more effective state handling in the signup flow, with specific error fields for better user feedback.
- Introduced
-
lib/get_it.dart:
- Added
ParseServerServiceto the service locator for better control over Parse Server initialization.
- Added
-
lib/main.dart:
- Replaced direct Parse Server initialization with a call to
ParseServerServicefor 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.dartto 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, andtargetSdkto 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
AddressStateclasses into a unifiedPageStateenum to simplify state management.
- Refactored
-
lib/common/settings/back4app_server.dart:
- Deleted
back4app_server.dartas the Back4App configuration has been refactored for better modularity.
- Deleted
-
lib/common/settings/local_server.dart → lib/common/settings/parse_server_location.dart:
- Renamed
LocalServertoParseServerLocationto improve clarity on the server role.
- Renamed
-
lib/features/address/address_controller.dart:
- Replaced the
AddressStateusage with the newPageStateenum. - Removed
ChangeNotifierinheritance and usedAddressStorefor managing state.
- Replaced the
-
lib/features/address/address_screen.dart:
- Modified to use
AddressStorefor state management instead of relying onChangeNotifierdirectly.
- Modified to use
-
lib/features/address/address_store.dart:
- Added new
AddressStoreclass 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
LocalServerreferences withParseServerLocationto reflect the updated server settings class.
- lib/manager/boardgames_manager.dart:
- Updated the server configuration references from
LocalServertoParseServerLocationto maintain consistency across the codebase.
- pubspec.lock:
- Updated the
vm_servicepackage 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.dbto the latest version.
- Updated the binary file
-
lib/common/singletons/app_settings.dart
- Updated
_localDBVersionfrom1000to1001to match the new database version.
- Updated
-
lib/components/others_widgets/bottom_message.dart
- Created a new widget
BottomMessageto 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
moveAdsAddressTomethod 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
_removeAddressmethod by replacing a placeholder exception with a more descriptive error message. - Updated UI elements such as
FloatingActionButtonto improve user experience and make the interface more intuitive.
- Improved error handling in
-
lib/features/boardgame/boardgame_screen.dart
- Added additional
FloatingActionButtonoptions for better navigation and action handling within the board game screen.
- Added additional
-
lib/features/boardgame/widgets/bg_info_card.dart
- Updated the
BGInfoCardwidget to display additional game mechanics using data fromMechanicsManager.
- Updated the
-
lib/features/edit_ad/edit_ad_controller.dart
- Enhanced error handling for
updateandsavemethods by implementingDataResultto 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
IconButtonto 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
BottomMessagewidget to display error messages when necessary.
-
lib/features/mechanics/mechanics_screen.dart
- Simplified UI by replacing the
PopupMenuButtonwith individualIconButtons 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
_getAdsand_getMoreAdsmethods 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
adfor easier access and code readability. - Integrated a new
GameDatawidget 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
GameDatato 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
_getAdsand_getMoreAdsmethods by implementingDataResultand 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
getByIdto 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
addmethod to returnnullinstead 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
localDBVersionset to1001to reflect the updated database schema. - Added a
FIXMEcomment to check database version consistency.
- Added a new constant
-
pubspec.yaml
- Updated the project version from
0.6.18+47to0.6.19+48to 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
Failureclass to include an optionalmessageparameter. - Updated
GenericFailureandAPIFailureclasses to handle themessageparameter.
- 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
ImageViewto handle image display with support for assets, network images, and files.
- Added a new widget
-
lib/features/address/address_screen.dart
- Updated the
_removeAddressmethod to handle error scenarios more gracefully usingDataResult.
- Updated the
-
lib/features/boardgame/boardgame_controller.dart
- Refactored
getBoardgameSelectedmethod to return aDataResulttype for more structured error handling.
- Refactored
-
lib/features/boardgame/boardgame_screen.dart
- Updated methods
_editBoardgameand_viewBoardgameto handle failures properly using exceptions.
- Updated methods
-
lib/features/boardgame/widgets/bg_info_card.dart
- Replaced direct image loading with the new
ImageViewwidget for consistent error handling.
- Replaced direct image loading with the new
-
lib/features/edit_ad/edit_ad_controller.dart
- Refactored the
setBgInfomethod to handle potential failures with structured error messages.
- Refactored the
-
lib/features/edit_boardgame/edit_boardgame_controller.dart
- Updated
getBgInfoandsaveBoardgamemethods to returnDataResulttypes, ensuring better error management.
- Updated
-
lib/features/edit_boardgame/edit_boardgame_screen.dart
- Replaced manual image loading logic with the new
ImageViewwidget.
- Replaced manual image loading logic with the new
-
lib/features/my_ads/my_ads_controller.dart
- Improved error handling by using
DataResulttypes in methods like_getAds,_getMoreAds, andupdateStatus.
- Improved error handling by using
-
lib/features/shop/shop_controller.dart
- Enhanced error handling in methods
_getAdsand_getMoreAdsusing theDataResulttype.
- Enhanced error handling in methods
-
lib/manager/boardgames_manager.dart
- Refactored methods such as
getBGNames,save, andupdateto utilizeDataResultfor more robust error handling.
- Refactored methods such as
-
lib/repository/parse_server/ps_ad_repository.dart
- Updated various methods (
moveAdsAddressTo,adsInAddress,updateStatus, etc.) to returnDataResulttypes for improved error management.
- Updated various methods (
-
lib/repository/parse_server/ps_boardgame_repository.dart
- Refactored methods like
save,update,getById, andgetNamesto useDataResultfor 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
DataResulthandling 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
DataResulttypes 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
ImageViewwidget 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
DataResulttype 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.dartto reflect the changes made to theDataResultclass 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
ImageViewcomponent. - 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
TitleProductwidget in the ShoppingHooks with the theme's primary color for consistency. - Updated: The ListTile for 'Favoritos' now navigates to the
FavoritesScreenwhen 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
normalizeFileNamemethod to standardize filenames by removing accents, replacing spaces with underscores, and removing invalid characters. - Introduced
_removeDiacriticsmethod 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
NumericEditControllerwhen 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
selectMechByNamemethod for selecting a mechanic by its name. - Introduced
toogleDescriptionmethod 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
normalizeFileNameusage when saving board games to ensure filenames are correctly formatted. - Introduced
_sortingBGNamesmethod to keep the list of board games sorted alphabetically by name after any modification.
- Added
-
lib/manager/mechanics_manager.dart- Added
mechanicOfNamemethod 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
normalizeFileNameinto 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
mechanicsIdfromList<int>toList<String>to reflect changes in ID management.
- Updated
-
lib/common/models/boardgame.dart- Renamed the
idfield tobgId. - Updated
mechanicstomechsPsIds, changing the type fromList<int>toList<String>.
- Renamed the
-
lib/common/models/filter.dart- Changed
mechanicsIdtomechanicsPsIdand updated its type fromList<int>toList<String>.
- Changed
-
lib/common/settings/local_server.dart- Added
keyParseServerImageUrlto 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
numericValuesetter 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
intanddoubletypes 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 newStringID 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
inttoStringfor 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
BoardgameModelobjects where applicable.
- Modified the initialization to pass
-
lib/features/filters/filters_controller.dart- Changed
selectedMechIdsfromList<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
StringIDs.
- Refined the mechanics selection process to handle
-
lib/features/mechanics/mechanics_controller.dart- Adapted the controller to work with
StringIDs. - 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
StringIDs instead ofint.
- Updated arguments and state management to work with
-
lib/features/mechanics/widgets/show_all_mechs.dart- Refined to handle
StringIDs, ensuring compatibility with the rest of the application.
- Refined to handle
-
lib/features/my_account/widgets/admin_hooks.dart- Adjusted to pass
StringIDs 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 newStringID format. - Renamed
saveNewBoardgame()tosave()for consistency.
- Implemented
-
lib/manager/mechanics_manager.dart- Updated to handle
StringIDs 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
BoardgameModelobjects where required. - Updated mechanics selection to handle
StringIDs.
- Adjusted routes to pass
-
lib/repository/parse_server/common/constants.dart- Removed the now redundant
keyMechIdconstant.
- Removed the now redundant
-
lib/repository/parse_server/common/parse_to_model.dart- Updated parsing logic to handle
StringIDs for mechanics and board games.
- Updated parsing logic to handle
-
lib/repository/parse_server/ps_ad_repository.dart- Refined to work with
StringIDs 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 newStringIDs.
- Implemented an
-
lib/repository/parse_server/ps_mechanics_repository.dart- Changed method names and return types to work with
StringIDs. - Removed the setting of
mechIdin 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
mechPSIdcolumn.
- 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
UCropActivityfor 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
toStringmethod for better readability, adding line breaks between fields.
- Reformatted the
-
lib/common/models/mechanic.dart- Added a new
psIdfield to theMechanicModel. - Updated the
toMap,fromMap, andtoStringmethods 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
scaffoldBackgroundColorto usecolorScheme.surfaceinstead ofcolorScheme.background.
- Minor adjustment: changed
-
lib/components/buttons/big_button.dart- Added support for an optional icon in the
BigButtonwidget, allowing more customization.
- Added support for an optional icon in the
-
lib/components/others_widgets/state_error_message.dart- Enhanced the
StateErrorMessagewidget 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
setBgInfomethod 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 (
currentUsertouser). - 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
psIdfield to theMechanicstable.
- 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.dartandlib/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
minLinesproperty support for text fields to allow dynamic height adjustment based on content.
- Added
-
lib/features/boardgame/boardgame_controller.dart- Implemented
getBoardgameSelectedmethod 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
minLinesandmaxLinesproperties 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
ViewBoardgamescreen. - 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
toStringmethod to theBGNameModelclass for easier debugging. - Included a new directive to ignore
public_member_api_docsandsort_constructors_firstlint warnings.
- Added the
-
lib/common/models/boardgame.dart- Removed the
scoringfield from theBoardgameModelclass as it is no longer required. - Updated the
toStringmethod to reflect the removal of thescoringfield.
- Removed the
-
lib/features/boardgame/boardgame_controller.dart- Refactored the controller to manage the search and selection of board games.
- Removed the
bgNametext 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
keyBgScoringconstant as it is no longer used.
- Removed the
-
lib/repository/parse_server/common/parse_to_model.dart- Updated the
boardgameModelmethod to properly parse the list of mechanics from the Parse Server response.
- Updated the
-
lib/repository/parse_server/ps_boardgame_repository.dart- Removed the
scoringfield from the methods interacting with the Parse Server. - Improved the
getByIdmethod to handle cases where no results are found more gracefully. - Corrected error handling and logging in the
getNamesmethod.
- 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
BgControllertoBoardgameController. - Updated the state management references from
BgSearchStatetoBoardgameState.
- Renamed file and class from
-
lib/features/bg_search/bg_search_screen.dart->lib/features/boardgame/boardgame_screen.dart- Renamed file and class from
BgSearchScreentoBoardgameScreen. - 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.dartwidget to theboardgamedirectory.
- Moved the
-
lib/features/bg_search/widgets/search_card.dart->lib/features/boardgame/widgets/search_card.dart- Moved the
search_card.dartwidget to theboardgamedirectory.
- Moved the
-
lib/features/edit_ad/widgets/ad_form.dart- Updated imports to reflect the renaming from
BgSearchScreentoBoardgameScreen.
- 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
BoardgameControllertoEditBoardgameController. - Updated the state management references from
BoardgameStatetoEditBoardgameState.
- Renamed file and class from
-
lib/features/boardgames/boardgame_screen.dart->lib/features/edit_boardgame/edit_boardgame_screen.dart- Renamed file and class from
BoardgamesScreentoEditBoardgamesScreen. - 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
BgSearchStatetoEditBoardgameState. - 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
BgSearchScreentoBoardgameScreen.
- Updated import and navigation references from
-
lib/my_material_app.dart- Updated route mappings to reflect the renaming from
BgSearchScreentoBoardgameScreenand fromBoardgamesScreentoEditBoardgamesScreen.
- 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
BGNameModelto use non-final fields. - Added
toMapandfromMapmethods for easier conversion betweenBGNameModelandMap<String, dynamic>.
- Modified
-
lib/features/bg_search/bg_search_controller.dart- Renamed the
BgNamesManagertoBoardgamesManager. - Updated method names to reflect this change.
- Refactored method
searchBggtosearchBg.
- Renamed the
-
lib/features/bg_search/bg_search_screen.dart- Renamed
BggSearchScreentoBgSearchScreen. - Updated the route name and widget class names accordingly.
- Renamed
-
lib/features/boardgames/boardgame_controller.dart- Renamed
BgNamesManagertoBoardgamesManager. - 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.routeNametoBgSearchScreen.routeName.
- Updated the route name from
-
lib/features/my_account/widgets/admin_hooks.dart- Updated the
Boardgameslist tile to navigate to the updatedBgSearchScreen.
- Updated the
-
lib/get_it.dart- Replaced
BgNamesManagerwithBoardgamesManagerin the dependency injection setup.
- Replaced
-
lib/main.dart- Replaced
BgNamesManagerwithBoardgamesManagerduring initialization.
- Replaced
-
lib/manager/bg_names_manager.dart->lib/manager/boardgames_manager.dart- Renamed the file and class from
BgNamesManagertoBoardgamesManager. - 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
BggSearchScreentoBgSearchScreen.
- 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.darttomechanics_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
MechanicModelconstructor to make theidfield optional. - Simplified the
fromMapmethod to remove backward compatibility checks for older field names (nomeanddescricao).
- Refactored the
-
lib/features/mechanics/mechanics_controller.dart- Converted
MechanicsControllerinto aChangeNotifierto 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
MechanicDialogfor 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
_localAddand_psAddmethods 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
mechanicto parseParseObjectintoMechanicModel.
- 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
getListtogetfor consistency. - Improved error handling and logging within the
getmethod.
- 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
queryMechstogetfor better clarity. - Improved error logging in the database operations.
- Renamed
-
pubspec.yaml- Updated the project version to
0.6.15+38to 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.dbfile.
- Added an old backup of the
-
lib/common/singletons/current_user.dart- Replaced
UserRepositorywithPSUserRepositoryin methodsinitandlogout.
- Replaced
-
lib/features/address/address_controller.dart- Replaced
AdRepositorywithPSAdRepositoryin method to move advertisements.
- Replaced
-
lib/features/address/address_screen.dart- Replaced
AdRepositorywithPSAdRepository.
- Replaced
-
lib/features/bg_search/bg_search_controller.dart- Replaced
BoardgameRepositorywithPSBoardgameRepositoryin methodgetBoardInfo.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart- Replaced
BoardgameRepositorywithPSBoardgameRepositoryin methods fetching and saving board game data.
- Replaced
-
lib/features/edit_ad/edit_ad_controller.dart- Replaced
AdRepositorywithPSAdRepositoryin methods to save and update advertisements.
- Replaced
-
lib/features/login/login_controller.dart- Replaced
UserRepositorywithPSUserRepositoryin 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
MyAccountScreento 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
AdRepositorywithPSAdRepositoryin methods to fetch and update ads.
- Replaced
-
lib/features/my_data/my_data_controller.dart- Replaced
UserRepositorywithPSUserRepositoryin method to save user data.
- Replaced
-
lib/features/shop/shop_controller.dart- Replaced
AdRepositorywithPSAdRepositoryin methods to fetch ads.
- Replaced
-
lib/features/signup/signup_controller.dart- Replaced
UserRepositorywithPSUserRepositoryin signup method.
- Replaced
-
lib/manager/address_manager.dart- Replaced
AddressRepositorywithPSAddressRepositoryin methods for managing addresses.
- Replaced
-
lib/manager/bg_names_manager.dart- Replaced
BoardgameRepositorywithPSBoardgameRepositoryin methods for managing board game names.
- Replaced
-
lib/manager/favorites_manager.dart- Replaced
FavoriteRepositorywithPSFavoriteRepositoryin methods for managing favorites.
- Replaced
-
lib/manager/mechanics_manager.dart- Added new methods to add and update mechanics.
- Implemented
ManagerStatusenum 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
mechIndexNomeandmechDescricao. - 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
idtype fromString?toint?. - Added
bgIdfield of typeString?.
- Changed
- Updated
-
lib/common/models/boardgame.dart
- Updated
BoardgameModel:- Replaced
weightfield withviewsof typeintand set default value to0. - Adjusted
toStringmethod to reflect these changes.
- Replaced
- Updated
-
lib/common/singletons/current_user.dart
- Added
isAdmingetter 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
intanddoubletypes. - Improved validation and handling of numeric input based on the type.
- Refactored
_validateNumbermethod for better clarity.
- Made it generic to support both
- Modified
-
lib/components/form_fields/custom_form_field.dart
- Added
labelStyleparameter for customizing the text style of the label.
- Added
-
lib/components/form_fields/custom_long_form_field.dart
- Introduced a new
CustomLongFormFieldwidget to handle multi-line text input with various customization options.
- Introduced a new
-
lib/components/form_fields/custom_names_form_field.dart
- Added
labelStyleparameter for text style customization of the label.
- Added
-
lib/components/others_widgets/spin_box_field.dart
- Refactored the widget:
- Removed redundant
SizedBoxwrappers. - Replaced
TextFieldwithListenableBuilderto dynamically display numeric values.
- Removed redundant
- Refactored the widget:
-
lib/features/bg_search/bg_search_controller.dart
- Updated to include
CurrentUserfor 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
viewsandscoringfor further adjustments.
- Commented out the display of
-
lib/features/bg_search/widgets/search_card.dart
- Replaced
getBoardInfoparameter fromidtobgIdto reflect updated data model.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart
- Refactored to use updated
NumericEditControllerfor 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
weightfield withviewsin Parse Server operations.
- Replaced
-
lib/repository/parse_server/common/constants.dart
- Updated database constants to reflect the change from
weighttoviews.
- 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
MechanicsStorefor querying mechanics.
- Updated to use
-
lib/store/mech_store.dart
- Renamed to
bg_names.dartand refactored to better align with its purpose.
- Renamed to
-
lib/store/constants/constants.dart
- Updated database configuration:
- Renamed
dbNametobgBazzar.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
MechanicsStoreto handle mechanic-related database operations.
- Added new store class
-
pubspec.yaml & pubspec.lock
- Added dependencies:
sqflite_common_ffisqflite_common_ffi_webimage
- 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.dartto 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.dartto 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.dartto categorize it under government APIs.
- Renamed and moved to
-
lib/repository/viacep_repository.dart
- Renamed and moved to
lib/repository/gov_api/viacep_repository.dartto 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.dartto 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.dartfor better organization under Parse Server.
- Renamed and moved to
-
lib/repository/boardgame_repository.dart
- Renamed and moved to
lib/repository/parse_server/boardgame_repository.dartto 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.dartto 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.dartto 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.dartto 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.dartto 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.dartto 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.dartto 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.dartto align with SQLite-related stores.
- Renamed and moved to
-
lib/store/database_manager.dart
- Renamed and moved to
lib/repository/sqlite/store/database_manager.dartto centralize database management under SQLite.
- Renamed and moved to
-
lib/store/mech_store.dart
- Renamed and moved to
lib/repository/sqlite/store/mech_store.dartto 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_servertobgbazzar. - Updated references in the TODO list and project description.
- Renamed project title from
-
android/app/build.gradle
- Changed
namespacefrombr.dev.rralves.xlo_parse_servertobr.dev.rralves.bgbazzar. - Updated
applicationIdtobr.dev.rralves.bgbazzar.
- Changed
-
android/app/src/main/AndroidManifest.xml
- Updated
packageattribute tobr.dev.rralves.bgbazzar. - Changed
android:labeltobgbazzar.
- Updated
-
android/app/src/main/kotlin/br/dev/rralves/bgbazzar/MainActivity.kt
- Renamed package from
br.dev.rralves.xlo_parse_servertobr.dev.rralves.bgbazzar.
- Renamed package from
-
ios/Runner.xcodeproj/project.pbxproj
- Updated
PRODUCT_BUNDLE_IDENTIFIERreferences fromcom.example.xloParseServertobr.dev.rralves.xloParseServer.
- Updated
-
ios/Runner/AppDelegate.swift
- Changed the annotation from
@UIApplicationMainto@main.
- Changed the annotation from
-
lib/common/abstracts/data_result.dart
- Added a new abstract class
DataResultfor handling either success or failure outcomes, inspired by Swift and Dart implementations. - Introduced
Failure,GenericFailure,APIFailure,_SuccessResult, and_FailureResultclasses.
- Added a new abstract class
-
lib/common/models/ad.dart
- Removed
bggIdproperty fromAdModel. - Reorganized
toStringmethod 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,artistwith new names and types for better clarity. - Updated
toStringmethod to reflect these changes.
- Refactored properties: replaced
-
lib/components/others_widgets/ad_list_view/widgets/dismissible_ad.dart
- Added a
FIXMEcomment to indicate the need to select direction to disable unnecessary shifts.
- Added a
-
lib/features/bgg_search/bgg_search_screen.dart
- Replaced
BigButtonwithOverflowBarto allow more granular control of buttons likeSelecionarandCancelar.
- 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.ellipsisto designer and artist fields.
- Reorganized UI layout in
-
lib/features/boardgames/boardgame_controller.dart
- Updated method
loadBoardInfoto accommodate new property names for board game details.
- Updated method
-
lib/features/edit_ad/edit_ad_controller.dart
- Removed
bggIdhandling 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
bggIdfrom 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
imageproperty in the parsing logic. - Removed unnecessary properties and refined model creation logic for
BoardgameModel.
- Included
-
lib/repository/boardgame_repository.dart
- Added new repository class
BoardgameRepositoryto handle CRUD operations for board games.
- Added new repository class
-
lib/repository/common/constants.dart
- Added constants related to
BoardgameModelto handle new properties.
- Added constants related to
-
lib/repository/common/parse_to_model.dart
- Added parsing logic for
BoardgameModel. - Removed
bggIdrelated parsing from ad model creation.
- Added parsing logic for
-
pubspec.yaml
- Renamed project from
xlo_mobxtobgbazzar. - Added
equatablepackage dependency.
- Renamed project from
-
test/common/abstracts/data_result_test.dart
- Added test cases for
DataResultclass, including success, failure, and edge cases.
- Added test cases for
-
test/repository/ibge_repository_test.dart
- Updated import path from
xlo_mobxtobgbazzar.
- Updated import path from
-
web/index.html
- Renamed project references from
xlo_parse_servertobgbazzar.
- Renamed project references from
-
web/manifest.json
- Updated
nameandshort_namefromxlo_parse_servertobgbazzar.
- 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
ownerto be nullable. - Added
boardgame,yearpublished,minplayers,maxplayers,minplaytime,maxplaytime,age,designer, andartistfields. - Modified the constructor to initialize the new fields.
- Updated
toStringmethod to include the new fields.
- Changed
- Imported
-
lib/common/models/bgg_boards.dart
- Created
BGGBoardsModelclass withobjectid,name, andyearpublishedfields.
- Created
-
lib/common/models/boardgame.dart
- Updated
BoardgameModel:- Added new nullable fields
id,designer, andartist. - Renamed
boardgamemechanictomechanics. - Renamed
boardgamecategorytocategories. - Removed
toMapandfromMapmethods.
- Added new nullable fields
- Updated
-
lib/components/others_widgets/ad_list_view/widgets/ad_card_view.dart
- Updated
AdCardView:- Made
addressfields nullable when accessingcityandstate.
- Made
- Updated
-
lib/components/others_widgets/shop_grid_view/widgets/ad_shop_view.dart
- Updated
AdShopView:- Made
ownernullable 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
BggControllerfor 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
BGInfoCardwidget:- Displays detailed information about a selected board game.
- Created
-
lib/features/bgg_search/widgets/search_card.dart
- Created
SearchCardwidget:- Displays a list of search results from BGG.
- Created
-
lib/features/boardgames/boardgame_controller.dart
- Updated
BoardgameController:- Added disposal for additional controllers.
- Adjusted
getBggInfoto handle new mechanics field inBoardgameModel.
- Updated
-
lib/features/boardgames/boardgame_screen.dart
- Updated
BoardgamesScreen:- Added BGG search button and navigation to
BggSearchScreen. - Disposed of
BoardgameControllerproperly.
- Added BGG search button and navigation to
- Updated
-
lib/features/edit_ad/edit_ad_controller.dart
- Updated
EditAdController:- Integrated
BoardgameModeldata into Ad creation and editing. - Added
setBggInfomethod 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
ownerandaddressfields 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
addressfields 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
AdvertModelreferences toAdModel.
- Renamed
-
lib/common/models/advert.dart→lib/common/models/ad.dart- Renamed the file from
advert.darttoad.dart. - Updated class name from
AdvertModeltoAdModel. - Renamed
AdvertStatustoAdStatus.
- Renamed the file from
-
lib/common/models/filter.dart- Updated import statement from
advert.darttoad.dart.
- Updated import statement from
-
lib/components/custom_drawer/custom_drawer.dart- Renamed navigation functions from
EditAdvertScreentoEditAdScreen.
- Renamed navigation functions from
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart- Updated all references of
AdvertModeltoAdModel. - Updated status references from
AdvertStatustoAdStatus.
- Updated all references of
-
lib/features/address/address_controller.dart- Updated repository references from
AdvertRepositorytoAdRepository.
- Updated repository references from
-
lib/features/address/address_screen.dart- Updated repository references from
AdvertRepositorytoAdRepository.
- 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
AdvertModeltoAdModel. - Updated repository references from
AdvertRepositorytoAdRepository.
- 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
AdvertModeltoAdModel.
- 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
EditAdvertStatetoEditAdState.
- 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
AdvertFormtoAdForm.
- Renamed file and updated form references from
-
lib/features/favorites/favorites_controller.dart- Updated model references from
AdvertModeltoAdModel.
- 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
AdModelandAdRepository.
- Updated model and repository references to
-
lib/features/my_ads/my_ads_screen.dart- Updated navigation and model references to
EditAdScreenandAdModel.
- Updated navigation and model references to
-
lib/features/product/product_screen.dart- Updated model references from
AdvertModeltoAdModel.
- Updated model references from
-
lib/features/shop/shop_controller.dart- Updated repository and model references to
AdRepositoryandAdModel.
- Updated repository and model references to
-
lib/my_material_app.dart- Updated routing references from
EditAdvertScreentoEditAdScreen. - Updated model references from
AdvertModeltoAdModel.
- Updated routing references from
-
lib/repository/advert_repository.dart→lib/repository/ad_repository.dart- Renamed file and updated all function references from
AdvertModeltoAdModel.
- Renamed file and updated all function references from
-
lib/repository/common/constants.dart- Updated constants related to
Advertto reflect theAdnaming convention.
- Updated constants related to
-
lib/repository/common/parse_to_model.dart- Updated parsing functions to reference
AdModelinstead ofAdvertModel.
- Updated parsing functions to reference
-
lib/repository/favorite_repository.dart- Updated repository and model references to
AdModelandAdRepository.
- 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
descriptionfromfinalto a mutable field. - Updated
fromMapmethod to usecleanDescriptionfordescriptionfield. - Added
cleanDescriptionmethod to sanitize and format the description text.
- Changed
-
lib/components/buttons/big_button.dart
- Renamed
onPresscallback toonPressedfor consistency.
- Renamed
-
lib/components/custon_field_controllers/numeric_edit_controller.dart
- Created a new
NumericEditControllerclass to manage numeric input with validation.
- Created a new
-
lib/components/form_fields/custom_names_form_field.dart
- Added
onSubmittedcallback to handle form submission events.
- Added
-
lib/components/others_widgets/spin_box_field.dart
- Created a new
SpinBoxFieldwidget for numeric input with increment and decrement functionality.
- Created a new
-
lib/features/boardgames/boardgame_controller.dart
- Refactored to replace
bggNamewithnameController. - Added controllers for various board game properties (
minPlayersController,maxPlayersController, etc.). - Implemented
loadBoardInfomethod to populate controllers fromBoardgameModel. - Adjusted
getBggInfoto 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
AppBarto include a back button.
- Integrated new controllers and widgets (
-
lib/features/edit_advert/edit_advert_screen.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage. - Adjusted button labels for better clarity.
- Renamed
-
lib/features/edit_advert/widgets/advert_form.dart
- Integrated
BigButtonfor navigation toBoardgamesScreen. - Updated label text to clarify the input fields.
- Integrated
-
lib/features/filters/filters_screen.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage.
- Renamed
-
lib/features/login/login_screen.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage.
- Renamed
-
lib/features/login/widgets/login_form.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage.
- Renamed
-
lib/features/my_data/my_data_screen.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage.
- 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
onPresstoonPressedfor consistency inBigButtonusage.
- Renamed
-
lib/features/signup/widgets/signup_form.dart
- Renamed
onPresstoonPressedfor consistency inBigButtonusage.
- Renamed
-
lib/manager/mechanics_manager.dart
- Added
namesFromIdListStringmethod to convert list of mechanic IDs to a comma-separated string.
- Added
-
lib/repository/bgg_rank_repository.dart
- Removed instance of
BggRankStoreand used static methods instead.
- Removed instance of
-
lib/repository/bgg_xmlapi_repository.dart
- Used
BoardgameModel.cleanDescriptionto sanitize the description text from the XML API.
- Used
-
lib/repository/common/constants.dart
- Corrected table names from
AdSaletoAdsSaleand fromFavoritetoFavorites. - 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
MechStoreand 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
_copyBggDbandgetDBVerionmethods 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_difftarget. - Modified
git_pushto includegit add .and changed commit file fromcommit.txttocommit.
- Added
-
lib/common/models/advert.dart
- Imported
foundation.dart. - Added
bggIdfield toAdvertModel. - Modified constructor to include
bggId. - Updated
toStringmethod to includebggId.
- Imported
-
lib/common/models/bgg_rank.dart
- Created new model
BggRankModelwith fieldsid,gameName,yearPublished,rank,bayesAverage,average,usersRated,isExpansion,abstractsRank,cgsRank,childrensGamesrank,familyGamesRank,partyGamesRank,strategyGamesRank,thematicRank,warGamesRank. - Added factory methods
fromMapandtoMap. - Implemented
toStringmethod.
- Created new model
-
lib/common/models/boardgame.dart
- Created new model
BoardgameModelwith fieldsname,yearpublished,minplayers,maxplayers,minplaytime,maxplaytime,age,description,average,bayesaverage,averageweight,boardgamemechanic,boardgamecategory. - Added factory methods
fromMapandtoMap. - Implemented
toStringmethod.
- Created new model
-
lib/components/form_fields/custom_form_field.dart
- Added
suffixTextandprefixTextparameters. - Updated constructor to include
suffixTextandprefixText. - Modified
buildmethod to usesuffixTextandprefixText.
- 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
StatefulWidgetlogic to show suggestions based on input.
- Created new widget
-
lib/components/others_widgets/state_error_message.dart
- Added
closeDialogcallback toStateErrorMessage. - Updated constructor to include
closeDialog. - Added a button to close the dialog.
- Added
-
lib/features/address/address_controller.dart
- Added
closeErroMessagemethod to change state toAddressStateSuccess.
- Added
-
lib/features/address/address_screen.dart
- Replaced
ButtonBarwithOverflowBar. - Updated to use
StateErrorMessagewithcloseDialogcallback.
- Replaced
-
lib/features/address/widgets/destiny_address_dialog.dart
- Replaced
ButtonBarwithOverflowBar.
- Replaced
-
lib/features/boardgames/boardgame_controller.dart
- Created
BoardgameControllerwithBoardgameState,rankManager, andbggName. - Added methods to handle BGG rank initialization and fetching.
- Created
-
lib/features/boardgames/boardgame_screen.dart
- Created
BoardgamesScreento display board game details. - Integrated
BoardgameControllerfor managing state and interactions.
- Created
-
lib/features/boardgames/boardgame_state.dart
- Created
BoardgameStateabstract class withBoardgameStateInitial,BoardgameStateLoading,BoardgameStateSuccess, andBoardgameStateError.
- Created
-
lib/features/edit_advert/edit_advert_controller.dart
- Added
bggNameandrankManagerfields. - Modified
initmethod to includebggName. - Updated methods to handle
bggId.
- Added
-
lib/features/edit_advert/edit_advert_screen.dart
- Replaced
ButtonBarwithOverflowBar. - Added navigation to
BoardgamesScreen.
- Replaced
-
lib/features/edit_advert/widgets/advert_form.dart
- Added
CustomFormFieldfor board game name. - Added button to navigate to
BoardgamesScreen.
- Added
-
lib/features/login/login_controller.dart
- Added
closeErroMessagemethod 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
ButtonBarwithOverflowBar.
- Replaced
-
lib/features/my_ads/my_ads_controller.dart
- Added
closeErroMessagemethod to change state toBasicStateSuccess.
- Added
-
lib/features/my_ads/my_ads_screen.dart
- Updated to use
StateErrorMessagewithcloseDialogcallback.
- Updated to use
-
lib/features/new_address/new_address_screen.dart
- Replaced
ButtonBarwithOverflowBar.
- Replaced
-
lib/features/shop/shop_controller.dart
- Added
closeErroMessagemethod to change state toBasicStateSuccess.
- Added
-
lib/features/shop/shop_screen.dart
- Updated to use
StateErrorMessagewithcloseDialogcallback.
- Updated to use
-
lib/get_it.dart
- Registered
BggRankManagerin dependency injection.
- Registered
-
lib/manager/bgg_rank_manager.dart
- Created
BggRankManagerto 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
bggIdinAdvertRepository.
- Updated to set
-
lib/repository/bgg_rank_repository.dart
- Created
BggRankRepositoryfor interacting with BGG rank data.
- Created
-
lib/repository/bgg_xmlapi_repository.dart
- Created
BggXMLApiRepositoryto 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
bggIdinAdvertModel.
- Updated to parse
-
lib/store/bgg_rank_store.dart
- Created
BggRankStorefor 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
xmldependency for XML parsing.
- Added
-
lib/common/models/advert.dart
- Added import for
foundation.dartto supportlistEquals.
- Added import for
-
lib/features/address/widgets/destiny_address_dialog.dart
- Replaced
ButtonBarwithOverflowBarfor 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_URIPARSE_SERVER_APPLICATION_IDPARSE_SERVER_MASTER_KEYPARSE_SERVER_CLIENT_KEYPARSE_SERVER_JAVASCRIPT_KEYPARSE_SERVER_REST_API_KEYPARSE_SERVER_FILE_KEYPARSE_SERVER_URLPARSE_SERVER_MASTER_KEY_IPSPARSE_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
mechanicsIdtype fromList<String>toList<int>.
- Changed
-
lib/common/models/filter.dart
- Changed
mechanicsIdtype fromList<String>toList<int>.
- Changed
-
lib/common/models/mechanic.dart
- Updated
MechanicModelclass:- Changed
idtype fromString?toint?. - Changed
nametype fromString?toString. - Added methods
toMapandfromMap.
- 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
ButtonBehaviorenum. - Updated item button logic for ads:
- Added
_editButtonand_deleteButtonmethods. - Added
_showAdmethod for navigation. - Added logic to show buttons based on
buttonBehaviorflag.
- Added
- Improved scrolling behavior:
- Renamed
_scrollListener2to_scrollListener. - Added
_isScrollingflag to prevent multiple requests.
- Renamed
- Removed
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart
- Improved scrolling behavior:
- Renamed
_scrollListener2to_scrollListener. - Added
_isScrollingflag 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
isLoggedgetter. - Used
FavStackButtonif user is logged in.
- Added
- Display favorite button for logged-in users only:
-
lib/features/edit_advert/edit_advert_controller.dart
- Changed
selectedMechIdstype fromList<String>toList<int>.
- Changed
-
lib/features/edit_advert/widgets/advert_form.dart
- Updated mechanics ID handling.
-
lib/features/filters/filters_controller.dart
- Changed
selectedMechIdstype fromList<String>toList<int>.
- Changed
-
lib/features/filters/filters_screen.dart
- Updated mechanics ID handling.
-
lib/features/mecanics/mecanics_screen.dart
- Changed
selectedIdstype 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
StateLoadingMessageandStateErrorMessagecomponents.
- Used
- Added loading and error states:
-
lib/features/my_ads/widgets/my_tab_bar_view.dart
- Simplified item button logic:
- Removed
getItemButtonmethod. - 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
isLoggedgetter. - Used
FavStackButtoninStack.
- 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
DatabaseManagersingleton.
- Registered
-
lib/manager/mechanics_manager.dart
- Changed
mechanicsIdtype fromList<String>toList<int>. - Updated
nameFromIdmethod to useinttype.
- Changed
-
lib/repository/advert_repository.dart
- Changed
mechanicsIdtype fromList<String>toList<int>in ad saving methods.
- Changed
-
lib/repository/common/constants.dart
- Increased
maxAdsPerListfrom 6 to 20.
- Increased
-
lib/repository/common/parse_to_model.dart
- Changed
mechanicsIdtype fromList<String>toList<int>in ad parsing method.
- Changed
-
lib/repository/mechanic_repository.dart
- Refactored to use local SQLite database for mechanics data:
- Used
MechStorefor 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
FavStackButtonwidget 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
AdListViewto include new button behavior:- Added
_editButtonand_deleteButtonmethods. - Modified
_scrollListenerfor 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
ShopGridViewfor better scrolling performance:- Modified
_scrollListenerfor smoother scrolling. - Added
_isScrollingto prevent duplicate load calls.
- Modified
- Updated
-
lib/features/my_ads/my_ads_screen.dart
- Enhanced
MyAdsScreento display loading and error messages:- Added
StateLoadingMessageandStateErrorMessagefor better state handling.
- Added
- Enhanced
-
lib/features/product/product_screen.dart
- Improved
ProductScreento include favorite button for logged-in users:- Added
FavStackButtonto theImageCarouselstack.
- Added
- Improved
-
lib/repository/common/constants.dart
- Increased
maxAdsPerListfrom 6 to 20 to display more ads per load.
- Increased
-
lib/store/database_manager.dart
- Created
DatabaseManagerto 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
MechStoreto 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
sqfliteandpath_providerto 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_profiletarget 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, andtargetSdkversions 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
appTitlewith the value 'BGBazzar'.
- Introduced a new constant
-
lib/common/singletons/search_filter.dart- Refactored the
SearchFilterclass, removing redundant code and adding ahaveFiltergetter.
- Refactored the
-
lib/common/singletons/search_history.dart- Refactored the
SearchHistoryclass, 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
BaseControllerwithShopController.
- 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_preferencespackage 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
FavoritesScreento enable navigation. - Updated the "Favoritos" list tile to use
Navigator.pushNamedfor navigation.
- Imported
-
lib/features/base/base_controller.dart- Removed "Favoritos" from the
titleslist.
- Removed "Favoritos" from the
-
lib/features/base/base_screen.dart- Removed the
FavoritesScreenfrom the list of screens managed byBaseScreen.
- Removed the
-
lib/features/favorites/favorites_controller.dart- New file: Added
FavoritesControllerto manage the state and data of the Favorites feature.
- New file: Added
-
lib/features/favorites/favorites_screen.dart- Implemented the
FavoritesScreenwith state management and display logic usingFavoritesControllerandShopGridView.
- Implemented the
-
lib/features/shop/shop_screen.dart- Removed the
showImagemethod as it is now redundant with theShopGridViewimplementation.
- Removed the
-
lib/get_it.dart- Added disposal of
FavoritesManagerin thedisposeDependenciesmethod.
- Added disposal of
-
lib/manager/favorites_manager.dart- Added the
adsgetter to expose the list of favorite ads. - Added a
disposemethod to properly clean up thefavNotifier.
- Added the
-
lib/my_material_app.dart- Added a route for
FavoritesScreenin the route table.
- Added a route for
-
pubspec.yaml- Updated the version from
0.6.1+26to0.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
FavoritesManagerintegration for managing user favorites. - Renamed
isLogedtoisLogged. - Added
loginmethod for handling user login logic. - Updated
logoutmethod to clear user favorites and addresses.
- Added
-
lib/components/custom_drawer/custom_drawer.dart- Renamed
isLogedtoisLoggedto ensure consistent naming. - Updated button interactions based on user login status.
- Renamed
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart- Renamed
isLogedtoisLoggedfor consistency.
- Renamed
-
lib/components/others_widgets/shop_grid_view/shop_grid_view.dart- New file: Added
ShopGridViewwidget 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
AdShopViewwidget for displaying individual advertisements.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/owner_rating.dart- New file: Added
OwnerRatingwidget to display owner ratings.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/shop_text_price.dart- New file: Added
ShopTextPricewidget to display advertisement prices.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/shop_text_title.dart- New file: Added
ShopTextTitlewidget to display advertisement titles.
- New file: Added
-
lib/components/others_widgets/shop_grid_view/widgets/show_image.dart- New file: Added
ShowImagewidget to handle image display.
- New file: Added
-
lib/features/base/base_screen.dart- Renamed
isLogedtoisLoggedto ensure consistent naming.
- Renamed
-
lib/features/edit_advert/edit_advert_screen.dart- Updated title to reflect editing state.
- Added
StateLoadingMessageandStateErrorMessagefor better state handling. - Fixed controller reference in
ImagesListView.
-
lib/features/edit_advert/widgets/image_list_view.dart- Fixed controller reference to
ctrlfor consistency.
- Fixed controller reference to
-
lib/features/shop/shop_screen.dart- Replaced
AdListViewwithShopGridViewfor better advertisement display.
- Replaced
-
lib/get_it.dart- Registered
FavoritesManagerfor dependency injection.
- Registered
-
lib/manager/address_manager.dart- Added methods
loginandlogoutto manage user login state.
- Added methods
-
lib/manager/favorites_manager.dart- New file: Added
FavoritesManagerto manage user favorites, including methods to add, remove, and fetch favorites.
- New file: Added
-
lib/repository/constants.dart- Updated
maxAdsPerListto 6 for better pagination.
- Updated
-
lib/repository/favorite_repository.dart- Updated
addmethod to useadIddirectly. - Added
getFavoritesmethod to fetch user's favorite advertisements.
- Updated
-
lib/repository/parse_to_model.dart- Renamed
favotiretofavoritefor correct spelling. - Added type annotation for
mechanicmethod.
- 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
FavoriteModelclass to represent favorite advertisements with attributesidandadId.
- New file: Added
-
lib/features/address/address_controller.dart- Removed unnecessary delay after deleting an address in the
moveAdsAddressAndRemovemethod.
- 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.dartfor 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.dartfor better organization.
- Renamed and moved to
-
lib/features/edit_advert/edit_advert_controller.dart- Updated
mechanicsManagerto use the instance fromgetItfor dependency injection.
- Updated
-
lib/features/filters/filters_controller.dart- Updated
mechManagerto use the instance fromgetItfor 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
mechanicsto use the instance fromgetItfor dependency injection.
- Updated
-
lib/features/my_account/my_account_screen.dart- Refactored
onPressedmethod 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_sliderwithflutter_carousel_sliderfor better functionality. - Updated the layout and behavior of the image carousel.
- Replaced
-
lib/get_it.dart- Registered
MechanicsManageras 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
Favoritetable and its fields.
- Added constants for the
-
lib/repository/favorite_repository.dart- New file: Added
FavoriteRepositorywith methods to add and delete favorites.
- New file: Added
-
lib/repository/parse_to_model.dart- Added method
favoriteto convert ParseObject toFavoriteModel.
- Added method
-
lib/repository/user_repository.dart- Updated
updatemethod to handle user password changes more effectively. - Improved logout method to be asynchronous.
- Updated
-
pubspec.lock- Removed
carousel_sliderpackage. - Added
flutter_carousel_sliderpackage.
- Removed
-
pubspec.yaml- Removed
carousel_sliderdependency. - Added
flutter_carousel_sliderdependency.
- 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
SimpleQuestionDialogwidget 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
AddressStatemanagement. - Introduced
selectesAddresId,_changeState, andmoveAdsAddressAndRemovemethods for better address handling.
- Imported
-
lib/features/address/address_screen.dart- Imported
dart:developerandstate_error_message.dart. - Updated
_removeAddressto handle advertisements associated with the address. - Added
AnimatedBuilderfor managing loading and error states. - Included
DestinyAddressDialogfor 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.dartto be consistent with the new address state management.
- Renamed file to
-
lib/features/address/widgets/destiny_address_dialog.dart- New file: Added
DestinyAddressDialogwidget for selecting a destination address when removing an address with associated advertisements.
- New file: Added
-
lib/features/my_ads/my_ads_screen.dart- Added
floatingActionButtonfor adding new advertisements. - Introduced
_addNewAdvertmethod to navigate to theEditAdvertScreen.
- Added
-
lib/features/my_data/my_data_controller.dart- Removed
MyDataStatemanagement to simplify the controller. - Removed
_changeStatemethod.
- Removed
-
lib/features/my_data/my_data_screen.dart- Added
backScreenmethod to handle unsaved changes. - Refactored the screen layout to include
SimpleQuestionDialogfor unsaved changes.
- Added
-
lib/manager/address_manager.dart- Added methods
deleteByName,deleteById, andgetAddressIdFromNamefor better address management.
- Added methods
-
lib/repository/address_repository.dart- Updated
deletemethod to acceptaddressIdinstead ofaddress. - Added
moveAdsAddressTomethod for moving advertisements to another address. - Added
adsInAddressmethod to retrieve advertisements associated with a specific address.
- Updated
-
lib/repository/advert_repository.dart- Updated
deletemethod to acceptadIdinstead ofad. - Added
moveAdsAddressToandadsInAddressmethods 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
deletedstatus to theAdvertStatusenum.
- Added
-
lib/common/singletons/current_user.dart- Imported
get_it.dart. - Changed the initialization of
addressManagerto usegetIt<AddressManager>().
- Imported
-
lib/common/utils/extensions.dart- Added a new extension method
onlyNumberstoStringExtension.
- Added a new extension method
-
lib/common/validators/validators.dart- Imported
extensions.dart. - Renamed
nicknamevalidation method toname. - Enhanced
phonevalidation to include various checks like length, area code, and valid mobile/landline number. - Added
DataValidatorclass with methods for validating password, confirming password, name, and phone.
- Imported
-
lib/components/custom_drawer/custom_drawer.dart- Removed redundant imports.
- Updated
CustomDrawerconstructor and properties. - Refactored
_navToLoginScreenmethod intonavToLoginScreen. - Adjusted
ListTileitems to usectrl.jumpToPage.
-
lib/components/form_fields/password_form_field.dart- Added
fullBorderparameter toPasswordFormField. - Conditional application of
OutlineInputBorder.
- Added
-
lib/components/others_widgets/state_error_message.dart- New file: Added
StateErrorMessagewidget for displaying error messages.
- New file: Added
-
lib/components/others_widgets/state_loading_message.dart- New file: Added
StateLoadingMessagewidget for displaying loading messages.
- New file: Added
-
lib/features/address/address_controller.dart- Changed the initialization of
addressManagerto usegetIt<AddressManager>().
- Changed the initialization of
-
lib/features/address/address_screen.dart- Disabled
_removeAddressbutton and added comments for future implementation.
- Disabled
-
lib/features/base/base_controller.dart- Added
usergetter. - Refactored
jumpToPageandsetPageTitlemethods. - Adjusted
titlesconstant to reflect updated page titles.
- Added
-
lib/features/base/base_screen.dart- Updated
titleWidgetto usectrl.pageTitle. - Added
navToLoginScreenmethod. - Replaced
CircularProgressIndicatorwithStateLoadingMessage.
- Updated
-
lib/features/login/login_screen.dart- Added
StateErrorMessageandStateLoadingMessagefor error and loading states. - Threw exception for unimplemented navigation actions.
- Added
-
lib/features/my_account/my_account_screen.dart- Added imports for
AddressScreenandMyDataScreen. - Updated
ListTileitems to use the new screens.
- Added imports for
-
lib/features/my_ads/my_ads_controller.dart- Commented out the call to
AdvertRepository.deleteand added a status update usingAdvertRepository.updateStatus.
- Commented out the call to
-
lib/features/my_data/my_data_controller.dart- New file: Added
MyDataControllerfor managing user data.
- New file: Added
-
lib/features/my_data/my_data_screen.dart- New file: Added
MyDataScreenfor displaying and editing user data.
- New file: Added
-
lib/features/my_data/my_data_state.dart- New file: Added
MyDataStateclasses for representing different states inMyDataController.
- New file: Added
-
lib/features/product/widgets/title_product.dart- Added optional
colorparameter toTitleProduct.
- Added optional
-
lib/features/shop/shop_screen.dart- Added
StateErrorMessageandStateLoadingMessagefor error and loading states. - Adjusted
FloatingActionButtonbehavior to reinitialize the controller after login.
- Added
-
lib/features/signup/signup_controller.dart- Renamed
nicknameControllertonameController. - Updated focus nodes and controller disposal.
- Renamed
-
lib/features/signup/widgets/signup_form.dart- Updated to use
nameControllerandphoneFocusNode.
- Updated to use
-
lib/get_it.dart- Registered
AddressManageras 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
updateStatusmethod to useparse.update.
- Updated
-
lib/repository/user_repository.dart- Added
updatemethod 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
AdvertScreentoEditAdvertScreen. - Updated navigation from
AdvertScreentoEditAdvertScreen.
- Changed import from
-
Modified Navigation in
lib/features/base/base_screen.dart:- Changed import from
AccountScreentoMyAccountScreen. - Updated the last screen in
PageViewtoMyAccountScreen.
- Changed import from
-
Renamed Advertisement Controller and State:
- Renamed
lib/features/advertisement/advert_controller.darttolib/features/edit_advert/edit_advert_controller.dart. - Renamed
AdvertControllertoEditAdvertController. - Updated state management classes from
AdvertStatetoEditAdvertState.
- Renamed
-
Renamed Advertisement Screen:
- Renamed
lib/features/advertisement/advert_screen.darttolib/features/edit_advert/edit_advert_screen.dart. - Renamed
AdvertScreentoEditAdvertScreen.
- Renamed
-
Updated Advertisement State Class Names:
- Renamed
lib/features/advertisement/advert_state.darttolib/features/edit_advert/edit_advert_state.dart. - Updated state classes from
AdvertStatetoEditAdvertState.
- Renamed
-
Updated Advertisement Form and Widgets:
- Renamed advertisement form and widget files to
edit_advertequivalents.
- Renamed advertisement form and widget files to
-
Renamed Account Screen:
- Renamed
lib/features/account/account_screen.darttolib/features/my_account/my_account_screen.dart. - Renamed
AccountScreentoMyAccountScreen.
- Renamed
-
Updated References in My Ads Screen:
- Updated import and usage from
AdvertScreentoEditAdvertScreen.
- Updated import and usage from
-
Updated Shop Screen Navigation:
- Changed navigation from
AdvertScreentoEditAdvertScreen.
- Changed navigation from
-
Updated Main App Navigation:
- Changed import and route from
AccountScreentoMyAccountScreen. - 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
AppPageenum with valuesshopePage,chatPage,favoritesPage, andaccountPagefor better navigation handling.
- Created a new file to define the
-
lib/components/buttons/big_button.dart- Updated the button's
borderRadiusto 32 for a more rounded appearance.
- Updated the button's
-
lib/components/custom_drawer/custom_drawer.dart- Imported
AppPageenum fromapp_constants.dartandAdvertScreen. - Replaced hard-coded page numbers with
AppPageenum values for improved readability and maintainability.
- Imported
-
lib/components/others_widgets/ad_list_view/ad_list_view.dart- Added
editAdanddeleteAdcallbacks 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
AppPageenum fromapp_constants.dart. - Replaced hard-coded page number with
AppPage.shopePagefor navigation after logout.
- Imported
-
lib/features/advertisement/advert_controller.dart- Updated
initmethod to usesetSelectedAddressfor setting the address. - Improved
removeImagemethod to handle both URL and local file deletion. - Added
updateAdsmethod to update an existing advertisement. - Renamed
createAnnouncetocreateAdsand 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
_createAnnouncemethod 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
SegmentedButtonfor better representation ofAdvertStatusvalues.
- Updated icons in
-
lib/features/advertisement/widgets/horizontal_image_gallery.dart- Added
showImagemethod to handle displaying both network and local images. - Adjusted
_showImageEditDialogto show either a network or local image based on the URL pattern.
- Added
-
lib/features/advertisement/widgets/image_list_view.dart- Added
editAdanddeleteAdcallbacks for handling ad editing and deletion.
- Added
-
lib/features/base/base_controller.dart- Imported
AppPageenum fromapp_constants.dart. - Replaced
_pagetype frominttoAppPagefor better type safety and readability.
- Imported
-
lib/features/base/base_screen.dart- Imported
AppPageenum fromapp_constants.dart. - Updated various navigation references to use
AppPageenum values.
- Imported
-
lib/features/my_ads/my_ads_controller.dart- Implemented
updateAdmethod to refresh ads after an update. - Implemented
deleteAdmethod to delete an advertisement and refresh the ads list.
- Implemented
-
lib/features/my_ads/my_ads_screen.dart- Added methods
_editAdand_deleteAdto handle editing and deletion of advertisements with confirmation dialogs. - Updated
MyTabBarViewusage to includeeditAdanddeleteAdcallbacks.
- Added methods
-
lib/features/my_ads/widgets/my_tab_bar.dart- Updated icons in
Tabwidgets for better representation of advertisement statuses.
- Updated icons in
-
lib/features/my_ads/widgets/my_tab_bar_view.dart- Added
editAdanddeleteAdcallbacks toAdListView.
- Added
-
lib/features/shop/shop_screen.dart- Imported
AdvertScreen. - Updated
FloatingActionButtonto navigate toAdvertScreenfor adding a new advertisement.
- Imported
-
lib/repository/advert_repository.dart- Added
updatemethod to update an advertisement on the Parse server. - Improved
_saveImagesmethod to correctly identify URL patterns. - Added
deletemethod 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
titleproperty to appear beforestatusin theAdvertModelclass for consistency.
- Reordered the
-
lib/components/custon_field_controllers/currency_text_controller.dart- Added
currencyValuesetter 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:developerfor logging purposes. - Added
ButtonBehaviorenum to define possible button actions (edit,delete). - Replaced
itemButtonparameter withbuttonBehaviorto handle different button actions dynamically. - Added
getItemButtonmethod 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
Cardwidget with ashapeproperty, applyingRoundedRectangleBorderto provide rounded corners for better visual appeal.
- Updated the
-
lib/features/advertisement/advert_controller.dart- Added
initmethod to initialize the controller with anAdvertModelinstance, populating various fields liketitle,description,hidePhone,price,status,mechanicsId,address, andimages. - Added
setImagesmethod to set the list of images in the controller, updating the_imageslist and notifying listeners.
- Added
-
lib/features/advertisement/advert_screen.dart- Updated constructor to accept an optional
AdvertModelinstance, allowing the screen to display and edit existing advertisements. - Added initialization of
AdvertControllerwith the providedAdvertModelinstance ininitStateto 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
updateAdanddeleteAdwith 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
TabBarandTabBarViewwith custom widgetsMyTabBarandMyTabBarViewto improve code modularity and readability. - Added custom
MyTabBarwidget to handle tab selection and update the product status in the controller. - Added custom
MyTabBarViewwidget 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
TabBarwidget 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
TabBarViewwidget that displays a list of advertisements with different statuses, usingAdListViewwith configurable actions for each tab.
- Implements a custom
-
lib/my_material_app.dart- Updated routing logic to handle
AdvertScreennavigation, passing anAdvertModelinstance when navigating to allow for ad editing. - Simplified
onGenerateRoutemethod 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.dartto useValueNotifier. - Added:
_isLogedasValueNotifier<bool>to manage login state. - Updated:
isLogedto use_isLoged.valueand addedisLogedListernablegetter. - Modified:
initmethod to update_isLoged.valueupon initialization. - Added:
disposemethod to dispose of_isLoged. - Updated:
logoutmethod to set_isLoged.valueto 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:
ShopControllerwithBasicController. - Enhanced:
AdListViewwith 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:
_adStatusproperty and corresponding getter. - Refactored: Moved
_changeStatemethod to a different position. - Updated:
saveAdmethod to includestatusproperty. - Added:
setAdStatusmethod to update advertisement status.
- Added:
-
lib/features/advertisement/advert_screen.dart- Wrapped:
AdvertFormandBigButtoninside aColumnfor better structure.
- Wrapped:
-
lib/features/advertisement/widgets/advert_form.dart- Imported:
fitted_button_segment.dartfor 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:
getAdsmethod to use a helper method_getAds. - Added:
_getAdsand_getMoreAdshelper methods for better code organization. - Added:
updateAdStatusmethod to handle advertisement status updates.
- Refactored:
-
lib/features/my_ads/my_ads_screen.dart- Enhanced:
AdListViewto support dismissible ads with custom status updates and icons. - Added:
physicsproperty toTabBarViewto disable scrolling.
- Enhanced:
-
lib/features/shop/shop_controller.dart- Refactored:
getAdsmethod to reset_adPageand clear ads. - Added:
updateAdStatusmethod withUnimplementedError.
- Refactored:
-
lib/features/shop/shop_screen.dart- Updated: Import path for
ad_list_view.dart. - Added:
ValueListenableBuilderto manageFloatingActionButtonstate based on login status.
- Updated: Import path for
-
lib/features/shop/widgets/ad_text_price.dart- Removed: Unused
colorSchemevariable. - Updated: Text style for better readability.
- Removed: Unused
-
lib/features/shop/widgets/ad_text_title.dart- Changed:
maxLinesfrom 3 to 2 for better layout consistency.
- Changed:
-
lib/get_it.dart- Added:
disposecall 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:
updateStatusmethod 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.closedfrom theAdvertStatusenum.
- Removed
-
lib/common/theme/app_text_style.dart
- Added
font14Thinstyle 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
TabBarlength 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
AnimationControllerduration forFloatingActionButtonto 300 milliseconds. - Simplified scroll notification handling logic.
- Adjusted
-
lib/features/shop/shop_controller.dart
- Refactored to extend
BasicControllerand useBasicStatefor state management. - Added initialization and pagination logic for fetching advertisements.
- Refactored to extend
-
lib/features/shop/shop_screen.dart
- Refactored to integrate
BasicStatefor consistent state management. - Updated
AnimationControllerduration and scroll listener logic. - Improved
FloatingActionButtonanimation and visibility handling.
- Refactored to integrate
-
lib/my_material_app.dart
- Changed the text theme order in
createTextThemeto prioritize "Poppins" over "Comfortaa".
- Changed the text theme order in
-
lib/repository/advert_repository.dart
- Removed the
maxAdsPerListconstant and relocated it toconstants.dart.
- Removed the
-
lib/repository/constants.dart
- Added
maxAdsPerListconstant 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
BasicControllerabstract 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
BasicStateabstract class and its concrete implementations:BasicStateInitial,BasicStateLoading,BasicStateSuccess, andBasicStateError.
- Added new file defining
-
lib/common/models/address.dart
- Added
import 'dart:convert';. - Included
createdAtproperty inAddressModel. - Modified constructor to initialize
createdAt. - Updated
toString,==, andhashCodemethods to includecreatedAt. - Added
copyWithmethod. - Added
toMap,fromMap,toJson, andfromJsonmethods 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
AppSettingsto remove singleton pattern, allowing for direct instantiation.
- Refactored
-
lib/common/singletons/current_user.dart
- Refactored
CurrentUserto remove singleton pattern, allowing for direct instantiation. - Added
logoutmethod to handle user logout.
- Refactored
-
lib/common/singletons/search_filter.dart
- Refactored
SearchFilterto remove singleton pattern, allowing for direct instantiation. - Added
disposemethod to clean up resources.
- Refactored
-
lib/common/singletons/search_history.dart
- Refactored
SearchHistoryto 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
jumpToPagefromBaseController. - Enhanced
ListTilewidgets 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
isLogintoisLogedfor better readability.
- Updated imports and added dependency injection with
-
lib/features/account/account_screen.dart
- Converted
AccountScreento 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
BaseScreento use dependency injection withgetIt. - Removed redundant
_changeToPagemethod 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
MyAdsControllerextendingBasicController. - Implemented
init,getAds,getMoreAds, andsetProductStatusmethods.
- Added new file with
-
lib/features/my_ads/my_ads_screen.dart
- Added new file with
MyAdsScreenimplementing a stateful widget. - Integrated
MyAdsControllerand implemented UI with tabs for different ad statuses.
- Added new file with
-
lib/features/my_ads/my_ads_state.dart
- Added new file defining
MyAdsStateabstract 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
AdListViewwidget 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
ShopScreento use dependency injection withgetIt. - Removed redundant
changeToPagemethod.
- 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_itfor dependency injection. - Updated initialization to use
setupDependencies.
- Integrated
-
lib/my_material_app.dart
- Updated imports and added dependency injection with
getIt. - Refactored
initialRouteandonGenerateRoutefor better route management.
- Updated imports and added dependency injection with
-
lib/repository/address_repository.dart
- Added a comment for potential fix regarding
toPointerusage.
- Added a comment for potential fix regarding
-
lib/repository/advert_repository.dart
- Added
getMyAdsmethod to fetch user-specific advertisements. - Refactored query logic to use consistent naming conventions.
- Added
-
lib/repository/constants.dart
- Added
keyAddressCreatedAtconstant.
- Added
-
lib/repository/parse_to_model.dart
- Updated
ParseToModelmethods to includecreatedAtproperty.
- Updated
-
pubspec.lock
- Added
get_itdependency.
- Added
-
pubspec.yaml
- Added
get_itto 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.edittoIcons.camera.
- Changed the icon for 'Inserir AnĂşncio' from
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart
- Wrapped texts in
FittedBoxfor 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
ReadMoreTextcomponent for handling expandable text with 'read more' and 'show less' functionality.
- Added the new
-
lib/features/base/base_screen.dart
- Updated
PageViewchildren to includeShopScreen(_changeToPage)and modified theShopScreeninstantiation.
- Updated
-
lib/features/product/product_screen.dart
- Converted
ProductScreento aStatefulWidgetto 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
DescriptionProductwidget using theReadMoreTextcomponent.
- Created
-
lib/features/product/widgets/duo_segmented_button.dart
- Created
DuoSegmentedButtonwidget for segmented button functionality.
- Created
-
lib/features/product/widgets/image_carousel.dart
- Created
ImageCarouselwidget for displaying product images usingcarousel_slider.
- Created
-
lib/features/product/widgets/location_product.dart
- Created
LocationProductwidget for displaying product location details.
- Created
-
lib/features/product/widgets/price_product.dart
- Created
PriceProductwidget for displaying product price.
- Created
-
lib/features/product/widgets/sub_title_product.dart
- Created
SubTitleProductwidget for displaying subtitles in product details.
- Created
-
lib/features/product/widgets/title_product.dart
- Created
TitleProductwidget for displaying the product title.
- Created
-
lib/features/product/widgets/user_card_product.dart
- Created
UserCardwidget for displaying user information related to the product.
- Created
-
lib/features/shop/shop_screen.dart
- Updated
ShopScreento 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
AdListViewto use the sharedScrollControllerfor handling list view scroll behavior. - Added
InkWellto navigate to theProductScreenon 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
ShopScreento pass a callback for page changes.
-
pubspec.yaml and pubspec.lock
- Added dependency for
carousel_sliderversion4.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.messageto accept aStringparameter. - Added logic to identify specific error messages.
- Modified
-
lib/common/singletons/current_user.dart
- Updated method names in
CurrentUserto 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
AddressManagerchanges.
- Updated method calls to match
-
lib/features/home/home_controller.dart
- Changed method calls in
HomeControllerto 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
_checksPermissionsmethod 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
flutterVersionCodeandflutterVersionNameinitialization to include default values. - Changed
namespaceandapplicationId. - Added lint options for Java compilation.
- Added dependency for
ucroplibrary.
- Updated
-
android/app/src/main/AndroidManifest.xml
- Added
packageattribute 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
UserModelfor owner andAddressModelfor address. - Reorganized fields.
- Updated model structure to use
-
lib/common/models/filter.dart
- Added
setFiltermethod 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
SearchFiltersingleton. - Updated search handling methods.
- Integrated
-
lib/features/base/base_screen.dart
- Integrated
SearchFilterand 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
SearchFilterand updated advertisement fetching logic.
- Integrated
-
lib/features/home/home_screen.dart
- Integrated
AdListViewfor 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
ParseToModelfor model conversion. - Removed redundant logging.
- Refactored to use
-
lib/repository/advert_repository.dart
- Refactored to use
ParseToModelfor 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
ParseToModelfor 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
HomeScreenlayout and integrated theAdListViewto 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_utilsand updated various dependencies to ensure compatibility and leverage new features.
- Added
-
pubspec.yaml
- Added dependencies for
intl_utilsto 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
AdStatustoAdvertStatus. - Added new
ProductConditionenum. - Updated
AdvertModelto includeconditionproperty with default valueProductCondition.all. - Modified constructor to initialize
condition. - Updated
toStringmethod to includecondition.
- Renamed
-
lib/common/models/filter.dart- Imported
advert.dart. - Removed
AdvertiserOrderenum. - Updated
FilterModelto includeconditionproperty with default valueProductCondition.all. - Modified constructor to initialize
condition. - Updated
isEmpty,toString,==, andhashCodemethods to includecondition.
- Imported
-
lib/common/models/user.dart- Commented out
UserTypeenum. - Removed
typeproperty fromUserModeland related methods.
- Commented out
-
lib/common/singletons/app_settings.dart- Added
searchproperty toAppSettings.
- Added
-
lib/features/advertisement/advert_controller.dart- Added
_conditionproperty with default valueProductCondition.used. - Added getter for
condition. - Updated
saveAdvertmethod to includecondition. - Added
setConditionmethod.
- Added
-
lib/features/advertisement/widgets/advert_form.dart- Imported
advert.dart. - Updated variable name
controllertoctrl. - Added UI components to select product condition.
- Updated form fields to use
ctrl.
- Imported
-
lib/features/base/base_controller.dart- Updated
searchproperty to useapp.search. - Updated
setSearchmethod to useapp.search.
- Updated
-
lib/features/filters/filters_controller.dart- Imported
advert.dart. - Updated
advertiserproperty 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
filterproperty toHomeController. - Updated
searchproperty 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
getAdvertisementsmethod to fetch ads based on filter and search criteria. - Updated
savemethod to includecondition. - Updated
_parserServerToAdSalemethod to parsecondition.
- Added
-
lib/repository/constants.dart- Added
keyAdvertConditionconstant.
- Added
-
lib/repository/user_repository.dart- Commented out
typeproperty setting and retrieval inUserRepository.
- Commented out
-
lib/features/home/home_screen.dart- Updated the floating action button to fetch advertisements using the new
filterproperty inHomeController. - Updated the navigation to the
FiltersScreento pass and receive the updatedfilterproperty.
- Updated the floating action button to fetch advertisements using the new
-
lib/repository/advert_repository.dart- Added filtering logic in
getAdvertisementsto considerProductCondition. - Ensured all advertisement-related operations include the new
conditionproperty. - Updated parsing logic to correctly handle
conditionvalues 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.dartforlistEquals. - Added
minPriceandmaxPricetoFilterModel. - Modified the constructor to initialize
state,city,sortBy,advertiser,mechanicsId,minPrice, andmaxPricewith default values. - Added
isEmptygetter to check if the filter is empty. - Overrode
toString,==, andhashCodeto includeminPriceandmaxPrice.
- Imported
-
lib/components/custon_field_controllers/currency_text_controller.dart
- Added
decimalDigitsparameter to control the number of decimal places. - Updated
_formatterto usecurrencyinstead ofsimpleCurrency. - Updated
_applyMaskandcurrencyValuemethods to use_getDivisionFactor. - Added
_getDivisionFactormethod to calculate the division factor based ondecimalDigits.
- Added
-
lib/features/filters/filters_controller.dart
- Imported
filter.dartandcurrency_text_controller.dart. - Added
minPriceControllerandmaxPriceControllerfor handling price input. - Updated
initmethod to accept an optionalFilterModel. - Added
setInitialValuesmethod to set initial values for the filter. - Updated
submitStateandsubmitCitymethods to handle exceptions. - Updated
mechUpdateNamesmethod to use_joinMechNames. - Removed unnecessary log statements.
- Imported
-
lib/features/filters/filters_screen.dart
- Updated constructor to accept a
FilterModel. - Updated
initStateto callctrl.initwith the provided filter. - Updated
_sendFiltermethod 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
focusNodeparameter 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
onGenerateRouteto pass theFilterModelto theFiltersScreen.
- Updated
-
lib/features/filters/filters_screen.dart
- Enhanced the
FiltersScreenUI 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
FilterModelhandling 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
HomeControllerby 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
FilterModelinstances 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_upanddocker_down). - Commands for Flutter clean (
flutter_clean). - Commands for Git operations (
git_cached,git_commit, andgit_push).
- Commands to manage Docker (
-
Added
FilterModelinlib/common/models/filter.dart:- Modeling filters for advertisements.
-
Refactored file and class names:
- Renamed
lib/common/models/uf.darttolib/common/models/state.dartand updated class name fromUFModeltoStateBrModel.
- Renamed
-
Added
SearchHistorysingleton inlib/common/singletons/search_history.dart:- Manages search history with SharedPreferences.
-
Added
TextStylesinlib/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
BaseControllerandBaseScreen:- Added search functionality and integrated
SearchDialog.
- Added search functionality and integrated
-
Added
SearchDialogControllerandSearchDialogwidget:- Manages search functionality and history display.
-
Added
FiltersControllerandFiltersScreen:- 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.yamlversion to 0.3.2+8. -
Updated
home_screen.dart:- Integrated
HomeControllerfor state management. - Added segmented buttons for mechanics and filter selection.
- Implemented navigation to
MecanicsScreenandFiltersScreen.
- Integrated
-
Added
home_controller.dartandhome_state.dart:- Managed home screen state and mechanics selection.
-
Updated
main.dart:- Initialized
SearchHistoryduring 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
IbgeRepositoryinibge_repository_test.dart:- Ensured correct functionality for state and city retrieval.
-
Refactored
home_screen.dart:- Integrated
HomeControllerfor managing the state. - Added segmented buttons for mechanics and filter selection.
- Implemented navigation to
MecanicsScreenandFiltersScreen.
- Integrated
-
Added
home_controller.dartandhome_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
SearchHistoryduring 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
FiltersScreento integrate the new filter functionality into the app's navigation.
- Added a route for
-
Updated
ibge_repository.dart:- Renamed methods to use
StateBrModelinstead of the previousUFModel, ensuring consistency with the updated data models.
- Renamed methods to use
-
Added tests for
IbgeRepositoryinibge_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
nameFromIdandnamesFromIdListfor 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
TextStylesclass to manage text styles across the app. - Simplified text styling management and ensured consistency in text appearance.
- Defined a centralized
-
Added
search_controller.dartandsearch_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.dartandbase_screen.dart:- Integrated search functionality into the base screen.
- Improved navigation and state management within the base screen.
-
Refactored
filters_controller.dartandfilters_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+8to 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.dartandhome_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.dartandsearch_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
StateBrModelinstead 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
SearchHistorysingleton. - Ensured all necessary initializations are done before the app runs.
- Added initialization for the
-
Incremented
pubspec.yamlversion 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
CategoryModeltoMechanicModel.
- Renamed
-
lib/components/custon_field_controllers/currency_text_controller.dart
- Added
currencyValuegetter to parse the text into a double.
- Added
-
lib/features/advertisement/advert_controller.dart
- Replaced
CategoryModelwithMechanicModel. - Added
AdvertStatefor 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
BaseScreenupon 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
selectedMechIdsfor mechanics selection.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated navigation to
AdvertScreenreflecting new changes.
- Updated navigation to
-
lib/features/mecanics/mecanics_screen.dart
- Replaced
categorieswithmechanics. - Updated route name and method names to reflect mechanics instead of categories.
- Replaced
-
lib/manager/mechanics_manager.dart
- Replaced
CategoryModelwithMechanicModel.
- 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
AddressManagerfor 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
AddressRepositorywithAddressManagerfor managing addresses. - Removed
_loadAddressesmethod, addedaddressByNameandsaveAddressmethods.
- Replaced
-
lib/features/address/address_controller.dart
- Simplified
AddressControllerto 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
NewAddressScreenfor 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.addressByNamefor 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
NewAddressControllerfor 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
NewAddressControllerfor 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
onGenerateRouteto handle new address route.
- Added route for
-
lib/repository/address_repository.dart
- Simplified
saveAddressmethod. - Added
deletemethod for removing addresses. - Updated error handling and logging.
- Simplified
-
lib/repository/constants.dart
- Updated
keyAddressTableto'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 ==andhashCodemethods toAddressModelfor 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
AddressValidatorfor validating various address fields. - Enhanced
Validator.zipCodeto clean and validate the zip code correctly.
- Added
-
lib/components/form_fields/custom_form_field.dart
- Added
textCapitalizationproperty toCustomFormField.
- Added
-
lib/components/form_fields/dropdown_form_field.dart
- Added
textCapitalizationandonSelectedproperties toDropdownFormField.
- Added
-
lib/features/advertisement/widgets/advert_form.dart
- Added
textCapitalizationproperty toAdvertForm.
- Added
-
lib/features/address/address_controller.dart
- Enhanced
AddressControllerto manage addresses more efficiently. - Added methods for validation and setting the form from addresses.
- Included
zipFocusto manage focus on the zip code field.
- Enhanced
-
lib/features/address/address_screen.dart
- Updated
AddressScreento validate and save addresses upon leaving the screen. - Integrated
PopScopeto handle back navigation and save address changes.
- Updated
-
lib/features/address/widgets/address_form.dart
- Updated
AddressFormto useAddressValidator. - Added logic to initialize address types from
CurrentUser.
- Updated
-
lib/features/advertisement/advertisement_controller.dart
- Renamed
AdvertisementControllertoAdvertController. - Updated methods for address handling and validation.
- Renamed
-
lib/features/advertisement/advertisement_screen.dart
- Renamed
AdvertisementScreentoAdvertScreen.
- Renamed
-
lib/features/advertisement/widgets/advertisement_form.dart
- Renamed
AdvertisementFormtoAdvertForm. - Updated address selection logic.
- Renamed
-
lib/features/advertisement/widgets/image_list_view.dart
- Updated to use
AdvertControllerinstead ofAdvertisementController.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated route for
AdvertScreen.
- Updated route for
-
lib/features/mecanics/mecanics_screen.dart
- Updated
MecanicsScreento 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
AdRepositorytoAdvertRepository.
- Renamed
-
lib/repository/address_repository.dart
- Enhanced
saveAddressmethod to handle address name uniqueness per user. - Added
_getAddressByNameto fetch addresses by name. - Improved error handling and logging.
- Enhanced
-
lib/repository/constants.dart
- Updated
keyAddressTableto'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 ==andhashCodemethods toAddressModelfor 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
AddressValidatorfor validating various address fields. - Improved
Validator.zipCodeto clean and validate the zip code correctly.
- Added
-
lib/components/form_fields/custom_form_field.dart
- Added
textCapitalizationproperty toCustomFormField.
- Added
-
lib/components/form_fields/dropdown_form_field.dart
- Added
textCapitalizationandonSelectedproperties toDropdownFormField.
- Added
-
lib/features/address/address_controller.dart
- Enhanced
AddressControllerto manage addresses more efficiently. - Added methods for validation and setting the form from addresses.
- Added
zipFocusto manage focus on the zip code field.
- Enhanced
-
lib/features/address/address_screen.dart
- Updated
AddressScreento validate and save addresses upon leaving the screen. - Included
PopScopeto handle back navigation.
- Updated
-
lib/features/address/widgets/address_form.dart
- Updated
AddressFormto useAddressValidator. - Added logic to initialize address types from
CurrentUser.
- Updated
-
lib/features/advertisement/advertisement_controller.dart
- Renamed
AdvertisementControllertoAdvertController. - Updated methods for address handling and validation.
- Renamed
-
lib/features/advertisement/advertisement_screen.dart
- Renamed
AdvertisementScreentoAdvertScreen.
- Renamed
-
lib/features/advertisement/widgets/advertisement_form.dart
- Renamed
AdvertisementFormtoAdvertForm. - Updated address selection logic.
- Renamed
-
lib/features/advertisement/widgets/image_list_view.dart
- Updated to use
AdvertControllerinstead ofAdvertisementController.
- Updated to use
-
lib/features/base/base_screen.dart
- Updated route for
AdvertScreen.
- Updated route for
-
lib/features/mecanics/mecanics_screen.dart
- Updated
MecanicsScreento 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
AdRepositorytoAdvertRepository.
- Renamed
-
lib/repository/address_repository.dart
- Enhanced
saveAddressmethod to handle address name uniqueness per user. - Added
_getAddressByNameto fetch addresses by name. - Improved error handling and logging.
- Enhanced
-
lib/repository/constants.dart
- Updated
keyAddressTableto'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
AddressModelto handle address-related data. - Implemented methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson). - Added a
toStringmethod for debugging and logging purposes.
- Created a new
-
lib/common/models/category.dart:
- Renamed
CategoryModeltoMechanicModel. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created a new
CityModelto represent city data. - Included methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson). - Added a
toStringmethod for debugging and logging purposes.
- Created a new
-
lib/common/models/uf.dart:
- Created
RegionModelandUFModelto represent region and state data. - Included methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson). - Added
toStringmethods for debugging and logging purposes.
- Created
-
lib/common/models/user.dart:
- Added serialization and deserialization methods (
toMap,fromMap,toJson,fromJson). - Implemented a
copyFromUserModelmethod for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created a new
ViaCEPAddressModelto handle address data from the ViaCEP API. - Included methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson). - Added a
toStringmethod 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
CurrentUsersingleton 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
focusNodeproperty to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUserfor login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUserfor displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly,suffixIcon, anderrorTextproperties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatterto format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressControllerto 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
AddressScreento provide a UI for managing user addresses. - Integrated with
AddressControllerto 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
AddressModelto manage address-related data. - Implemented methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson).
- Created
-
lib/common/models/category.dart:
- Renamed
CategoryModeltoMechanicModel. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created
CityModelto represent city data. - Included methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson).
- Created
-
lib/common/models/uf.dart:
- Created
RegionModelandUFModelto 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
copyFromUserModelmethod for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created
ViaCEPAddressModelto 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
CurrentUsersingleton 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
focusNodeproperty to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUserfor login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUserfor displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly,suffixIcon, anderrorTextproperties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatterto format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressControllerto 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
AddressScreento provide a UI for managing user addresses. - Integrated with
AddressControllerto 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
InsertControllerwith 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
CurrentUserfor managing login state.
- Updated to use
-
lib/features/mecanics/mecanics_screen.dart:
- Created a new
MecanicsScreento handle mechanic selection.
- Created a new
-
lib/main.dart:
- Updated main entry point to initialize
CurrentUserand other managers. - Added new routes for address and mechanic screens.
- Updated main entry point to initialize
-
lib/manager/mechanics_manager.dart:
- Created
MechanicsManagerto manage mechanic data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/manager/uf_manager.dart:
- Created
UFManagerto 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
AddressRepositoryto 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
IbgeRepositoryto 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
AddressModelto manage address-related data. - Implemented methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson).
- Created
-
lib/common/models/category.dart:
- Renamed
CategoryModeltoMechanicModel. - Updated class references to reflect the new name.
- Renamed
-
lib/common/models/city.dart:
- Created
CityModelto represent city data. - Included methods for serialization and deserialization (
toMap,fromMap,toJson,fromJson).
- Created
-
lib/common/models/uf.dart:
- Created
RegionModelandUFModelto 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
copyFromUserModelmethod for cloning user instances.
- Added serialization and deserialization methods (
-
lib/common/models/viacep_address.dart:
- Created
ViaCEPAddressModelto 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
CurrentUsersingleton 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
focusNodeproperty to manage focus state for the button.
- Added
-
lib/components/custom_drawer/custom_drawer.dart:
- Updated to use
CurrentUserfor login status checks.
- Updated to use
-
lib/components/custom_drawer/widgets/custom_drawer_header.dart:
- Updated to use
CurrentUserfor displaying user information.
- Updated to use
-
lib/components/form_fields/custom_form_field.dart:
- Added
readOnly,suffixIcon, anderrorTextproperties to enhance form field functionality.
- Added
-
lib/components/others_widgets/custom_input_formatter.dart:
- Created a new
CustomInputFormatterto format text input based on a provided mask.
- Created a new
-
lib/features/address/address_controller.dart:
- Created a new
AddressControllerto 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
AddressScreento provide a UI for managing user addresses. - Integrated with
AddressControllerto 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
InsertControllerwith 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
CurrentUserfor managing login state.
- Updated to use
-
lib/features/mecanics/mecanics_screen.dart:
- Created a new
MecanicsScreento handle mechanic selection.
- Created a new
-
lib/main.dart:
- Updated main entry point to initialize
CurrentUserand other managers. - Added new routes for address and mechanic screens.
- Updated main entry point to initialize
-
lib/manager/mechanics_manager.dart:
- Created
MechanicsManagerto manage mechanic data. - Implemented methods for initialization and data retrieval.
- Created
-
lib/manager/uf_manager.dart:
- Created
UFManagerto 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
AddressRepositoryto 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
IbgeRepositoryto 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
ViacepRepositoryto 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
httpandshared_preferencesto support address and data handling.
- Added new dependencies for
-
test/repository/ibge_repository_test.dart:
- Added tests for
IbgeRepositoryto 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
InsertFormto handle user inputs. - Added
InsertControlleras a required parameter for managing form data. - Implemented
CustomFormFieldcomponents for title and description inputs withlabelText,fullBorder, andfloatingLabelBehaviorproperties. - Added a
DropdownButtonFormFieldfor category selection with predefined items. - Included a
ValueNotifier<bool>namedhidePhoneto manage the visibility of the phone number input. - Overridden the
disposemethod to properly dispose of theValueNotifier.
- Created a new stateful widget
-
pubspec.yaml:
- Added
intl: ^0.19.0for internationalization support. - Added
image_picker: ^1.1.2to enable image selection from the device. - Added
image_cropper: ^4.0.1for 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
FileSelectorWindowsplugin 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.