tow touch and three touch

This commit is contained in:
mohammad
2024-10-01 16:33:11 +03:00
parent d75d438106
commit 908533dc9e
2 changed files with 102 additions and 10 deletions

View File

@ -9,6 +9,8 @@ import 'package:syncrow_app/features/devices/model/three_touch_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/circular_button.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_gang/gang_switch.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_touch/schedule_screen.dart';
import 'package:syncrow_app/features/devices/view/widgets/three_touch/two_touch_setting.dart';
import 'package:syncrow_app/features/devices/view/widgets/two_touch/two_touch_setting.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
@ -267,6 +269,7 @@ class ThreeTouchScreen extends StatelessWidget {
// ),
// ],
// ),
const SizedBox(
width: 20,
),
@ -286,6 +289,25 @@ class ThreeTouchScreen extends StatelessWidget {
)));
},
),
const SizedBox(
width: 20,
),
CircularButton(
device: device,
icons: Icons.access_time,
label: "Setting",
onTap: () {
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation1,
animation2) =>
ThreeTouchSetting(
device: device,
)));
},
),
// Column(
// mainAxisSize: MainAxisSize.min,
// children: [
@ -360,14 +382,8 @@ class ThreeTouchScreen extends StatelessWidget {
icons: Icons.u_turn_left,
label: "All Off",
onTap: () {
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation1,
animation2) =>
ScheduleScreen(
device: device!,
)));
BlocProvider.of<ThreeTouchBloc>(context)
.add(AllOffEvent());
},
),
// Column(

View File

@ -70,7 +70,7 @@ class ThreeTouchSetting extends StatelessWidget {
builder: (context) {
return RestartStatusDialog(
initialSelectedLabel:
deviceStatus!.relay.value,
deviceStatus.relay.value,
cancelTab: () {
Navigator.of(context).pop();
},
@ -368,6 +368,83 @@ class ThreeTouchSetting extends StatelessWidget {
],
),
)),
const Divider(
color: ColorsManager.graysColor,
),
Container(
padding: const EdgeInsets.only(
bottom: 10, top: 10),
child: InkWell(
onTap: () async {
twoTouchBloc.optionSelected =
'relay_status_3';
final result = await showDialog(
context: context,
builder: (context) {
return RestartStatusDialog(
initialSelectedLabel: deviceStatus
.relay_status_2.value,
cancelTab: () {
Navigator.of(context).pop();
},
confirmTab: () {
twoTouchBloc.add(
ChangeStatusEvent(
deviceId: device!.uuid!,
context: context));
Navigator.of(context).pop(true);
},
title: 'Restart Status 3',
label1: 'Power Off',
label2: 'Power On',
label3: 'Restart Memory',
onTapLabel1: (selected) {
twoTouchBloc.statusSelected =
selected;
},
onTapLabel2: (selected) {
twoTouchBloc.statusSelected =
selected;
},
onTapLabel3: (selected) {
twoTouchBloc.statusSelected =
selected;
},
);
},
);
if (result == true) {
// twoTouchBloc
// .add(const InitialEvent());
}
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const BodyLarge(
fontSize: 15,
text: 'Restart Status 3',
fontWeight: FontWeight.w400,
),
Row(
children: [
BodyMedium(
fontSize: 13,
text: twoTouchBloc.deviceStatus
.relay_status_1.value,
fontColor:
ColorsManager.textGray,
),
const Icon(
Icons.keyboard_arrow_right,
color: ColorsManager.textGray,
),
],
)
],
),
)),
],
),
),
@ -379,4 +456,3 @@ class ThreeTouchSetting extends StatelessWidget {
));
}
}