dev_bloc #1

Merged
Sanders merged 35 commits from dev_bloc into master 2025-07-13 00:17:45 +03:00
Owner
No description provided.
Sanders added 35 commits 2025-07-13 00:17:37 +03:00
- Adds new localization keys for transaction details.
- Deletes obsolete localization files, switching to a single ARB file per language.
- Adds `Equatable` to data models (`Category`, `Tag`, `TransactionRecord`, `User`) for improved state management and change detection.
- Introduces the transaction creation dialog.
- Adds development note to GEMINI.md

Improves internationalization and data models

- Adds new localization keys for transaction details, supporting enhanced user experience.
- Migrates to single ARB file for each language, streamlining the localization process.
- Implements Equatable in data models (Category, Tag, TransactionRecord, User) for improved state management and simplified change detection.
- Introduces transaction creation dialog, simplifying the transaction creation process.
- Adds development note to GEMINI.md
Initializes internationalization (i18n) for the application.

Introduces `AppLocalizations` to manage localized strings, along with
English and Russian translations.

Configures Flutter to use the localization delegates and supported locales.
This allows the app to display text in the user's preferred language.
Adds a tag selection to transaction dialog and refines the display of transactions.

The changes introduce the ability to tag transactions, improving categorization and filtering.
It also modifies the transaction input dialog to include time, as well as refines the appearance of transaction items on the home page by using a custom widget wrapped in a card.

The UI of the summary widget is also improved by using theme colors and increasing the overall visibility.
Implements SMS reading functionality to automatically track expenses.

- Adds necessary permissions for reading SMS messages in AndroidManifest.xml.
- Registers SmsService and SmsCubit in the dependency injection container.
- Adds a new SMS page to the bottom navigation bar.
- Introduces new localization strings for the SMS page title and permission denied message.
- Sets minSdk to 23.
Adds the ability to manage categories in the settings page. This includes:
- Registers CategoryCubit in the dependency injection container.
- Introduces a new CategoryListPage for editing categories.
- Adds translations for category management related text.
- Adds unselected icon color to the theme.
- Updates the date format in the transaction dialog.
Implements category type selection (income/expense) during category creation/editing.

This enhancement introduces a switch to define categories as either income or expense, providing more granular control over financial tracking.
It also includes localization support for new strings ("Icon", "Category type", "Add category").
A random color and icon are assigned to new categories for better user experience.
Finally, uses AnimatedList for categories in the list page.
Implements the ability to load and process SMS messages to automatically create transaction records.

This includes:
- Adding an `SmsMessage` model and Hive adapter.
- Creating an `ISmsMessageRepository` and its Hive implementation.
- Integrating SMS loading functionality into the `SmsCubit`.
- Adding a UI element in settings to trigger SMS loading.
- Persisting last SMS sync time in user preferences.
This commit refactors the user management system to utilize UserCubit, improving state management and separation of concerns.

- Replaces UserService with UserCubit for managing user state.
- Introduces AppSettings and GlobalSettings models and repositories for managing app-level settings and configurations.
- Modifies dependency injection to register the new repositories and cubits.
- Updates UI components (LoginPage, SettingsPage, HomePage, AddTransactionDialog, CategoryListPage, TagListPage) to interact with UserCubit and SettingsCubit.
- Removes direct dependency on UserRepository in favor of UserCubit for accessing user information.
- Streamlines the authentication process by using UserCubit to handle user creation and login.
- Improves settings management by using dedicated repositories and cubits for app settings.
Ensures SMS messages are associated with a specific user by adding a `userId` field to the `SmsMessage` model and passing the user ID when retrieving SMS messages.

This change ensures that SMS messages are correctly linked to the user they belong to, which is necessary for filtering and displaying the appropriate messages. It retrieves the user ID from the `UserCubit` state. Handles the case where the user state is not loaded, emitting an error state.
Adds the necessary classes and configurations to store and retrieve SMS handler settings using Hive database.

This includes registering the `SmsHandlerSettings` model, its adapter, and related enum adapters with Hive, opening a new box for storing settings and making it accessible via `HiveService`. Additionally, this change registers a new repository for accessing sms handler settings data.
Improves the management of Hive boxes by introducing separate initialization for global and user-specific data.

This change enhances data isolation and allows for dynamic dependency injection based on the authentication state. It introduces `initGlobalDependencies` and `initUserSpecificDependencies` to manage the application's dependencies. User-scoped repositories and cubits are now registered/unregistered upon login/logout. The UserCubit is updated to allow dynamic injection of user-specific repositories after authentication. The TagCubit is refactored to use a repository.
This commit refactors the data repositories to remove user-specific filtering. It simplifies the data access logic by retrieving all data from the Hive boxes and removing the need to filter by `userId` in the repository methods.

This change makes the app function in single-user mode and removes the need to manage multiple user contexts within the data layer.

Specifically:
- Removes `userId` parameter from repository methods.
- Updates the setting repository to use fixed keys.
- Removes user ID filtering from queries.
- Removes user ID parameters from Cubits and Blocs
- Updates initial data creation
Removes the now-unnecessary user-specific methods from the category and tag repositories. The repositories are now user-specific at the box level, so filtering by user ID within the repository methods is redundant.

Also, removes now-unused imports related to user logic in category and tag list pages, and the add transaction dialog.
This commit implements a complete authentication flow, including user registration.

- Introduces an `AuthRegisterRequested` event to handle user registration.
- Persists the user ID in settings upon successful authentication.
- Modifies `AuthBloc` to load the user based on the stored ID, improving app launch persistence.
- Refactors `UserCubit` to only manage the user state and removes authentication logic.
- Removes `UserCubit` initialization from `main.dart` and triggers `AuthStarted` to initiate the authentication process.
Adds a popup menu to SMS messages to allow access to processing settings.

This commit introduces the "Processing settings" option within a context menu
that appears when an SMS message is tapped. This prepares the UI for future
implementation of SMS processing configuration.
Enhances the SMS message widget to provide a richer user experience.

Adds sender information, formatted date, message processing status and actions.
Includes localization support for new UI elements.
Sanders merged commit 9b584a8169 into master 2025-07-13 00:17:45 +03:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sanders/BudgetApp#1