Updates from idk when...
This commit is contained in:
+2
-1
@@ -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(),
|
||||
]);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user