89 Commits
Author SHA1 Message Date
Sanders 4e27dbf2ee fix 2025-05-12 16:06:22 +03:00
Sanders b3fd06f37b chore: обновить зависимость flutter_web_auth до версии 0.6.0 2025-05-12 13:46:36 +03:00
Sanders 2f46e7a554 feat: добавить импорт TelegramAuth в ProfileScreen 2025-05-12 13:43:51 +03:00
Sanders d90a3aef16 feat: Добавить зависимости для аутентификации и локального хранилища 2025-05-12 13:42:33 +03:00
Sanders ed77c948d7 feat: Добавить сохранение данных пользователя после логина через Telegram 2025-05-12 13:39:00 +03:00
Sanders 2ac3f27d64 feat: добавить возможность логина через Telegram 2025-05-12 13:35:07 +03:00
Sanders beb7e62d91 feat: Добавить поддержку userId в транзакциях и диалогах редактирования 2025-05-12 13:24:45 +03:00
Sanders 5a682ea4c6 feat: добавить ссылку на пользователя для категорий и транзакций 2025-05-12 13:23:08 +03:00
Sanders b20e751437 feat: добавить сущность пользователь в базу данных 2025-05-12 13:20:40 +03:00
Sanders 7f6e608ff1 fix: Reduce minWidth of ToggleButtons in edit dialog 2025-05-09 00:19:39 +03:00
Sanders 3931c76623 feat: Add long press menu for transactions with edit/delete options 2025-05-09 00:16:42 +03:00
Sanders 84dec567e0 refactor: Assign specific colors to initial categories 2025-05-09 00:00:12 +03:00
Sanders 3545dfacd7 fix: Use category color from DB when editing 2025-05-08 23:56:53 +03:00
Sanders 184cc82469 feat: Use available colors for initial categories 2025-05-08 23:35:58 +03:00
Sanders 050153b5ec refactor: Use alias for Color and Colors 2025-05-08 23:35:56 +03:00
Sanders ddf3d45bf4 fix: Set default color to existing category color in edit dialog 2025-05-08 23:30:32 +03:00
Sanders cfec739c97 refactor: Fix super constructor call in MultiStreamBuilder 2025-05-08 23:28:01 +03:00
Sanders 0a6267ec3a feat: Add settings menu screen and rename category settings 2025-05-08 23:27:05 +03:00
Sanders d9c70c1bb6 feat: Navigate to Settings screen from bottom nav bar 2025-05-08 23:17:48 +03:00
Sanders 4fee4b7eda feat: add category update and delete methods 2025-05-05 14:47:42 +03:00
Sanders 28a7bd6ea7 feat: implement category settings screen 2025-05-05 14:43:44 +03:00
Sanders 024037a233 refactor: remove unused settop_component_outlined icon 2025-05-05 14:43:37 +03:00
Sanders a1f020b141 fix: make icon picker grid scrollable in dialog 2025-05-04 22:57:17 +03:00
Sanders 65e72dbe9c feat: add more icons and color selection for categories 2025-05-04 22:55:21 +03:00
Sanders 8ce8add138 feat: add icon picker to category dialog 2025-05-04 22:52:58 +03:00
Sanders 8c9196f67f feat: add getIconFromString utility and use it 2025-05-04 22:49:57 +03:00
Sanders c6d7018b4c feat: add category creation dialog and integration 2025-05-04 22:47:36 +03:00
Sanders a0f3c016fa fix: insert initial data exclusively in onCreate 2025-05-04 22:40:49 +03:00
Sanders f14cde0247 refactor: Rename Category table to Categories and fix references 2025-05-04 22:38:05 +03:00
Sanders c5da00c013 refactor: rename Categories table to Category 2025-05-04 22:37:57 +03:00
Sanders e90aa8c8cc Вот исправленный файл с правильными именами таблиц и полей. Основные изменения:
1. Переименовал класс `Categories` в `Category` для единообразия
2. Обновил имя таблицы с `categories` на `category` в запросах
3. Исправил имена полей для соответствия новым названиям
4. Обновил типы полей (например, `categoryName` на `categoryId`)

Теперь ошибка "no such table" не должна возникать, так как все имена таблиц и полей согласованы.

Хотите, чтобы я показал полный обновленный файл с исправлениями?
2025-05-04 22:32:59 +03:00
Sanders a4c6023483 fix 2025-05-04 22:16:43 +03:00
Sanders 119f86eecf child: Column(
children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      transaction.title,
                      style: theme.textTheme.subtitle1,
                    ),
                    Text(
                      formattedAmount,
                      style: theme.textTheme.subtitle1,
                    ),
                  ],
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      dateFormatter.format(transaction.date),
                      style: theme.textTheme.caption,
                    ),
                    Text(
                      transaction.categoryName,
                      style: theme.textTheme.caption,
                    ),
                  ],
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
diff --git a/finance_app/lib/widgets/transaction_list_item.dart b/finance_app/lib/widgets/transaction_list_item.dart
index 1a2b3c4..a49954e 100644
--- a/finance_app/lib/widgets/transaction_list_item.dart
+++ b/finance_app/lib/widgets/transaction_list_item.dart
@@ -1,4 +1,4 @@
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
 import 'package:intl/intl.dart';
 import 'package:finance_app/models/transaction.dart';
 import 'package:finance_app/utils/category_utils.dart';
@@ -18,10 +18,10 @@ class TransactionListItem extends StatelessWidget {
     final theme = Theme.of(context);
     final bool isIncome = transaction.type == 'income';

-    // Get category details ONLY for expense
-    final categoryDetails = !isIncome
-        ? CategoryUtils.getCategoryDetails(transaction.categoryName)
-        : null; // No specific category details needed for income display
+    // Get category details from the transaction's category reference
+    final categoryDetails = !isIncome && transaction.category != null
+        ? (iconCode: transaction.category!.iconCode, colorCode: transaction.category!.colorCode)
+        : null;

     // Format dates
     final dateFormatter = DateFormat.MMMd(); // e.g., Sep 10
@@ -51,8 +51,8 @@ class TransactionListItem extends StatelessWidget {
         : (isDark ? Colors.redAccent.shade100 : Colors.red.shade700); // Red for expense

     // Leading icon configuration
-    IconData leadingIconData = isIncome ? Icons.arrow_downward_rounded : (categoryDetails?.iconCode ?? Icons.error_outline); // Default icon for expense if details missing
-    Color leadingIconColor = isIncome ? amountColor : (categoryDetails?.colorCode ?? Colors.grey);
+    IconData leadingIconData = isIncome ? Icons.arrow_downward_rounded : (transaction.category?.iconCode ?? Icons.error_outline);
+    Color leadingIconColor = isIncome ? amountColor : (transaction.category?.colorCode ?? Colors.grey);
     Color leadingBackgroundColor = leadingIconColor.withOpacity(isDark ? 0.25 : 0.18);

     return Card(
refactor: update transaction list item to use category reference
2025-05-04 22:16:00 +03:00
Sanders 330cc4c14a refactor: remove categoryName from TransactionRecord and use category reference 2025-05-04 22:11:43 +03:00
Sanders 1deea23783 >> refactor: replace icon/color fields with category reference in TransactionRecord 2025-05-04 22:07:21 +03:00
Sanders 5a8bd79387 feat: add categories table to database 2025-05-04 21:44:11 +03:00
Sanders 010604ac6f fix: correct merchant column name and add null safety 2025-05-04 20:06:18 +03:00
Sanders 4e74cad421 # Commit message
refactor: Update transaction type handling in database and UI
2025-05-04 20:06:15 +03:00
Sanders 66ae257773 refactor: improve MultiStreamBuilder and snapshot handling 2025-05-04 16:43:21 +03:00
Sanders f411106154 (no commit message provided) 2025-05-04 16:38:29 +03:00
Sanders 49238fbded fix: improve snapshot handling and type safety in MultiStreamBuilder 2025-05-04 16:36:32 +03:00
Sanders 59265f53c2 (no commit message provided) 2025-05-04 16:16:22 +03:00
Sanders 7f8ed7245d fix: Explicitly type lambda parameter in snapshots.any 2025-05-04 16:08:12 +03:00
Sanders 7e3a759282 fix: resolve errors in MultiStreamBuilder and income display 2025-05-04 16:04:30 +03:00
Sanders 305f263735 fix: use column default for transaction type 2025-05-04 15:55:35 +03:00
Sanders ca522cde97 feat: add income tracking 2025-05-04 15:52:36 +03:00
Sanders d64211acb3 feat: allow specifying time when adding transaction 2025-05-04 15:46:12 +03:00
Sanders 8ab4288cda fix: Stop transaction list flicker during rebuilds 2025-05-04 15:40:52 +03:00
Sanders 7764ec092e fix: Prevent transaction list flicker on state change 2025-05-04 15:38:15 +03:00
Sanders a4d97db720 fix: remove duplicate category icon in add transaction form 2025-05-04 15:29:58 +03:00
Sanders c5cf706f38 feat: implement add transaction form via modal sheet 2025-05-04 15:12:09 +03:00
Sanders b9bf455631 refactor: Make SpendingPieChart stateful to prevent list flicker 2025-05-04 15:05:29 +03:00
Sanders b9bd506ee6 style: make transaction list items compact 2025-05-04 15:01:45 +03:00
Sanders d84778a5a7 style: reduce vertical spacing between transaction list items 2025-05-04 15:00:43 +03:00
Sanders f4ac8e0e56 refactor: Use ListTile for TransactionListItem layout 2025-05-04 14:59:34 +03:00
Sanders 42046b4e87 fix 2025-05-04 14:58:40 +03:00
Sanders 65299a0b00 Merge pull request 'dev' (#1) from dev into master
Reviewed-on: #1
2025-05-04 14:49:30 +03:00
Sanders 187fcf4abf fix: persist pie slice selection on tap 2025-05-04 14:39:18 +03:00
Sanders 034c405a29 feat: display category/total amount in pie chart center 2025-05-04 14:37:36 +03:00
Sanders dca892c8a0 fix: use default WebDatabase constructor for web connection 2025-05-04 13:19:27 +03:00
Sanders e7cc15872a fix: specify sqlite3.wasm URI for web database connection 2025-05-04 13:18:17 +03:00
Sanders 4f2e8ee1f2 fix 2025-05-04 13:16:44 +03:00
Sanders 411574fc21 fix: explicitly configure WASM path for web database connection 2025-05-04 13:16:22 +03:00
Sanders ea0393b609 fix: remove obsolete Drift WASM initialization for web 2025-05-04 13:14:21 +03:00
Sanders 3156802df6 fix: initialize Drift WASM module for web 2025-05-04 13:12:53 +03:00
Sanders c088933cef fix 2025-05-04 13:12:24 +03:00
Sanders 1153ed6f23 refactor: implement conditional imports for database connection 2025-05-04 13:09:06 +03:00
Sanders 1b97a921b2 fix: remove unnecessary drift_web dependency 2025-05-04 13:05:34 +03:00
Sanders 224e300419 feat: add web support for drift database 2025-05-04 12:54:16 +03:00
Sanders e1221210b7 fix 2025-05-04 10:58:56 +03:00
Sanders 027b9ff91e fix: Resolve type mismatch for TransactionListItem 2025-05-03 17:00:44 +03:00
Sanders d0e6feb874 refactor: update transaction type from TransactionRecord to Transaction 2025-05-03 17:00:39 +03:00
Sanders b78ed61661 fix: remove unused import causing type conflict in database 2025-05-03 16:36:46 +03:00
Sanders 56c4f76f5b fix 2025-05-03 16:33:14 +03:00
Sanders d63355a098 fix: implement Drift database definition 2025-05-03 16:26:52 +03:00
Sanders 3d5aa9f187 chore: replace database code with build command text 2025-05-03 16:26:19 +03:00
Sanders b9b70ad6ee fix: restore database definition code 2025-05-03 16:25:03 +03:00
Sanders 0f36753abc fix: fix database stream return types and clean up imports 2025-05-03 16:24:28 +03:00
Sanders 1b5048f958 refactor: make watchAllTransactions return nullable stream 2025-05-03 16:24:21 +03:00
Sanders b2df4b142c fix: correct rxdart import path 2025-05-03 16:16:58 +03:00
Sanders 1724d28baf feat: Implement Drift database for transaction management 2025-05-03 16:13:53 +03:00
Sanders 8089604139 feat: add Drift dependencies and basic database setup 2025-05-03 16:09:08 +03:00
Sanders 99b1e8bfb6 fix 2025-05-03 16:03:29 +03:00
Sanders 5e8d1e663c diff 2025-05-03 16:00:47 +03:00
Sanders fd059af9b6 diff 2025-05-03 15:57:17 +03:00
Sanders 110447590e fix: use FlTapUpEvent to reset pie chart selection 2025-05-03 14:49:11 +03:00
Sanders 6bae5b1b50 refactor: split main.dart into structured directories 2025-05-03 14:46:08 +03:00
Sanders b37510f489 Init 2025-05-03 14:40:48 +03:00
Sanders 1d95eeb5b6 Init 2025-05-03 14:40:35 +03:00