Enhance scheduling UI in glass switch control views with improved layout and dialog integration

This commit is contained in:
mohammad
2025-06-19 16:38:45 +03:00
parent 0b774a6dfc
commit 8cf73e3efc
2 changed files with 193 additions and 42 deletions

View File

@ -106,14 +106,123 @@ class ThreeGangGlassSwitchControlView extends StatelessWidget
);
},
),
ToggleWidget(
value: false,
code: '',
deviceId: deviceId,
label: 'Preferences',
icon: Assets.preferences,
onChange: (value) {},
showToggle: false,
GestureDetector(
onTap: () {
showDialog<void>(
context: context,
builder: (ctx) => BlocProvider.value(
value: BlocProvider.of<ThreeGangGlassSwitchBloc>(context),
child: BuildScheduleView(
category: 'switch_1',
deviceUuid: deviceId,
),
));
},
child: DeviceControlsContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 60,
height: 60,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: ColorsManager.whiteColors,
),
margin: const EdgeInsets.symmetric(horizontal: 4),
padding: const EdgeInsets.all(12),
child: ClipOval(
child: SvgPicture.asset(
Assets.scheduling,
fit: BoxFit.fill,
),
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Wall Light',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w200,
fontSize: 12,
color: ColorsManager.blackColor,
),
),
Text(
'Scheduling',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w400,
color: ColorsManager.blackColor,
),
),
],
),
],
),
),
),
GestureDetector(
onTap: () {
showDialog<void>(
context: context,
builder: (ctx) => BlocProvider.value(
value: BlocProvider.of<ThreeGangGlassSwitchBloc>(context),
child: BuildScheduleView(
category: 'switch_2',
deviceUuid: deviceId,
),
));
},
child: DeviceControlsContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 60,
height: 60,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: ColorsManager.whiteColors,
),
margin: const EdgeInsets.symmetric(horizontal: 4),
padding: const EdgeInsets.all(12),
child: ClipOval(
child: SvgPicture.asset(
Assets.scheduling,
fit: BoxFit.fill,
),
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ceiling Light',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w200,
fontSize: 12,
color: ColorsManager.blackColor,
),
),
Text(
'Scheduling',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w400,
color: ColorsManager.blackColor,
),
),
],
),
],
),
),
),
GestureDetector(
onTap: () {
@ -148,6 +257,18 @@ class ThreeGangGlassSwitchControlView extends StatelessWidget
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'SpotLight',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w200,
fontSize: 12,
color: ColorsManager.blackColor,
),
),
Text(
'Scheduling',
textAlign: TextAlign.center,
@ -158,8 +279,19 @@ class ThreeGangGlassSwitchControlView extends StatelessWidget
),
],
),
],
),
),
),
ToggleWidget(
value: false,
code: '',
deviceId: deviceId,
label: 'Preferences',
icon: Assets.preferences,
onChange: (value) {},
showToggle: false,
),
)
],
);
}

View File

@ -98,18 +98,9 @@ class TwoGangGlassSwitchControlView extends StatelessWidget
onChange: (value) {},
showToggle: false,
),
// ToggleWidget(
// value: false,
// code: '',
// deviceId: deviceId,
// label: 'Scheduling',
// icon: Assets.scheduling,
// onChange: (value) {},
// showToggle: false,
// ),
GestureDetector(
onTap: () {
showDialog(
showDialog<void>(
context: context,
builder: (ctx) => BlocProvider.value(
value: BlocProvider.of<TwoGangGlassSwitchBloc>(context),
@ -140,6 +131,18 @@ class TwoGangGlassSwitchControlView extends StatelessWidget
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Wall Light',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w200,
fontSize: 12,
color: ColorsManager.blackColor,
),
),
Text(
'Scheduling',
textAlign: TextAlign.center,
@ -150,11 +153,13 @@ class TwoGangGlassSwitchControlView extends StatelessWidget
),
],
),
],
),
),
),
GestureDetector(
onTap: () {
showDialog(
showDialog<void>(
context: context,
builder: (ctx) => BlocProvider.value(
value: BlocProvider.of<TwoGangGlassSwitchBloc>(context),
@ -185,6 +190,18 @@ class TwoGangGlassSwitchControlView extends StatelessWidget
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ceiling Light',
textAlign: TextAlign.center,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w200,
fontSize: 12,
color: ColorsManager.blackColor,
),
),
Text(
'Scheduling',
textAlign: TextAlign.center,
@ -195,6 +212,8 @@ class TwoGangGlassSwitchControlView extends StatelessWidget
),
],
),
],
),
),
)
],