mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
touch wizard 1gt and 2 gt and 3gt
This commit is contained in:
@ -508,10 +508,11 @@ class OneTouchBloc extends Bloc<OneTouchEvent, OneTouchState> {
|
|||||||
|
|
||||||
String statusSelected = '';
|
String statusSelected = '';
|
||||||
String optionSelected = '';
|
String optionSelected = '';
|
||||||
|
|
||||||
Future<void> _changeStatus(
|
Future<void> _changeStatus(
|
||||||
ChangeStatusEvent event, Emitter<OneTouchState> emit) async {
|
ChangeStatusEvent event, Emitter<OneTouchState> emit) async {
|
||||||
emit(LoadingInitialState());
|
try {
|
||||||
|
emit(LoadingInitialState());
|
||||||
|
|
||||||
final Map<String, Map<String, String>> controlMap = {
|
final Map<String, Map<String, String>> controlMap = {
|
||||||
"relay_status": {
|
"relay_status": {
|
||||||
@ -538,108 +539,13 @@ class OneTouchBloc extends Bloc<OneTouchEvent, OneTouchState> {
|
|||||||
deviceId: oneTouchId, code: optionSelected, value: selectedControl),
|
deviceId: oneTouchId, code: optionSelected, value: selectedControl),
|
||||||
oneTouchId,
|
oneTouchId,
|
||||||
);
|
);
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
|
||||||
add(const InitialEvent(groupScreen: false));
|
|
||||||
});
|
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
|
||||||
emit(UpdateState(oneTouchModel: deviceStatus));
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// add(const InitialEvent(groupScreen: false));
|
|
||||||
} else {
|
} else {
|
||||||
print('Invalid statusSelected or optionSelected');
|
print('Invalid statusSelected or optionSelected');
|
||||||
}
|
}
|
||||||
|
} on DioException catch (e) {
|
||||||
|
final errorData = e.response!.data;
|
||||||
|
String errorMessage = errorData['message'];
|
||||||
|
emit(FailedState(error: errorMessage.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// void _changeStatus(
|
|
||||||
// ChangeStatusEvent event, Emitter<OneTouchState> emit) async {
|
|
||||||
// emit(LoadingNewSate(oneTouchModel: deviceStatus));
|
|
||||||
// try {
|
|
||||||
// // deviceStatus.firstSwitch = !event.value;
|
|
||||||
// emit(UpdateState(oneTouchModel: deviceStatus));
|
|
||||||
// print('statusSelected====${statusSelected}');
|
|
||||||
// if (optionSelected == "relay_status") {
|
|
||||||
// if (statusSelected == 'Power On') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId,
|
|
||||||
// code: 'relay_status',
|
|
||||||
// value: 'power_on'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'Power Off') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId,
|
|
||||||
// code: 'relay_status',
|
|
||||||
// value: 'power_off'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'Restart Memory') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId, code: 'relay_status', value: 'last'),
|
|
||||||
// oneTouchId);
|
|
||||||
// }
|
|
||||||
// } else if (optionSelected == "light_mode") {
|
|
||||||
// if (statusSelected == 'Off') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId, code: 'light_mode', value: 'none'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'On/Off Status') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId, code: 'light_mode', value: 'relay'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'Switch Position') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId, code: 'relay_status', value: 'pos'),
|
|
||||||
// oneTouchId);
|
|
||||||
// }
|
|
||||||
// } else if (optionSelected == "relay_status_1") {
|
|
||||||
// if (statusSelected == 'Power On') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId,
|
|
||||||
// code: 'relay_status_1',
|
|
||||||
// value: 'power_off'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'Power Off') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId,
|
|
||||||
// code: 'relay_status_1',
|
|
||||||
// value: 'power_on'),
|
|
||||||
// oneTouchId);
|
|
||||||
// } else if (statusSelected == 'Restart Memory') {
|
|
||||||
// final response = await DevicesAPI.controlDevice(
|
|
||||||
// DeviceControlModel(
|
|
||||||
// deviceId: oneTouchId, code: 'relay_status_1', value: 'last'),
|
|
||||||
// oneTouchId);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// add(InitialEvent(groupScreen: oneTouchGroup));
|
|
||||||
// } catch (_) {
|
|
||||||
// add(InitialEvent(groupScreen: oneTouchGroup));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<void> _changeStatus(
|
|
||||||
// ChangeStatusEvent event, Emitter<OneTouchState> emit) async {
|
|
||||||
// try {
|
|
||||||
// emit(LoadingInitialState());
|
|
||||||
// // emit(LoadingNewSate(oneTouchModel: deviceStatus));
|
|
||||||
// await _handleDeviceControl(event.deviceId, event.context);
|
|
||||||
// Future.delayed(const Duration(seconds: 1), () async {
|
|
||||||
// add(const InitialEvent(groupScreen: false));
|
|
||||||
// });
|
|
||||||
// emit(UpdateState(oneTouchModel: deviceStatus));
|
|
||||||
// } catch (error) {
|
|
||||||
// print('Error controlling device: $error');
|
|
||||||
// add(InitialEvent(groupScreen: oneTouchGroup));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:firebase_database/firebase_database.dart';
|
import 'package:firebase_database/firebase_database.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/three_touch_bloc/three_touch_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/three_touch_bloc/three_touch_event.dart';
|
||||||
@ -64,6 +65,19 @@ class ThreeTouchBloc extends Bloc<ThreeTouchEvent, ThreeTouchState> {
|
|||||||
on<ToggleSelectedEvent>(toggleSelectedIndex);
|
on<ToggleSelectedEvent>(toggleSelectedIndex);
|
||||||
on<ToggleCreateScheduleEvent>(toggleCreateSchedule);
|
on<ToggleCreateScheduleEvent>(toggleCreateSchedule);
|
||||||
on<ChangeStatusEvent>(_changeStatus);
|
on<ChangeStatusEvent>(_changeStatus);
|
||||||
|
on<InitialSettingDevises>(_fetchTouchStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
_fetchTouchStatus(
|
||||||
|
InitialSettingDevises event, Emitter<ThreeTouchState> emit) async {
|
||||||
|
emit(LoadingInitialState());
|
||||||
|
var response = await DevicesAPI.getDeviceStatus(event.id);
|
||||||
|
List<StatusModel> statusModelList = [];
|
||||||
|
for (var status in response['status']) {
|
||||||
|
statusModelList.add(StatusModel.fromJson(status));
|
||||||
|
}
|
||||||
|
deviceStatus = ThreeTouchModel.fromJson(statusModelList);
|
||||||
|
emit(ChangeStateSetting());
|
||||||
}
|
}
|
||||||
|
|
||||||
void _fetchThreeTouchStatus(
|
void _fetchThreeTouchStatus(
|
||||||
@ -696,52 +710,55 @@ class ThreeTouchBloc extends Bloc<ThreeTouchEvent, ThreeTouchState> {
|
|||||||
|
|
||||||
Future<void> _changeStatus(
|
Future<void> _changeStatus(
|
||||||
ChangeStatusEvent event, Emitter<ThreeTouchState> emit) async {
|
ChangeStatusEvent event, Emitter<ThreeTouchState> emit) async {
|
||||||
emit(LoadingInitialState());
|
try {
|
||||||
|
emit(LoadingInitialState());
|
||||||
|
|
||||||
final Map<String, Map<String, String>> controlMap = {
|
print(optionSelected);
|
||||||
"relay_status": {
|
print(statusSelected);
|
||||||
'Power On': 'power_on',
|
final Map<String, Map<String, String>> controlMap = {
|
||||||
'Power Off': 'power_off',
|
"relay_status": {
|
||||||
'Restart Memory': 'last',
|
'Power On': 'power_on',
|
||||||
},
|
'Power Off': 'power_off',
|
||||||
"light_mode": {
|
'Restart Memory': 'last',
|
||||||
'Off': 'none',
|
},
|
||||||
'On/Off Status': 'relay',
|
"light_mode": {
|
||||||
'Switch Position': 'pos',
|
'Off': 'none',
|
||||||
},
|
'On/Off Status': 'relay',
|
||||||
"relay_status_1": {
|
'Switch Position': 'pos',
|
||||||
'Power On': 'power_on',
|
},
|
||||||
'Power Off': 'power_off',
|
"relay_status_1": {
|
||||||
'Restart Memory': 'last',
|
'Power On': 'power_on',
|
||||||
},
|
'Power Off': 'power_off',
|
||||||
"relay_status_2": {
|
'Restart Memory': 'last',
|
||||||
'Power On': 'power_on',
|
},
|
||||||
'Power Off': 'power_off',
|
"relay_status_2": {
|
||||||
'Restart Memory': 'last',
|
'Power On': 'power_on',
|
||||||
},
|
'Power Off': 'power_off',
|
||||||
"relay_status_3": {
|
'Restart Memory': 'last',
|
||||||
'Power On': 'power_on',
|
},
|
||||||
'Power Off': 'power_off',
|
"relay_status_3": {
|
||||||
'Restart Memory': 'last',
|
'Power On': 'power_on',
|
||||||
},
|
'Power Off': 'power_off',
|
||||||
};
|
'Restart Memory': 'last',
|
||||||
final selectedControl = controlMap[optionSelected]?[statusSelected];
|
},
|
||||||
if (selectedControl != null) {
|
};
|
||||||
await DevicesAPI.controlDevice(
|
|
||||||
DeviceControlModel(
|
final selectedControl = controlMap[optionSelected]?[statusSelected];
|
||||||
deviceId: threeTouchId,
|
if (selectedControl != null) {
|
||||||
code: optionSelected,
|
await DevicesAPI.controlDevice(
|
||||||
value: selectedControl),
|
DeviceControlModel(
|
||||||
threeTouchId,
|
deviceId: threeTouchId,
|
||||||
);
|
code: optionSelected,
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
value: selectedControl),
|
||||||
add(const InitialEvent(groupScreen: false));
|
threeTouchId,
|
||||||
});
|
);
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
} else {
|
||||||
emit(UpdateState(threeTouchModel: deviceStatus));
|
print('Invalid statusSelected or optionSelected');
|
||||||
});
|
}
|
||||||
} else {
|
} on DioException catch (e) {
|
||||||
print('Invalid statusSelected or optionSelected');
|
final errorData = e.response!.data;
|
||||||
|
String errorMessage = errorData['message'];
|
||||||
|
emit(FailedState(error: errorMessage.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,3 +145,8 @@ class ChangeStatusEvent extends ThreeTouchEvent {
|
|||||||
final BuildContext context;
|
final BuildContext context;
|
||||||
const ChangeStatusEvent({this.deviceId = '', required this.context});
|
const ChangeStatusEvent({this.deviceId = '', required this.context});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class InitialSettingDevises extends ThreeTouchEvent {
|
||||||
|
final String id;
|
||||||
|
const InitialSettingDevises({required this.id});
|
||||||
|
}
|
||||||
|
@ -2,7 +2,6 @@ import 'package:equatable/equatable.dart';
|
|||||||
import 'package:syncrow_app/features/devices/model/group_three_touch_model.dart';
|
import 'package:syncrow_app/features/devices/model/group_three_touch_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/three_touch_model.dart';
|
import 'package:syncrow_app/features/devices/model/three_touch_model.dart';
|
||||||
|
|
||||||
|
|
||||||
class ThreeTouchState extends Equatable {
|
class ThreeTouchState extends Equatable {
|
||||||
const ThreeTouchState();
|
const ThreeTouchState();
|
||||||
|
|
||||||
@ -34,7 +33,8 @@ class UpdateGroupState extends ThreeTouchState {
|
|||||||
final List<GroupThreeTouchModel> threeTouchList;
|
final List<GroupThreeTouchModel> threeTouchList;
|
||||||
final bool allSwitches;
|
final bool allSwitches;
|
||||||
|
|
||||||
const UpdateGroupState({required this.threeTouchList, required this.allSwitches});
|
const UpdateGroupState(
|
||||||
|
{required this.threeTouchList, required this.allSwitches});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [threeTouchList, allSwitches];
|
List<Object> get props => [threeTouchList, allSwitches];
|
||||||
@ -77,14 +77,20 @@ class TimerRunInProgress extends ThreeTouchState {
|
|||||||
|
|
||||||
class TimerRunComplete extends ThreeTouchState {}
|
class TimerRunComplete extends ThreeTouchState {}
|
||||||
|
|
||||||
|
|
||||||
class ThreeTouchSaveSchedule extends ThreeTouchState {}
|
class ThreeTouchSaveSchedule extends ThreeTouchState {}
|
||||||
|
|
||||||
class IsToggleState extends ThreeTouchState {
|
class IsToggleState extends ThreeTouchState {
|
||||||
final bool? onOff;
|
final bool? onOff;
|
||||||
const IsToggleState({this.onOff});
|
const IsToggleState({this.onOff});
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangeTimeState extends ThreeTouchState {}
|
class ChangeTimeState extends ThreeTouchState {}
|
||||||
|
|
||||||
class UpdateCreateScheduleState extends ThreeTouchState {
|
class UpdateCreateScheduleState extends ThreeTouchState {
|
||||||
final bool createSchedule;
|
final bool createSchedule;
|
||||||
UpdateCreateScheduleState(this.createSchedule);
|
UpdateCreateScheduleState(this.createSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ChangeStateSetting extends ThreeTouchState {
|
||||||
|
const ChangeStateSetting();
|
||||||
|
}
|
||||||
|
@ -641,48 +641,47 @@ class TwoTouchBloc extends Bloc<TwoTouchEvent, TwoTouchState> {
|
|||||||
|
|
||||||
Future<void> _changeStatus(
|
Future<void> _changeStatus(
|
||||||
ChangeStatusEvent event, Emitter<TwoTouchState> emit) async {
|
ChangeStatusEvent event, Emitter<TwoTouchState> emit) async {
|
||||||
emit(LoadingInitialState());
|
try {
|
||||||
|
emit(LoadingInitialState());
|
||||||
|
final Map<String, Map<String, String>> controlMap = {
|
||||||
|
"relay_status": {
|
||||||
|
'Power On': 'power_on',
|
||||||
|
'Power Off': 'power_off',
|
||||||
|
'Restart Memory': 'last',
|
||||||
|
},
|
||||||
|
"light_mode": {
|
||||||
|
'Off': 'none',
|
||||||
|
'On/Off Status': 'relay',
|
||||||
|
'Switch Position': 'pos',
|
||||||
|
},
|
||||||
|
"relay_status_1": {
|
||||||
|
'Power On': 'power_on',
|
||||||
|
'Power Off': 'power_off',
|
||||||
|
'Restart Memory': 'last',
|
||||||
|
},
|
||||||
|
"relay_status_2": {
|
||||||
|
'Power On': 'power_on',
|
||||||
|
'Power Off': 'power_off',
|
||||||
|
'Restart Memory': 'last',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
print(optionSelected);
|
final selectedControl = controlMap[optionSelected]?[statusSelected];
|
||||||
print(statusSelected);
|
if (selectedControl != null) {
|
||||||
final Map<String, Map<String, String>> controlMap = {
|
await DevicesAPI.controlDevice(
|
||||||
"relay_status": {
|
DeviceControlModel(
|
||||||
'Power On': 'power_on',
|
deviceId: twoTouchId,
|
||||||
'Power Off': 'power_off',
|
code: optionSelected,
|
||||||
'Restart Memory': 'last',
|
value: selectedControl),
|
||||||
},
|
twoTouchId,
|
||||||
"light_mode": {
|
);
|
||||||
'Off': 'none',
|
} else {
|
||||||
'On/Off Status': 'relay',
|
print('Invalid statusSelected or optionSelected');
|
||||||
'Switch Position': 'pos',
|
}
|
||||||
},
|
} on DioException catch (e) {
|
||||||
"relay_status_1": {
|
final errorData = e.response!.data;
|
||||||
'Power On': 'power_on',
|
String errorMessage = errorData['message'];
|
||||||
'Power Off': 'power_off',
|
emit(FailedState(error: errorMessage.toString()));
|
||||||
'Restart Memory': 'last',
|
|
||||||
},
|
|
||||||
"relay_status_2": {
|
|
||||||
'Power On': 'power_on',
|
|
||||||
'Power Off': 'power_off',
|
|
||||||
'Restart Memory': 'last',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
final selectedControl = controlMap[optionSelected]?[statusSelected];
|
|
||||||
if (selectedControl != null) {
|
|
||||||
await DevicesAPI.controlDevice(
|
|
||||||
DeviceControlModel(
|
|
||||||
deviceId: twoTouchId, code: optionSelected, value: selectedControl),
|
|
||||||
twoTouchId,
|
|
||||||
);
|
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
|
||||||
add(const InitialEvent());
|
|
||||||
});
|
|
||||||
Future.delayed(const Duration(seconds: 1), () async {
|
|
||||||
emit(UpdateState(twoTouchModel: deviceStatus));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
print('Invalid statusSelected or optionSelected');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ class ThreeTouchModel {
|
|||||||
late int _firstCount;
|
late int _firstCount;
|
||||||
late int _secondCount;
|
late int _secondCount;
|
||||||
late int _thirdCount;
|
late int _thirdCount;
|
||||||
late int _thirdCountDown;
|
|
||||||
late String _relay;
|
late String _relay;
|
||||||
late String _light_mode;
|
late String _light_mode;
|
||||||
late String _relay_status_1;
|
late String _relay_status_1;
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_event.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_state.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/model/group_one_touch_model.dart';
|
||||||
|
|
||||||
|
import 'package:syncrow_app/features/shared_widgets/devices_default_switch.dart';
|
||||||
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||||
|
|
||||||
|
class OneTouchList extends StatelessWidget {
|
||||||
|
const OneTouchList(
|
||||||
|
{super.key, required this.oneTouchList, required this.allSwitches});
|
||||||
|
|
||||||
|
final List<GroupOneTouchModel> oneTouchList;
|
||||||
|
final bool allSwitches;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocBuilder<OneTouchBloc, OneTouchState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
const BodySmall(text: 'All Lights'),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
DevicesDefaultSwitch(
|
||||||
|
switchValue: allSwitches,
|
||||||
|
action: () {
|
||||||
|
BlocProvider.of<OneTouchBloc>(context).add(GroupAllOnEvent());
|
||||||
|
},
|
||||||
|
secondAction: () {
|
||||||
|
BlocProvider.of<OneTouchBloc>(context).add(GroupAllOffEvent());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
itemCount: oneTouchList.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
BodySmall(text: oneTouchList[index].deviceName),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
DevicesDefaultSwitch(
|
||||||
|
switchValue: oneTouchList[index].firstSwitch,
|
||||||
|
action: () {
|
||||||
|
BlocProvider.of<OneTouchBloc>(context).add(
|
||||||
|
ChangeFirstWizardSwitchStatusEvent(
|
||||||
|
value: oneTouchList[index].firstSwitch,
|
||||||
|
deviceId: oneTouchList[index].deviceId));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@ import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_event
|
|||||||
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/one_touch_model.dart';
|
import 'package:syncrow_app/features/devices/model/one_touch_model.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/restart_status_dialog.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
@ -65,8 +66,8 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel:
|
initialSelectedLabel: oneTouchBloc
|
||||||
oneTouchModel!.relay.value,
|
.deviceStatus.relay.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -96,11 +97,11 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// Future.delayed(const Duration(seconds: 1),
|
Future.delayed(const Duration(seconds: 2),
|
||||||
// () async {
|
() async {
|
||||||
// oneTouchBloc.add(const InitialEvent(
|
oneTouchBloc.add(const InitialEvent(
|
||||||
// groupScreen: false));
|
groupScreen: false));
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -119,8 +120,8 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text:
|
text: oneTouchBloc
|
||||||
oneTouchModel!.relay.value,
|
.deviceStatus.relay.value,
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
@ -141,7 +142,8 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
bottom: 10, top: 10),
|
bottom: 10, top: 10),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
oneTouchBloc.optionSelected ='light_mode';
|
oneTouchBloc.optionSelected =
|
||||||
|
'light_mode';
|
||||||
final result = await showDialog(
|
final result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
@ -178,8 +180,12 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// oneTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
// groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
oneTouchBloc.add(const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@ -196,7 +202,7 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text: oneTouchBloc.deviceStatus
|
text: oneTouchModel
|
||||||
.light_mode.value,
|
.light_mode.value,
|
||||||
fontColor: ColorsManager.textGray,
|
fontColor: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
@ -242,19 +248,14 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
label2: 'Power On',
|
label2: 'Power On',
|
||||||
label3: 'Restart Memory',
|
label3: 'Restart Memory',
|
||||||
onTapLabel1: (selected) {
|
onTapLabel1: (selected) {
|
||||||
print(selected);
|
|
||||||
oneTouchBloc.statusSelected =
|
oneTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
onTapLabel2: (selected) {
|
onTapLabel2: (selected) {
|
||||||
print(selected);
|
|
||||||
|
|
||||||
oneTouchBloc.statusSelected =
|
oneTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
onTapLabel3: (selected) {
|
onTapLabel3: (selected) {
|
||||||
print(selected);
|
|
||||||
|
|
||||||
oneTouchBloc.statusSelected =
|
oneTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
@ -262,8 +263,12 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
oneTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
oneTouchBloc.add(const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -279,7 +284,7 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text: oneTouchBloc.deviceStatus
|
text: oneTouchModel
|
||||||
.relay_status_1.value,
|
.relay_status_1.value,
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
@ -304,228 +309,3 @@ class OneTouchSetting extends StatelessWidget {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RestartStatusDialog extends StatefulWidget {
|
|
||||||
final String label1;
|
|
||||||
final String label2;
|
|
||||||
final String label3;
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
final Function(String)? onTapLabel1;
|
|
||||||
final Function(String)? onTapLabel2;
|
|
||||||
final Function(String)? onTapLabel3;
|
|
||||||
final Function()? cancelTab;
|
|
||||||
final Function()? confirmTab;
|
|
||||||
|
|
||||||
final String? initialSelectedLabel;
|
|
||||||
|
|
||||||
RestartStatusDialog({
|
|
||||||
required this.label1,
|
|
||||||
required this.label2,
|
|
||||||
required this.label3,
|
|
||||||
required this.title,
|
|
||||||
this.onTapLabel1,
|
|
||||||
this.onTapLabel2,
|
|
||||||
this.onTapLabel3,
|
|
||||||
required this.cancelTab,
|
|
||||||
required this.confirmTab,
|
|
||||||
this.initialSelectedLabel,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_RestartStatusDialogState createState() => _RestartStatusDialogState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RestartStatusDialogState extends State<RestartStatusDialog> {
|
|
||||||
late String _selectedOption;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
_selectedOption = widget.initialSelectedLabel ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
BodyLarge(
|
|
||||||
text: widget.title,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontColor: ColorsManager.primaryColor,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(left: 15, right: 15),
|
|
||||||
child: Divider(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 15, right: 15),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label1,
|
|
||||||
onTap: widget.onTapLabel1,
|
|
||||||
),
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label2,
|
|
||||||
onTap: widget.onTapLabel2,
|
|
||||||
),
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label3,
|
|
||||||
onTap: widget.onTapLabel3,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
right: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
top: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
child: SizedBox(
|
|
||||||
child: InkWell(
|
|
||||||
onTap: widget.cancelTab,
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(15),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Cancel',
|
|
||||||
style: TextStyle(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
left: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
top: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: widget.confirmTab,
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(15),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Confirm',
|
|
||||||
style: TextStyle(
|
|
||||||
color: ColorsManager.primaryColor,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildCheckboxOption(
|
|
||||||
{required String label, Function(String)? onTap}) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 10, top: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
BodyMedium(
|
|
||||||
text: label,
|
|
||||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
CircularCheckbox(
|
|
||||||
value: _selectedOption == label,
|
|
||||||
onChanged: (bool? value) {
|
|
||||||
if (value == true) {
|
|
||||||
setState(() {
|
|
||||||
_selectedOption = label;
|
|
||||||
});
|
|
||||||
if (onTap != null) {
|
|
||||||
onTap(label);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CircularCheckbox extends StatefulWidget {
|
|
||||||
final bool value;
|
|
||||||
final ValueChanged<bool?> onChanged;
|
|
||||||
|
|
||||||
CircularCheckbox({required this.value, required this.onChanged});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_CircularCheckboxState createState() => _CircularCheckboxState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CircularCheckboxState extends State<CircularCheckbox> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
widget.onChanged(!widget.value);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
border: Border.all(
|
|
||||||
color: widget.value
|
|
||||||
? ColorsManager.primaryColorWithOpacity.withOpacity(0.01)
|
|
||||||
: Colors.grey,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
color: widget.value
|
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: Colors.transparent,
|
|
||||||
),
|
|
||||||
width: 24.0,
|
|
||||||
height: 24.0,
|
|
||||||
child: widget.value
|
|
||||||
? const Icon(
|
|
||||||
Icons.check,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 16.0,
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,42 +1,46 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/one_gang_bloc/one_gang_bloc.dart';
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_bloc.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/one_gang_bloc/one_gang_event.dart';
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_event.dart';
|
||||||
import 'package:syncrow_app/features/devices/bloc/one_gang_bloc/one_gang_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/one_touch_bloc/one_touch_state.dart';
|
||||||
|
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/group_one_gang_model.dart';
|
import 'package:syncrow_app/features/devices/model/group_one_touch_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/one_gang/one_gang_list.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/one_touch/one_gang_list.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
|
|
||||||
class OneGangWizard extends StatelessWidget {
|
class OneTouchWizard extends StatelessWidget {
|
||||||
const OneGangWizard({super.key, this.device});
|
const OneTouchWizard({super.key, this.device});
|
||||||
|
|
||||||
final DeviceModel? device;
|
final DeviceModel? device;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<GroupOneGangModel> groupOneGangModel = [];
|
List<GroupOneTouchModel> groupOneTouchModel = [];
|
||||||
|
|
||||||
return DefaultScaffold(
|
return DefaultScaffold(
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
OneGangBloc(switchCode: '', oneGangId: device?.uuid ?? '')..add(InitialWizardEvent()),
|
OneTouchBloc(switchCode: '', oneTouchId: device?.uuid ?? '')
|
||||||
child: BlocBuilder<OneGangBloc, OneGangState>(
|
..add(InitialWizardEvent()),
|
||||||
|
child: BlocBuilder<OneTouchBloc, OneTouchState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
bool allSwitchesOn = false;
|
bool allSwitchesOn = false;
|
||||||
|
|
||||||
if (state is UpdateGroupState) {
|
if (state is UpdateGroupState) {
|
||||||
groupOneGangModel = state.oneGangList;
|
groupOneTouchModel = state.oneTouchList;
|
||||||
allSwitchesOn = state.allSwitches;
|
allSwitchesOn = state.allSwitches;
|
||||||
}
|
}
|
||||||
return state is LoadingInitialState
|
return state is LoadingInitialState
|
||||||
? const Center(
|
? const Center(
|
||||||
child:
|
child: DefaultContainer(
|
||||||
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: CircularProgressIndicator()),
|
||||||
)
|
)
|
||||||
: OneGangList(
|
: OneTouchList(
|
||||||
oneGangList: groupOneGangModel,
|
oneTouchList: groupOneTouchModel,
|
||||||
allSwitches: allSwitchesOn,
|
allSwitches: allSwitchesOn,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -79,8 +79,7 @@ class ThreeTouchScreen extends StatelessWidget {
|
|||||||
threeGangSwitch: device!,
|
threeGangSwitch: device!,
|
||||||
value: threeTouchModel.firstSwitch,
|
value: threeTouchModel.firstSwitch,
|
||||||
action: () {
|
action: () {
|
||||||
BlocProvider.of<ThreeTouchBloc>(
|
BlocProvider.of<ThreeTouchBloc>(context)
|
||||||
context)
|
|
||||||
.add(ChangeFirstSwitchStatusEvent(
|
.add(ChangeFirstSwitchStatusEvent(
|
||||||
value: threeTouchModel
|
value: threeTouchModel
|
||||||
.firstSwitch));
|
.firstSwitch));
|
||||||
|
@ -25,7 +25,7 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
ThreeTouchBloc(switchCode: '', threeTouchId: device?.uuid ?? '')
|
ThreeTouchBloc(switchCode: '', threeTouchId: device?.uuid ?? '')
|
||||||
..add(const InitialEvent(groupScreen: false)),
|
..add(InitialEvent(groupScreen: false)),
|
||||||
child: BlocBuilder<ThreeTouchBloc, ThreeTouchState>(
|
child: BlocBuilder<ThreeTouchBloc, ThreeTouchState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final threeTouchBloc = BlocProvider.of<ThreeTouchBloc>(context);
|
final threeTouchBloc = BlocProvider.of<ThreeTouchBloc>(context);
|
||||||
@ -42,9 +42,16 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
relay_status_2: status.off,
|
relay_status_2: status.off,
|
||||||
relay_status_3: status.off,
|
relay_status_3: status.off,
|
||||||
);
|
);
|
||||||
if (state is UpdateState) {
|
if (state is LoadingNewSate) {
|
||||||
|
deviceStatus = state.threeTouchModel;
|
||||||
|
} else if (state is UpdateState) {
|
||||||
deviceStatus = state.threeTouchModel;
|
deviceStatus = state.threeTouchModel;
|
||||||
}
|
}
|
||||||
|
// if (state is ChangeStateSetting) {
|
||||||
|
// // Navigator.of(context).pop(true);
|
||||||
|
// threeTouchBloc
|
||||||
|
// .add(InitialSettingDevises(id: device?.uuid ?? ''));
|
||||||
|
// }
|
||||||
return state is LoadingInitialState
|
return state is LoadingInitialState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
@ -69,8 +76,8 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel:
|
initialSelectedLabel: threeTouchBloc
|
||||||
deviceStatus.relay.value,
|
.deviceStatus.relay.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -101,11 +108,11 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// Future.delayed(const Duration(seconds: 1),
|
Future.delayed(const Duration(seconds: 2),
|
||||||
// () async {
|
() async {
|
||||||
// oneTouchBloc.add(const InitialEvent(
|
threeTouchBloc.add(
|
||||||
// groupScreen: false));
|
InitialEvent(groupScreen: false));
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -124,7 +131,8 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text: deviceStatus.relay.value,
|
text: threeTouchBloc
|
||||||
|
.deviceStatus.relay.value,
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
@ -151,8 +159,8 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel:
|
initialSelectedLabel: threeTouchBloc
|
||||||
deviceStatus.light_mode.value,
|
.deviceStatus.light_mode.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -183,8 +191,12 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
threeTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
threeTouchBloc.add(
|
||||||
|
InitialEvent(groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@ -229,8 +241,9 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel: deviceStatus
|
initialSelectedLabel:
|
||||||
.relay_status_1.value,
|
threeTouchBloc.deviceStatus
|
||||||
|
.relay_status_1.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -261,8 +274,13 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
threeTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
threeTouchBloc.add(
|
||||||
|
const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -308,8 +326,9 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel: deviceStatus
|
initialSelectedLabel:
|
||||||
.relay_status_2.value,
|
threeTouchBloc.deviceStatus
|
||||||
|
.relay_status_2.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -340,8 +359,16 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
threeTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
threeTouchBloc.add(
|
||||||
|
const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
threeTouchBloc.add(
|
||||||
|
const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -387,8 +414,9 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return RestartStatusDialog(
|
return RestartStatusDialog(
|
||||||
initialSelectedLabel: deviceStatus
|
initialSelectedLabel:
|
||||||
.relay_status_3.value,
|
threeTouchBloc.deviceStatus
|
||||||
|
.relay_status_3.value,
|
||||||
cancelTab: () {
|
cancelTab: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@ -419,8 +447,16 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
threeTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
threeTouchBloc.add(
|
||||||
|
const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
threeTouchBloc.add(
|
||||||
|
const InitialEvent(
|
||||||
|
groupScreen: false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -438,7 +474,7 @@ class ThreeTouchSetting extends StatelessWidget {
|
|||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text: threeTouchBloc
|
text: threeTouchBloc
|
||||||
.deviceStatus
|
.deviceStatus
|
||||||
.relay_status_1
|
.relay_status_3
|
||||||
.value,
|
.value,
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
|
@ -5,6 +5,7 @@ import 'package:syncrow_app/features/devices/bloc/two_touch_bloc/two_touch_event
|
|||||||
import 'package:syncrow_app/features/devices/bloc/two_touch_bloc/two_touch_state.dart';
|
import 'package:syncrow_app/features/devices/bloc/two_touch_bloc/two_touch_state.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/model/two_touch_model.dart';
|
import 'package:syncrow_app/features/devices/model/two_touch_model.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/restart_status_dialog.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
@ -99,11 +100,10 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// Future.delayed(const Duration(seconds: 1),
|
Future.delayed(const Duration(seconds: 2),
|
||||||
// () async {
|
() async {
|
||||||
// oneTouchBloc.add(const InitialEvent(
|
twoTouchBloc.add(const InitialEvent());
|
||||||
// groupScreen: false));
|
});
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -122,8 +122,7 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text:
|
text: twoTouchModel.relay.value,
|
||||||
twoTouchModel.relay.value,
|
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
@ -182,8 +181,12 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// oneTouchBloc.add(const InitialEvent(
|
Future.delayed(
|
||||||
// groupScreen: false));
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
twoTouchBloc
|
||||||
|
.add(const InitialEvent());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@ -261,8 +264,12 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// twoTouchBloc
|
Future.delayed(
|
||||||
// .add(const InitialEvent());
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
twoTouchBloc
|
||||||
|
.add(const InitialEvent());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -324,19 +331,14 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
label2: 'Power On',
|
label2: 'Power On',
|
||||||
label3: 'Restart Memory',
|
label3: 'Restart Memory',
|
||||||
onTapLabel1: (selected) {
|
onTapLabel1: (selected) {
|
||||||
print('selected===$selected');
|
|
||||||
twoTouchBloc.statusSelected =
|
twoTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
onTapLabel2: (selected) {
|
onTapLabel2: (selected) {
|
||||||
print('selected===$selected');
|
|
||||||
|
|
||||||
twoTouchBloc.statusSelected =
|
twoTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
onTapLabel3: (selected) {
|
onTapLabel3: (selected) {
|
||||||
print('selected===$selected');
|
|
||||||
|
|
||||||
twoTouchBloc.statusSelected =
|
twoTouchBloc.statusSelected =
|
||||||
selected;
|
selected;
|
||||||
},
|
},
|
||||||
@ -344,8 +346,12 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
// twoTouchBloc
|
Future.delayed(
|
||||||
// .add(const InitialEvent());
|
const Duration(seconds: 2),
|
||||||
|
() async {
|
||||||
|
twoTouchBloc
|
||||||
|
.add(const InitialEvent());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -362,7 +368,7 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
BodyMedium(
|
BodyMedium(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
text: twoTouchBloc.deviceStatus
|
text: twoTouchBloc.deviceStatus
|
||||||
.relay_status_1.value,
|
.relay_status_2.value,
|
||||||
fontColor:
|
fontColor:
|
||||||
ColorsManager.textGray,
|
ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
@ -386,228 +392,3 @@ class TwoTouchSetting extends StatelessWidget {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RestartStatusDialog extends StatefulWidget {
|
|
||||||
final String label1;
|
|
||||||
final String label2;
|
|
||||||
final String label3;
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
final Function(String)? onTapLabel1;
|
|
||||||
final Function(String)? onTapLabel2;
|
|
||||||
final Function(String)? onTapLabel3;
|
|
||||||
final Function()? cancelTab;
|
|
||||||
final Function()? confirmTab;
|
|
||||||
|
|
||||||
final String? initialSelectedLabel;
|
|
||||||
|
|
||||||
RestartStatusDialog({
|
|
||||||
required this.label1,
|
|
||||||
required this.label2,
|
|
||||||
required this.label3,
|
|
||||||
required this.title,
|
|
||||||
this.onTapLabel1,
|
|
||||||
this.onTapLabel2,
|
|
||||||
this.onTapLabel3,
|
|
||||||
required this.cancelTab,
|
|
||||||
required this.confirmTab,
|
|
||||||
this.initialSelectedLabel,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_RestartStatusDialogState createState() => _RestartStatusDialogState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RestartStatusDialogState extends State<RestartStatusDialog> {
|
|
||||||
late String _selectedOption;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
_selectedOption = widget.initialSelectedLabel ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
BodyLarge(
|
|
||||||
text: widget.title,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontColor: ColorsManager.primaryColor,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(left: 15, right: 15),
|
|
||||||
child: Divider(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 15, right: 15),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label1,
|
|
||||||
onTap: widget.onTapLabel1,
|
|
||||||
),
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label2,
|
|
||||||
onTap: widget.onTapLabel2,
|
|
||||||
),
|
|
||||||
_buildCheckboxOption(
|
|
||||||
label: widget.label3,
|
|
||||||
onTap: widget.onTapLabel3,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
right: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
top: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
child: SizedBox(
|
|
||||||
child: InkWell(
|
|
||||||
onTap: widget.cancelTab,
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(15),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Cancel',
|
|
||||||
style: TextStyle(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
left: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
top: BorderSide(
|
|
||||||
color: ColorsManager.textGray,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: widget.confirmTab,
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(15),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Confirm',
|
|
||||||
style: TextStyle(
|
|
||||||
color: ColorsManager.primaryColor,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildCheckboxOption(
|
|
||||||
{required String label, Function(String)? onTap}) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 10, top: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
BodyMedium(
|
|
||||||
text: label,
|
|
||||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w400),
|
|
||||||
),
|
|
||||||
CircularCheckbox(
|
|
||||||
value: _selectedOption == label,
|
|
||||||
onChanged: (bool? value) {
|
|
||||||
if (value == true) {
|
|
||||||
setState(() {
|
|
||||||
_selectedOption = label;
|
|
||||||
});
|
|
||||||
if (onTap != null) {
|
|
||||||
onTap(label);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CircularCheckbox extends StatefulWidget {
|
|
||||||
final bool value;
|
|
||||||
final ValueChanged<bool?> onChanged;
|
|
||||||
|
|
||||||
CircularCheckbox({required this.value, required this.onChanged});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_CircularCheckboxState createState() => _CircularCheckboxState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CircularCheckboxState extends State<CircularCheckbox> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
widget.onChanged(!widget.value);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
border: Border.all(
|
|
||||||
color: widget.value
|
|
||||||
? ColorsManager.primaryColorWithOpacity.withOpacity(0.01)
|
|
||||||
: Colors.grey,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
color: widget.value
|
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: Colors.transparent,
|
|
||||||
),
|
|
||||||
width: 24.0,
|
|
||||||
height: 24.0,
|
|
||||||
child: widget.value
|
|
||||||
? const Icon(
|
|
||||||
Icons.check,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 16.0,
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -3,8 +3,11 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/one_gang/one_gang_wizard.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/one_gang/one_gang_wizard.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/one_touch/one_touch_wizard.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_wizard.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_wizard.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/three_touch/three_touch_wizard.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/two_gang/two_gang_wizard.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/two_gang/two_gang_wizard.dart';
|
||||||
|
import 'package:syncrow_app/features/devices/view/widgets/two_touch/two_touch_wizard.dart';
|
||||||
import 'package:syncrow_app/features/devices/view/widgets/water_heater/wh_wizard.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/water_heater/wh_wizard.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||||
@ -64,6 +67,30 @@ class WizardPage extends StatelessWidget {
|
|||||||
pageBuilder: (context, animation1, animation2) =>
|
pageBuilder: (context, animation1, animation2) =>
|
||||||
const WHWizard()));
|
const WHWizard()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (groupsList[index].name == '1GT') {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
PageRouteBuilder(
|
||||||
|
pageBuilder: (context, animation1, animation2) =>
|
||||||
|
const OneTouchWizard()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupsList[index].name == '2GT') {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
PageRouteBuilder(
|
||||||
|
pageBuilder: (context, animation1, animation2) =>
|
||||||
|
const TwoTouchWizard()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupsList[index].name == '3GT') {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
PageRouteBuilder(
|
||||||
|
pageBuilder: (context, animation1, animation2) =>
|
||||||
|
const ThreeTouchWizard()));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
padding: const EdgeInsets.all(15),
|
padding: const EdgeInsets.all(15),
|
||||||
|
Reference in New Issue
Block a user