@marcos_feitoza/personal-finance-frontend-feature-management 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.0.4](https://github.com/MarcosOps/personal-finance-frontend-feature-management/compare/v1.0.3...v1.0.4) (2026-01-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Padronizar mensagens de erro e estados de loading ([039757d](https://github.com/MarcosOps/personal-finance-frontend-feature-management/commit/039757d6c16a0f521aad7a653cd4b907eef94177))
|
|
7
|
+
|
|
1
8
|
## [1.0.3](https://github.com/MarcosOps/personal-finance-frontend-feature-management/compare/v1.0.2...v1.0.3) (2026-01-30)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
|
|
|
4
4
|
import '../viewmodels/manage_transactions_viewmodel.dart';
|
|
5
5
|
import 'package:personal_finance_frontend_core_ui/widgets/edit_transaction_dialog.dart';
|
|
6
6
|
import 'package:personal_finance_frontend_core_ui/widgets/app_widgets.dart';
|
|
7
|
+
import 'package:personal_finance_frontend_core_ui/widgets/app_async_state_view.dart';
|
|
7
8
|
import 'package:personal_finance_frontend_core_ui/utils/app_responsive.dart';
|
|
8
9
|
import 'package:personal_finance_frontend_core_services/models/payment_method.dart';
|
|
9
10
|
import 'package:personal_finance_frontend_core_services/providers/auth_provider.dart';
|
|
@@ -61,85 +62,94 @@ class ManageTransactionsScreen extends StatelessWidget {
|
|
|
61
62
|
),
|
|
62
63
|
body: Consumer<ManageTransactionsViewModel>(
|
|
63
64
|
builder: (context, viewModel, child) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
)),
|
|
105
|
-
DataCell(Text(DateFormat('yyyy-MM-dd')
|
|
106
|
-
.format(transaction.date))),
|
|
107
|
-
DataCell(Text(transaction.category)),
|
|
108
|
-
DataCell(Text(transaction.subcategory)),
|
|
109
|
-
DataCell(Text(transaction.paymentMethod)),
|
|
110
|
-
DataCell(Text(NumberFormat.currency(
|
|
111
|
-
locale: 'en_CA', symbol: '\$')
|
|
112
|
-
.format(transaction.amount))),
|
|
113
|
-
DataCell(Text(transaction.description)),
|
|
114
|
-
DataCell(Switch( // Added Switch for Paid status
|
|
115
|
-
value: transaction.isPaid,
|
|
116
|
-
onChanged: (bool newValue) {
|
|
117
|
-
print('Switch onChanged: transaction.id=${transaction.id}, newValue=$newValue'); // Added log
|
|
118
|
-
viewModel.updateTransactionPaidStatus(transaction.id, newValue);
|
|
119
|
-
},
|
|
120
|
-
)),
|
|
121
|
-
DataCell(IconButton(
|
|
122
|
-
icon: const Icon(Icons.edit),
|
|
123
|
-
onPressed: () {
|
|
124
|
-
showDialog(
|
|
125
|
-
context: context,
|
|
126
|
-
builder: (BuildContext context) {
|
|
127
|
-
return EditTransactionDialog(
|
|
128
|
-
transaction: transaction,
|
|
129
|
-
viewModel: viewModel,
|
|
130
|
-
);
|
|
65
|
+
return AppAsyncStateView(
|
|
66
|
+
isLoading: viewModel.isLoading,
|
|
67
|
+
errorMessage:
|
|
68
|
+
viewModel.errorMessage.isEmpty ? null : viewModel.errorMessage,
|
|
69
|
+
onRetry: viewModel.fetchTransactions,
|
|
70
|
+
child: Column(
|
|
71
|
+
children: [
|
|
72
|
+
_buildFilters(context, viewModel),
|
|
73
|
+
Expanded(
|
|
74
|
+
child: viewModel.transactions.isEmpty
|
|
75
|
+
? const Center(
|
|
76
|
+
child: Padding(
|
|
77
|
+
padding: EdgeInsets.all(16.0),
|
|
78
|
+
child: Text(
|
|
79
|
+
'No transactions found for the selected filters.',
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
: SingleChildScrollView(
|
|
84
|
+
child: ResponsiveHorizontalScroll(
|
|
85
|
+
child: DataTable(
|
|
86
|
+
columns: const [
|
|
87
|
+
DataColumn(label: Text('Select')),
|
|
88
|
+
DataColumn(label: Text('Date')),
|
|
89
|
+
DataColumn(label: Text('Category')),
|
|
90
|
+
DataColumn(label: Text('Subcategory')),
|
|
91
|
+
DataColumn(label: Text('Method')),
|
|
92
|
+
DataColumn(label: Text('Amount')),
|
|
93
|
+
DataColumn(label: Text('Description')),
|
|
94
|
+
DataColumn(label: Text('Paid')),
|
|
95
|
+
DataColumn(label: Text('Actions')),
|
|
96
|
+
],
|
|
97
|
+
rows: viewModel.transactions.map((transaction) {
|
|
98
|
+
return DataRow(
|
|
99
|
+
selected: viewModel.selectedTransactionIds
|
|
100
|
+
.contains(transaction.id),
|
|
101
|
+
onSelectChanged: (isSelected) {
|
|
102
|
+
viewModel.toggleTransactionSelection(
|
|
103
|
+
transaction.id);
|
|
131
104
|
},
|
|
105
|
+
cells: [
|
|
106
|
+
DataCell(Checkbox(
|
|
107
|
+
value: viewModel.selectedTransactionIds
|
|
108
|
+
.contains(transaction.id),
|
|
109
|
+
onChanged: (isSelected) {
|
|
110
|
+
viewModel.toggleTransactionSelection(
|
|
111
|
+
transaction.id);
|
|
112
|
+
},
|
|
113
|
+
)),
|
|
114
|
+
DataCell(Text(DateFormat('yyyy-MM-dd')
|
|
115
|
+
.format(transaction.date))),
|
|
116
|
+
DataCell(Text(transaction.category)),
|
|
117
|
+
DataCell(Text(transaction.subcategory)),
|
|
118
|
+
DataCell(Text(transaction.paymentMethod)),
|
|
119
|
+
DataCell(Text(NumberFormat.currency(
|
|
120
|
+
locale: 'en_CA', symbol: '\$')
|
|
121
|
+
.format(transaction.amount))),
|
|
122
|
+
DataCell(Text(transaction.description)),
|
|
123
|
+
DataCell(Switch(
|
|
124
|
+
value: transaction.isPaid,
|
|
125
|
+
onChanged: (bool newValue) {
|
|
126
|
+
viewModel.updateTransactionPaidStatus(
|
|
127
|
+
transaction.id, newValue);
|
|
128
|
+
},
|
|
129
|
+
)),
|
|
130
|
+
DataCell(IconButton(
|
|
131
|
+
icon: const Icon(Icons.edit),
|
|
132
|
+
onPressed: () {
|
|
133
|
+
showDialog(
|
|
134
|
+
context: context,
|
|
135
|
+
builder: (BuildContext context) {
|
|
136
|
+
return EditTransactionDialog(
|
|
137
|
+
transaction: transaction,
|
|
138
|
+
viewModel: viewModel,
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
)),
|
|
144
|
+
],
|
|
132
145
|
);
|
|
133
|
-
},
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
)
|
|
137
|
-
}).toList(),
|
|
138
|
-
),
|
|
139
|
-
),
|
|
146
|
+
}).toList(),
|
|
147
|
+
),
|
|
148
|
+
),
|
|
149
|
+
),
|
|
140
150
|
),
|
|
141
|
-
|
|
142
|
-
|
|
151
|
+
],
|
|
152
|
+
),
|
|
143
153
|
);
|
|
144
154
|
},
|
|
145
155
|
),
|