Conversation
| @override | ||
| Future<Transaction> getTransactionDetails(int id) async { | ||
| throw UnimplementedError('getTransactionDetails not implemented'); | ||
| Future<Transaction> getTransactionDetails(String id) async { |
There was a problem hiding this comment.
consider using our Result class we created for error handling, you can find an example for its usage in LoginCubit, to unify our work for error handling
| final client = await service.getClient(); | ||
|
|
||
| final response = await client.rpc( | ||
| 'delete_transaction', |
There was a problem hiding this comment.
please consider extracting rpc functions names to constants, since it might be used in another functin
| 'delete_transaction', | ||
| params: {'p_id': id}, | ||
| ); | ||
| print("respinse of deleting is : $response"); |
There was a problem hiding this comment.
please remove the print statement
| cubit.deleteTransaction().then((success) { | ||
| if (success) { | ||
| MSnackBar.success( | ||
| message: "Transaction deleted successfully", |
There was a problem hiding this comment.
please use localization
| return Transaction( | ||
| id: 0, | ||
| amount: (data['amount'] as num).toDouble(), | ||
| currency: await _getCurrencyAbbreviation(data['currency_id'] as int), |
There was a problem hiding this comment.
you can use join on backend to retrive what you need
| ); | ||
| } | ||
|
|
||
| Future<String> _getCurrencyAbbreviation(int currencyId) async { |
There was a problem hiding this comment.
no need for this function
| return response['abbreviation'] as String; | ||
| } | ||
|
|
||
| Future<String> _getCategoryName(String categoryId) async { |
There was a problem hiding this comment.
same , use join delegate all of this to the backend
|
great work yousef i please consider my notes |
No description provided.