mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 01:35:23 +00:00

AC Cubit Add New Devices Cubit Arch will be used Devices Cubit (for devices categories, and devices page) { AC cubit, Lights cubit. ... } Replaced AssetsManager with Assets Class (auto generated)
24 lines
628 B
Dart
24 lines
628 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:meta/meta.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());
|
|
//TODO: remove this it's causing the Bad State because its being after the cubit is closed
|
|
Future.delayed(const Duration(seconds: 5), () {
|
|
emit(SceneSuccess());
|
|
});
|
|
}
|
|
|
|
List<SceneModel> scenes = [];
|
|
}
|