mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Update button behavior in DeviceManagementPage based on routineTab state
This commit is contained in:
@ -40,17 +40,18 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
backgroundColor: null,
|
backgroundColor: null,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: !state.routineTab
|
||||||
BlocProvider.of<CreateRoutineBloc>(context)
|
? null
|
||||||
.add(const ResetSelectedEvent());
|
: () {
|
||||||
|
BlocProvider.of<CreateRoutineBloc>(context)
|
||||||
|
.add(const ResetSelectedEvent());
|
||||||
|
|
||||||
context
|
context.read<RoutineBloc>().add(
|
||||||
.read<RoutineBloc>()
|
const TriggerSwitchTabsEvent(isRoutineTab: false));
|
||||||
.add(const TriggerSwitchTabsEvent(isRoutineTab: false));
|
context
|
||||||
context
|
.read<DeviceManagementBloc>()
|
||||||
.read<DeviceManagementBloc>()
|
.add(FetchDevices(context));
|
||||||
.add(FetchDevices(context));
|
},
|
||||||
},
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'Devices',
|
'Devices',
|
||||||
style: context.textTheme.titleMedium?.copyWith(
|
style: context.textTheme.titleMedium?.copyWith(
|
||||||
@ -66,14 +67,15 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
backgroundColor: null,
|
backgroundColor: null,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: state.routineTab
|
||||||
BlocProvider.of<CreateRoutineBloc>(context)
|
? null
|
||||||
.add(const ResetSelectedEvent());
|
: () {
|
||||||
|
BlocProvider.of<CreateRoutineBloc>(context)
|
||||||
|
.add(const ResetSelectedEvent());
|
||||||
|
|
||||||
context
|
context.read<RoutineBloc>().add(
|
||||||
.read<RoutineBloc>()
|
const TriggerSwitchTabsEvent(isRoutineTab: true));
|
||||||
.add(const TriggerSwitchTabsEvent(isRoutineTab: true));
|
},
|
||||||
},
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'Routines',
|
'Routines',
|
||||||
style: context.textTheme.titleMedium?.copyWith(
|
style: context.textTheme.titleMedium?.copyWith(
|
||||||
|
Reference in New Issue
Block a user