mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 19:57:55 +00:00
fixes issues
This commit is contained in:
@@ -1,200 +1,200 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.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/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
// import 'package:flutter_svg/svg.dart';
|
||||
// import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||
// import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||
// import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||
// import 'package:syncrow_app/features/devices/model/device_model.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/text_widgets/body_large.dart';
|
||||
// import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
// import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
// import 'package:syncrow_app/generated/assets.dart';
|
||||
// import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class FourSceneCreateGroup extends StatelessWidget {
|
||||
final DeviceModel? device;
|
||||
// class FourSceneCreateGroup extends StatelessWidget {
|
||||
// final DeviceModel? device;
|
||||
|
||||
const FourSceneCreateGroup({super.key, this.device});
|
||||
// const FourSceneCreateGroup({super.key, this.device});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Create Group',
|
||||
child: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
..add(const FourSceneInitial()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
return state is LoadingNewSate
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: CircularProgressIndicator()),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 25, right: 25),
|
||||
child: BodySmall(
|
||||
text:
|
||||
'Devices in the same group can be controlled together',
|
||||
fontColor: ColorsManager.primaryTextColor,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView.builder(
|
||||
itemCount: sensor.groupDevices.length,
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
BlocProvider.of<FourSceneBloc>(context).add(
|
||||
RemoveDeviceFromGroup(
|
||||
sensor.groupDevices[index],
|
||||
Assets.addDevicesIcon));
|
||||
},
|
||||
child: DefaultContainer(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
sensor.groupDevices[index].icon!,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
BodyMedium(
|
||||
text: sensor
|
||||
.groupDevices[index].name!,
|
||||
fontColor:
|
||||
ColorsManager.primaryTextColor,
|
||||
textAlign: TextAlign.center,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
BodyMedium(
|
||||
text: sensor.groupDevices[index].dec!,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
textAlign: TextAlign.center,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const BodyLarge(
|
||||
text: 'Devices to be added',
|
||||
fontColor: ColorsManager.grayColor,
|
||||
textAlign: TextAlign.center,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
sensor.devices.isNotEmpty
|
||||
? Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: sensor.devices.length,
|
||||
itemBuilder: (context, index) {
|
||||
final device = sensor.devices[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
BlocProvider.of<FourSceneBloc>(
|
||||
context)
|
||||
.add(AddDeviceToGroup(device,
|
||||
Assets.minusIcon));
|
||||
},
|
||||
child: DefaultContainer(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(5.0),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
device.icon!,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
BodyMedium(
|
||||
text: device.name!,
|
||||
fontColor: ColorsManager
|
||||
.primaryTextColor,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
BodyMedium(
|
||||
text: device.dec!,
|
||||
fontColor: ColorsManager
|
||||
.grayColor,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: const Column(
|
||||
children: [
|
||||
BodySmall(
|
||||
text:
|
||||
'Currently no devices available to create group',
|
||||
fontColor: ColorsManager.grayColor,
|
||||
textAlign: TextAlign.center,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer()
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return DefaultScaffold(
|
||||
// title: 'Create Group',
|
||||
// child: BlocProvider(
|
||||
// create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
// ..add(const FourSceneInitial()),
|
||||
// child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
// builder: (context, state) {
|
||||
// final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
// return state is LoadingNewSate
|
||||
// ? const Center(
|
||||
// child: DefaultContainer(
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
// child: CircularProgressIndicator()),
|
||||
// )
|
||||
// : Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// const Padding(
|
||||
// padding: EdgeInsets.only(left: 25, right: 25),
|
||||
// child: BodySmall(
|
||||
// text:
|
||||
// 'Devices in the same group can be controlled together',
|
||||
// fontColor: ColorsManager.primaryTextColor,
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ),
|
||||
// Flexible(
|
||||
// child: ListView.builder(
|
||||
// itemCount: sensor.groupDevices.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return InkWell(
|
||||
// onTap: () {
|
||||
// BlocProvider.of<FourSceneBloc>(context).add(
|
||||
// RemoveDeviceFromGroup(
|
||||
// sensor.groupDevices[index],
|
||||
// Assets.addDevicesIcon));
|
||||
// },
|
||||
// child: DefaultContainer(
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(5.0),
|
||||
// child: Row(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// SvgPicture.asset(
|
||||
// sensor.groupDevices[index].icon!,
|
||||
// fit: BoxFit.contain,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 15,
|
||||
// ),
|
||||
// BodyMedium(
|
||||
// text: sensor
|
||||
// .groupDevices[index].name!,
|
||||
// fontColor:
|
||||
// ColorsManager.primaryTextColor,
|
||||
// textAlign: TextAlign.center,
|
||||
// fontSize: 15,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// BodyMedium(
|
||||
// text: sensor.groupDevices[index].dec!,
|
||||
// fontColor: ColorsManager.grayColor,
|
||||
// textAlign: TextAlign.center,
|
||||
// fontSize: 15,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// )),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// Flexible(
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// const BodyLarge(
|
||||
// text: 'Devices to be added',
|
||||
// fontColor: ColorsManager.grayColor,
|
||||
// textAlign: TextAlign.center,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w700,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
// sensor.devices.isNotEmpty
|
||||
// ? Expanded(
|
||||
// child: ListView.builder(
|
||||
// itemCount: sensor.devices.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// final device = sensor.devices[index];
|
||||
// return GestureDetector(
|
||||
// onTap: () {
|
||||
// BlocProvider.of<FourSceneBloc>(
|
||||
// context)
|
||||
// .add(AddDeviceToGroup(device,
|
||||
// Assets.minusIcon));
|
||||
// },
|
||||
// child: DefaultContainer(
|
||||
// child: Padding(
|
||||
// padding:
|
||||
// const EdgeInsets.all(5.0),
|
||||
// child: Row(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment
|
||||
// .spaceBetween,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// SvgPicture.asset(
|
||||
// device.icon!,
|
||||
// fit: BoxFit.contain,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 15,
|
||||
// ),
|
||||
// BodyMedium(
|
||||
// text: device.name!,
|
||||
// fontColor: ColorsManager
|
||||
// .primaryTextColor,
|
||||
// textAlign:
|
||||
// TextAlign.center,
|
||||
// fontSize: 15,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// BodyMedium(
|
||||
// text: device.dec!,
|
||||
// fontColor: ColorsManager
|
||||
// .grayColor,
|
||||
// textAlign:
|
||||
// TextAlign.center,
|
||||
// fontSize: 15,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// )
|
||||
// : const Column(
|
||||
// children: [
|
||||
// BodySmall(
|
||||
// text:
|
||||
// 'Currently no devices available to create group',
|
||||
// fontColor: ColorsManager.grayColor,
|
||||
// textAlign: TextAlign.center,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer()
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/device_settings/question_page.dart';
|
||||
@@ -24,19 +24,18 @@ class FaqSettingPage extends StatelessWidget {
|
||||
return DefaultScaffold(
|
||||
title: 'FAQ',
|
||||
child: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
..add(const FourSceneInitialQuestion()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
create: (context) => DeviceSettingBloc(deviceId: device?.uuid ?? '')
|
||||
..add(const DeviceSettingInitialQuestion()),
|
||||
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
|
||||
final sensor = BlocProvider.of<DeviceSettingBloc>(context);
|
||||
List<QuestionModel> displayedQuestions = [];
|
||||
if (state is FaqSearchState) {
|
||||
displayedQuestions = state.filteredFaqQuestions;
|
||||
} else if (state is FaqLoadedState) {
|
||||
displayedQuestions = state.filteredFaqQuestions;
|
||||
}
|
||||
return state is FourSceneLoadingState
|
||||
return state is DeviceSettingLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
|
||||
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:percent_indicator/linear_percent_indicator.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/view/device_settings/update_note.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
@@ -15,20 +15,22 @@ import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class UpdatePageSetting extends StatelessWidget {
|
||||
const UpdatePageSetting({super.key});
|
||||
final String? deviceId;
|
||||
const UpdatePageSetting({super.key, this.deviceId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Device Update',
|
||||
child: BlocProvider(
|
||||
create: (context) =>
|
||||
FourSceneBloc(fourSceneId: '')..add(const FourSceneInitial()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
create: (context) => DeviceSettingBloc(deviceId: deviceId ?? '')
|
||||
..add(const DeviceSettingInitial())
|
||||
..add(const DeviceSettingInitialInfo()),
|
||||
child: BlocBuilder<DeviceSettingBloc, DeviceSettingState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
|
||||
|
||||
return state is FourSceneLoadingState
|
||||
return state is DeviceSettingLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
|
||||
@@ -37,8 +37,10 @@ class SixSelectSceneFourPage extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
final sensorBloc = BlocProvider.of<SixSceneBloc>(context);
|
||||
if (state is SaveSelectionSuccessState) {
|
||||
Navigator.of(context).pop(true);
|
||||
Navigator.of(context).pop(true);
|
||||
Future.delayed(const Duration(milliseconds: 250), () {
|
||||
Navigator.of(context).pop(true);
|
||||
Navigator.of(context).pop(true);
|
||||
});
|
||||
}
|
||||
return DefaultScaffold(
|
||||
title: 'Select Scene',
|
||||
@@ -163,7 +165,8 @@ class SixSelectSceneFourPage extends StatelessWidget {
|
||||
disablePlayButton: false,
|
||||
onChanged: (isSelected) {
|
||||
sensorBloc.add(SelectOptionEvent(selectedOption: scene.id));
|
||||
sensorBloc.add(SelectSceneEvent(unitId: scene.id));
|
||||
sensorBloc.add(SelectSceneEvent(
|
||||
selectedSceneId: scene.id, isSelected: isSelected));
|
||||
},
|
||||
icon: scene.iconInBytes,
|
||||
title: scene.name,
|
||||
|
||||
@@ -196,12 +196,14 @@ class SixSceneScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (value == true) {
|
||||
_bloc.add(const SixSceneInitial());
|
||||
_bloc.add(
|
||||
const SixSceneInitialInfo());
|
||||
_bloc.add(
|
||||
const SexSceneSwitchInitial());
|
||||
Future.delayed(
|
||||
const Duration(
|
||||
milliseconds: 250), () {
|
||||
_bloc.add(
|
||||
const SexSceneSwitchInitial());
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
|
||||
@@ -175,12 +175,14 @@ class FourSceneScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (value == true) {
|
||||
_bloc.add(const FourSceneInitial());
|
||||
_bloc.add(
|
||||
const FourSceneInitialInfo());
|
||||
_bloc.add(
|
||||
const FourSceneSwitchInitial());
|
||||
Future.delayed(
|
||||
const Duration(
|
||||
milliseconds: 250), () {
|
||||
_bloc.add(
|
||||
const FourSceneSwitchInitial());
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
|
||||
@@ -37,8 +37,10 @@ class FourSelectSceneFourPage extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
final sensorBloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
if (state is SaveSelectionSuccessState) {
|
||||
Navigator.of(context).pop(true);
|
||||
Navigator.of(context).pop(true);
|
||||
Future.delayed(const Duration(milliseconds: 250), () {
|
||||
Navigator.of(context).pop(true);
|
||||
Navigator.of(context).pop(true);
|
||||
});
|
||||
}
|
||||
return DefaultScaffold(
|
||||
title: 'Select Scene',
|
||||
@@ -153,55 +155,25 @@ class FourSelectSceneFourPage extends StatelessWidget {
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final scene = scenes[index];
|
||||
|
||||
// Check if this scene is currently selected
|
||||
bool isSelected = scene.id ==
|
||||
(state is SceneSelectionUpdatedState
|
||||
? state.selectedSceneId
|
||||
: sensorBloc.selectedFormApiSceneId);
|
||||
|
||||
return SceneItem(
|
||||
id: scene.id,
|
||||
value: isSelected,
|
||||
value: isSelected, // Pass isSelected to the SceneItem
|
||||
disablePlayButton: false,
|
||||
onChanged: (isSelected) {
|
||||
onChanged: (newSelection) {
|
||||
// If selected, assign the scene
|
||||
sensorBloc.add(SelectOptionEvent(selectedOption: scene.id));
|
||||
|
||||
sensorBloc.add(SelectSceneEvent(selectedSceneId: scene.id));
|
||||
sensorBloc.add(SelectSceneEvent(selectedSceneId: scene.id,isSelected:newSelection));
|
||||
},
|
||||
icon: scene.iconInBytes,
|
||||
title: scene.name,
|
||||
);
|
||||
|
||||
// if (index == scenes.length) {
|
||||
// return InkWell(
|
||||
// onTap: () => Navigator.pushNamed(
|
||||
// NavigationService.navigatorKey.currentContext!,
|
||||
// Routes.sceneTasksRoute,
|
||||
// arguments: SceneSettingsRouteArguments(
|
||||
// sceneType: '',
|
||||
// sceneId: '',
|
||||
// sceneName: '',
|
||||
// ),
|
||||
// ),
|
||||
// child: CreateSceneItem(),
|
||||
// );
|
||||
// } else {
|
||||
// final scene = scenes[index];
|
||||
// bool isSelected = scene.id ==
|
||||
// (state is SceneSelectionUpdatedState
|
||||
// ? state.selectedSceneId
|
||||
// : sensorBloc.selectedFormApiSceneId);
|
||||
// return SceneItem(
|
||||
// id: scene.id,
|
||||
// value: isSelected,
|
||||
// disablePlayButton: false,
|
||||
// onChanged: (isSelected) {
|
||||
// sensorBloc.add(SelectOptionEvent(selectedOption: scene.id));
|
||||
|
||||
// sensorBloc.add(SelectSceneEvent(selectedSceneId: scene.id));
|
||||
// },
|
||||
// icon: scene.iconInBytes,
|
||||
// title: scene.name,
|
||||
// );
|
||||
// }
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -317,3 +289,37 @@ class CreateSceneItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (index == scenes.length) {
|
||||
// return InkWell(
|
||||
// onTap: () => Navigator.pushNamed(
|
||||
// NavigationService.navigatorKey.currentContext!,
|
||||
// Routes.sceneTasksRoute,
|
||||
// arguments: SceneSettingsRouteArguments(
|
||||
// sceneType: '',
|
||||
// sceneId: '',
|
||||
// sceneName: '',
|
||||
// ),
|
||||
// ),
|
||||
// child: CreateSceneItem(),
|
||||
// );
|
||||
// } else {
|
||||
// final scene = scenes[index];
|
||||
// bool isSelected = scene.id ==
|
||||
// (state is SceneSelectionUpdatedState
|
||||
// ? state.selectedSceneId
|
||||
// : sensorBloc.selectedFormApiSceneId);
|
||||
// return SceneItem(
|
||||
// id: scene.id,
|
||||
// value: isSelected,
|
||||
// disablePlayButton: false,
|
||||
// onChanged: (isSelected) {
|
||||
// sensorBloc.add(SelectOptionEvent(selectedOption: scene.id));
|
||||
|
||||
// sensorBloc.add(SelectSceneEvent(selectedSceneId: scene.id));
|
||||
// },
|
||||
// icon: scene.iconInBytes,
|
||||
// title: scene.name,
|
||||
// );
|
||||
// }
|
||||
Reference in New Issue
Block a user