mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00

Added try-catch blocks for error handling in API's files to rethrow the errors to the cubit so cubits can update the UI based on them. Refactored error handling in HTTPInterceptor and HTTPService classes.
21 lines
439 B
Dart
21 lines
439 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/scene/model/scene_model.dart';
|
|
|
|
part 'scene_state.dart';
|
|
|
|
class SceneCubit extends Cubit<SceneState> {
|
|
SceneCubit() : super(SceneInitial()) {
|
|
getScenes();
|
|
}
|
|
|
|
static SceneCubit of(context) => BlocProvider.of<SceneCubit>(context);
|
|
|
|
void getScenes() {
|
|
emit(SceneLoading());
|
|
|
|
emit(SceneSuccess());
|
|
}
|
|
|
|
List<SceneModel> scenes = [];
|
|
}
|