@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
- if (viewModel.isLoading) {
65
- return const Center(child: CircularProgressIndicator());
66
- }
67
- if (viewModel.errorMessage.isNotEmpty) {
68
- return Center(child: Text(viewModel.errorMessage));
69
- }
70
- return Column(
71
- children: [
72
- _buildFilters(context, viewModel),
73
- Expanded(
74
- child: SingleChildScrollView(
75
- child: ResponsiveHorizontalScroll(
76
- child: DataTable(
77
- columns: const [
78
- DataColumn(label: Text('Select')),
79
- DataColumn(label: Text('Date')),
80
- DataColumn(label: Text('Category')),
81
- DataColumn(label: Text('Subcategory')),
82
- DataColumn(label: Text('Method')),
83
- DataColumn(label: Text('Amount')),
84
- DataColumn(label: Text('Description')),
85
- DataColumn(label: Text('Paid')), // Added Paid column
86
- DataColumn(label: Text('Actions')),
87
- ],
88
- rows: viewModel.transactions.map((transaction) {
89
- return DataRow(
90
- selected: viewModel.selectedTransactionIds
91
- .contains(transaction.id),
92
- onSelectChanged: (isSelected) {
93
- viewModel
94
- .toggleTransactionSelection(transaction.id);
95
- },
96
- cells: [
97
- DataCell(Checkbox(
98
- value: viewModel.selectedTransactionIds
99
- .contains(transaction.id),
100
- onChanged: (isSelected) {
101
- viewModel
102
- .toggleTransactionSelection(transaction.id);
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
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcos_feitoza/personal-finance-frontend-feature-management",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },