Files
syncrow-app/lib/features/scene/bloc/scene_cubit.dart
Mohammad Salameh df13c66b1a Refactor API error handling and add try-catch blocks
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.
2024-04-15 15:47:13 +03:00

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 = [];
}