mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Removed static space id and community id in the routine
This commit is contained in:
@ -20,7 +20,7 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<RoutineBloc>().add(FetchDevicesInRoutine());
|
||||
// context.read<RoutineBloc>().add(FetchDevicesInRoutine());
|
||||
}
|
||||
|
||||
@override
|
||||
@ -32,9 +32,12 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
}
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SpaceTreeView(
|
||||
onSelect: () {},
|
||||
Expanded(child: SpaceTreeView(
|
||||
onSelect: () {
|
||||
context.read<RoutineBloc>()
|
||||
..add(const LoadScenes())
|
||||
..add(const LoadAutomation());
|
||||
},
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
@ -59,8 +62,8 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
),
|
||||
RoutineViewCard(
|
||||
onTap: () {
|
||||
if (context.read<SpaceTreeBloc>().selectedCommunityId.isNotEmpty &&
|
||||
context.read<SpaceTreeBloc>().selectedSpaceId.isNotEmpty) {
|
||||
if (context.read<SpaceTreeBloc>().state.selectedCommunities.length == 1 &&
|
||||
context.read<SpaceTreeBloc>().state.selectedSpaces.length == 1) {
|
||||
context.read<RoutineBloc>().add(
|
||||
(ResetRoutineState()),
|
||||
);
|
||||
@ -68,7 +71,18 @@ class _RoutinesViewState extends State<RoutinesView> {
|
||||
const CreateNewRoutineViewEvent(createRoutineView: true),
|
||||
);
|
||||
} else {
|
||||
CustomSnackBar.redSnackBar('Please select a space');
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
context.read<SpaceTreeBloc>().state.selectedSpaces.isEmpty
|
||||
? 'Please select a space'
|
||||
: 'Please select only one space to proceed'),
|
||||
),
|
||||
);
|
||||
// CustomSnackBar.redSnackBar(
|
||||
// context.read<SpaceTreeBloc>().state.selectedSpaces.isEmpty
|
||||
// ? 'Please select a space'
|
||||
// : 'Please select only one space to proceed');
|
||||
}
|
||||
},
|
||||
icon: Icons.add,
|
||||
|
Reference in New Issue
Block a user