Updates from idk when...

This commit is contained in:
Nathan Anderson
2023-08-17 13:34:30 -06:00
parent 6fae83674b
commit 1d1b5f0620
18 changed files with 614 additions and 161 deletions
+2 -1
View File
@@ -54,7 +54,7 @@ final apiProvider = StateNotifierProvider<_ApiNotifier, Dio>((ref) {
class _ApiNotifier extends StateNotifier<Dio> {
_ApiNotifier(this.ref, this.dio) : super(dio) {
// dio.options.baseUrl = "https://fe7d-136-36-2-234.ngrok-free.app";
// dio.options.baseUrl = "https://af70-136-36-2-234.ngrok-free.app/";
// dio.options.baseUrl = "http://localhost:8081/";
dio.options.baseUrl = "https://rluv.fosscat.com/";
dio.interceptors.addAll([
@@ -93,6 +93,7 @@ class _ApiNotifier extends StateNotifier<Dio> {
if (err.response?.statusCode == 403) {
ref.read(jwtProvider.notifier).revokeToken();
}
return handler.next(err);
}),
_LoggingInterceptor(),
]);
+22
View File
@@ -189,4 +189,26 @@ class DashBoardStateNotifier extends StateNotifier<Map<String, dynamic>?> {
break;
}
}
void removeWithId(String stateKey, int id) {
if (state == null) {
printPink('Cant remove data, state is null');
return;
}
switch (stateKey) {
case 'transactions':
case 'budget_categories':
case 'shared_noted':
final subStateList = state![stateKey] as List<dynamic>;
final newState = state;
subStateList
.removeWhere((e) => (e as Map<String, dynamic>)['id'] == id);
newState![stateKey] = subStateList;
state = {...newState};
// printBlue(state);
break;
default:
break;
}
}
}
+3
View File
@@ -59,6 +59,9 @@ class Styles {
contentPadding:
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
labelText: labelText,
errorStyle: const TextStyle(
color: Styles.expensesRed,
),
focusColor: Styles.blushingPink,
hoverColor: Styles.blushingPink,
fillColor: Styles.lavender,