mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 19:34:54 +00:00
29 lines
708 B
Dart
29 lines
708 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
|
import 'package:syncrow_app/features/scene/model/scene_model.dart';
|
|
|
|
part 'scene_state.dart';
|
|
|
|
class SceneBloc extends Bloc<SceneEvent, SceneState> {
|
|
SceneBloc() : super(SceneInitial()) {
|
|
on<LoadScenes>(_onLoadScenes);
|
|
}
|
|
|
|
void _onLoadScenes(LoadScenes event, Emitter<SceneState> emit) {
|
|
emit(SceneLoading());
|
|
|
|
try {
|
|
final scenes = _loadScenes();
|
|
emit(SceneLoaded(scenes));
|
|
} catch (_) {
|
|
emit(SceneError());
|
|
}
|
|
}
|
|
|
|
List<SceneModel> _loadScenes() {
|
|
//TODO: Load scenes
|
|
return [];
|
|
}
|
|
}
|