mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
create routine dialog flow
This commit is contained in:
@ -43,8 +43,7 @@ class DeviceManagementBloc
|
||||
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
||||
|
||||
if (spaceBloc.state.selectedCommunities.isEmpty) {
|
||||
devices = await DevicesManagementApi()
|
||||
.fetchDevices('', '', projectUuid );
|
||||
devices = await DevicesManagementApi().fetchDevices('', '', projectUuid);
|
||||
} else {
|
||||
for (var community in spaceBloc.state.selectedCommunities) {
|
||||
List<String> spacesList =
|
||||
|
@ -3,6 +3,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/widgets/device_managment_body.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/navigate_home_grid_view.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/create_routine_bloc/create_routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/create_routine_bloc/create_routine_event.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/routine_bloc/routine_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/view/create_new_routine_view.dart';
|
||||
import 'package:syncrow_web/pages/routines/view/routines_view.dart';
|
||||
@ -23,6 +25,9 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
create: (context) =>
|
||||
DeviceManagementBloc()..add(FetchDevices(context)),
|
||||
),
|
||||
BlocProvider<CreateRoutineBloc>(
|
||||
create: (context) => CreateRoutineBloc(),
|
||||
),
|
||||
],
|
||||
child: WebScaffold(
|
||||
appBarTitle: Text(
|
||||
@ -39,10 +44,15 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
backgroundColor: null,
|
||||
),
|
||||
onPressed: () {
|
||||
BlocProvider.of<CreateRoutineBloc>(context)
|
||||
.add(const ResetSelectedEvent());
|
||||
|
||||
context
|
||||
.read<RoutineBloc>()
|
||||
.add(const TriggerSwitchTabsEvent(isRoutineTab: false));
|
||||
context.read<DeviceManagementBloc>().add(FetchDevices(context));
|
||||
context
|
||||
.read<DeviceManagementBloc>()
|
||||
.add(FetchDevices(context));
|
||||
},
|
||||
child: Text(
|
||||
'Devices',
|
||||
@ -60,6 +70,9 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
||||
backgroundColor: null,
|
||||
),
|
||||
onPressed: () {
|
||||
BlocProvider.of<CreateRoutineBloc>(context)
|
||||
.add(const ResetSelectedEvent());
|
||||
|
||||
context
|
||||
.read<RoutineBloc>()
|
||||
.add(const TriggerSwitchTabsEvent(isRoutineTab: true));
|
||||
|
Reference in New Issue
Block a user