mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 21:34:56 +00:00
four_scene
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_state.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/devices/model/six_scene_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/four_scene_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';
|
||||
@ -13,29 +13,35 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dar
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class SixSceneInfoPage extends StatelessWidget {
|
||||
class FourSceneInfoPage extends StatelessWidget {
|
||||
final DeviceModel? device;
|
||||
|
||||
const SixSceneInfoPage({super.key, this.device});
|
||||
const FourSceneInfoPage({super.key, this.device});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Device Information',
|
||||
child: BlocProvider(
|
||||
create: (context) => SixSceneBloc(sixSceneId: device?.uuid ?? '')
|
||||
..add(const SixSceneInitial()),
|
||||
child: BlocBuilder<SixSceneBloc, SixSceneState>(
|
||||
create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
..add(const FourSceneInitial())
|
||||
..add(FourSceneInitialInfo()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<SixSceneBloc>(context);
|
||||
SixSceneModel model = SixSceneModel(
|
||||
batteryPercentage: 0, waterContactState: 'normal');
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
FourSceneModel model = FourSceneModel(
|
||||
scene_1: '',
|
||||
scene_2: '',
|
||||
scene_3: '',
|
||||
scene_4: '',
|
||||
scene_id_group_id: '',
|
||||
switch_backlight: '');
|
||||
if (state is LoadingNewSate) {
|
||||
model = state.sosSensor;
|
||||
} else if (state is UpdateState) {
|
||||
model = state.sensor;
|
||||
}
|
||||
return state is SixSceneLoadingState
|
||||
return state is FourSceneLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
@ -44,11 +50,11 @@ class SixSceneInfoPage extends StatelessWidget {
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
sensor.add(const SixSceneInitial());
|
||||
_bloc.add(const FourSceneInitial());
|
||||
},
|
||||
child: DefaultContainer(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
padding: const EdgeInsets.only(left: 5, right: 5),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -63,12 +69,24 @@ class SixSceneInfoPage extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const BodySmall(
|
||||
text: 'bf3575d0e0c8b6e0a6hybl',
|
||||
BodySmall(
|
||||
text: _bloc.deviceInfo.productUuid,
|
||||
fontColor: ColorsManager.primaryTextColor,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(
|
||||
text: _bloc.deviceInfo.productUuid,
|
||||
),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Copied to Clipboard"),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(
|
||||
@ -87,18 +105,18 @@ class SixSceneInfoPage extends StatelessWidget {
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
const Column(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyLarge(
|
||||
const BodyLarge(
|
||||
text: 'MAC',
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontColor: ColorsManager.blackColor,
|
||||
),
|
||||
BodySmall(
|
||||
text: 'bf3575d0e0c8b6e0a6hybl',
|
||||
text: _bloc.deviceInfo.macAddress,
|
||||
fontColor: ColorsManager.primaryTextColor,
|
||||
),
|
||||
],
|
||||
@ -106,18 +124,18 @@ class SixSceneInfoPage extends StatelessWidget {
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
const Column(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyLarge(
|
||||
const BodyLarge(
|
||||
text: 'Time Zone',
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontColor: ColorsManager.blackColor,
|
||||
),
|
||||
BodySmall(
|
||||
text: 'Asia/Dubai',
|
||||
text: _bloc.deviceInfo.timeZone,
|
||||
fontColor: ColorsManager.primaryTextColor,
|
||||
),
|
||||
],
|
||||
|
||||
@ -27,10 +27,11 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
title: 'Device Settings',
|
||||
child: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
..add(const FourSceneInitial()),
|
||||
..add(const FourSceneInitial())
|
||||
..add(FourSceneInitialInfo()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
FourSceneModel model = FourSceneModel(
|
||||
scene_1: '',
|
||||
scene_2: '',
|
||||
@ -52,7 +53,7 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
sensor.add(const FourSceneInitial());
|
||||
_bloc.add(const FourSceneInitial());
|
||||
},
|
||||
child: ListView(
|
||||
children: [
|
||||
@ -88,9 +89,9 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
color: Colors.black,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
focusNode: sensor.focusNode,
|
||||
controller: sensor.nameController,
|
||||
enabled: sensor.editName,
|
||||
focusNode: _bloc.focusNode,
|
||||
controller: _bloc.nameController,
|
||||
enabled: _bloc.editName,
|
||||
onEditingComplete: () {
|
||||
// sensor.add(SaveNameEvent(context: context));
|
||||
},
|
||||
@ -106,8 +107,7 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
const SizedBox(width: 5),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
sensor
|
||||
.add(const ChangeNameEvent(value: true));
|
||||
_bloc.add(const ChangeNameEvent(value: true));
|
||||
},
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
@ -136,10 +136,11 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LocationFourScenePage(
|
||||
space: spaces!.first,
|
||||
deviceId: device?.uuid ?? '',
|
||||
)),
|
||||
);
|
||||
},
|
||||
child: const Row(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
@ -149,7 +150,8 @@ class FourSceneProfilePage extends StatelessWidget {
|
||||
children: [
|
||||
SizedBox(
|
||||
child: BodyMedium(
|
||||
text: 'Syncroom',
|
||||
text: _bloc
|
||||
.deviceInfo.subspace.subspaceName,
|
||||
fontColor: ColorsManager.textGray,
|
||||
),
|
||||
),
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/faq_four_scene_page.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_create_group.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_delete_dialog.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_info_page.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_profile_page.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_update_dialog.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/four_scene_switch/four_scene_setting/four_scene_update_page.dart';
|
||||
@ -33,10 +34,11 @@ class FourSceneSettings extends StatelessWidget {
|
||||
title: 'Device Settings',
|
||||
child: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: device?.uuid ?? '')
|
||||
..add(const FourSceneInitial()),
|
||||
..add(const FourSceneInitial())
|
||||
..add(FourSceneInitialInfo()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
FourSceneModel model = FourSceneModel(
|
||||
scene_1: '',
|
||||
scene_2: '',
|
||||
@ -58,7 +60,7 @@ class FourSceneSettings extends StatelessWidget {
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
sensor.add(const FourSceneInitial());
|
||||
_bloc.add(const FourSceneInitial());
|
||||
},
|
||||
child: ListView(
|
||||
children: [
|
||||
@ -70,25 +72,27 @@ class FourSceneSettings extends StatelessWidget {
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const FourSceneProfilePage(),
|
||||
builder: (context) => FourSceneProfilePage(
|
||||
device: device,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
const Column(
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
DefaultContainer(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(30)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(30)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 90),
|
||||
padding:
|
||||
const EdgeInsets.only(left: 90),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
@ -98,17 +102,20 @@ class FourSceneSettings extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
BodyMedium(
|
||||
text: '4 Scene Switch',
|
||||
text: _bloc.deviceInfo.name,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
BodySmall(
|
||||
text: "Room: Syncrow"),
|
||||
text: _bloc
|
||||
.deviceInfo
|
||||
.subspace
|
||||
.subspaceName),
|
||||
],
|
||||
),
|
||||
Icon(Icons.edit_sharp)
|
||||
const Icon(Icons.edit_sharp)
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -152,11 +159,10 @@ class FourSceneSettings extends StatelessWidget {
|
||||
children: [
|
||||
SettingWidget(
|
||||
onTap: () {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// const FourSceneInfoPage()),
|
||||
// );
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => FourSceneInfoPage( device: device!,)),
|
||||
);
|
||||
},
|
||||
text: 'Device Information',
|
||||
icon: Assets.infoIcon,
|
||||
|
||||
@ -3,56 +3,37 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/model/space_model.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/four_scene_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/subspace_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_medium.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
import '../../../../bloc/four_scene_bloc/four_scene_event.dart';
|
||||
|
||||
class LocationFourScenePage extends StatefulWidget {
|
||||
class LocationFourScenePage extends StatelessWidget {
|
||||
final SpaceModel? space;
|
||||
LocationFourScenePage({super.key, this.space});
|
||||
final String? deviceId;
|
||||
|
||||
@override
|
||||
_LocationFourScenePageState createState() => _LocationFourScenePageState();
|
||||
}
|
||||
|
||||
class _LocationFourScenePageState extends State<LocationFourScenePage> {
|
||||
String _selectedOption = 'Conference Room';
|
||||
bool _hasSelectionChanged = false;
|
||||
const LocationFourScenePage({
|
||||
super.key,
|
||||
this.space,
|
||||
this.deviceId,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Device Location',
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: _hasSelectionChanged
|
||||
? () {
|
||||
print('Save button clicked');
|
||||
}
|
||||
: null,
|
||||
child: BodyMedium(
|
||||
text: 'Save',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 16,
|
||||
fontColor: _hasSelectionChanged
|
||||
? ColorsManager.slidingBlueColor
|
||||
: ColorsManager.primaryTextColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
],
|
||||
child: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: '')
|
||||
..add(FetchRoomsEvent(unit: widget.space!)),
|
||||
String roomIdSelected = '';
|
||||
|
||||
return Scaffold(
|
||||
body: BlocProvider(
|
||||
create: (context) => FourSceneBloc(fourSceneId: deviceId ?? '')
|
||||
..add(const FourSceneInitial())
|
||||
..add(FourSceneInitialInfo())
|
||||
..add(FetchRoomsEvent(unit: space!)),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final sensor = BlocProvider.of<FourSceneBloc>(context);
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
FourSceneModel model = FourSceneModel(
|
||||
scene_1: '',
|
||||
scene_2: '',
|
||||
@ -60,12 +41,6 @@ class _LocationFourScenePageState extends State<LocationFourScenePage> {
|
||||
scene_4: '',
|
||||
scene_id_group_id: '',
|
||||
switch_backlight: '');
|
||||
List<SubSpaceModel>? rooms = [];
|
||||
if (state is LoadingNewSate) {
|
||||
model = state.sosSensor;
|
||||
} else if (state is FetchRoomsState) {
|
||||
rooms = state.roomsList;
|
||||
}
|
||||
return state is FourSceneLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
@ -74,52 +49,92 @@ class _LocationFourScenePageState extends State<LocationFourScenePage> {
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
sensor.add(const FourSceneInitial());
|
||||
},
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
children: [
|
||||
const BodyMedium(
|
||||
text: 'Smart Device Location',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
DefaultContainer(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: rooms!.length,
|
||||
itemBuilder: (context, index) {
|
||||
final room = rooms![index];
|
||||
return Column(
|
||||
children: [
|
||||
_buildCheckboxOption(
|
||||
label: room.name!,
|
||||
onTap: (v) {
|
||||
setState(() {
|
||||
_selectedOption = v;
|
||||
_hasSelectionChanged = true;
|
||||
});
|
||||
},
|
||||
),
|
||||
if (index < rooms.length - 1) ...[
|
||||
const SizedBox(height: 10),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
],
|
||||
);
|
||||
},
|
||||
: DefaultScaffold(
|
||||
actions: [
|
||||
BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final bool canSave = state is OptionSelectedState &&
|
||||
state.hasSelectionChanged;
|
||||
return InkWell(
|
||||
onTap: canSave
|
||||
? () {
|
||||
context.read<FourSceneBloc>().add(
|
||||
AssignRoomEvent(
|
||||
roomId: roomIdSelected,
|
||||
unit: space!));
|
||||
}
|
||||
: null,
|
||||
child: BodyMedium(
|
||||
text: 'Save',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 16,
|
||||
fontColor: canSave
|
||||
? ColorsManager.slidingBlueColor
|
||||
: ColorsManager.primaryTextColor,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
],
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
// sensor.add(const SosInitial());
|
||||
},
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
children: [
|
||||
const BodyMedium(
|
||||
text: 'Smart Device Location',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 5),
|
||||
DefaultContainer(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: _bloc.roomsList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final fromRoom = _bloc.roomsList[index];
|
||||
final isSelected = (state
|
||||
is OptionSelectedState &&
|
||||
state.selectedOption == fromRoom.id) ||
|
||||
(state is! OptionSelectedState &&
|
||||
fromRoom.id ==
|
||||
_bloc.deviceInfo.subspace.uuid);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
_buildCheckboxOption(
|
||||
label: fromRoom.name!,
|
||||
isSelected: isSelected,
|
||||
onTap: (label) {
|
||||
context.read<FourSceneBloc>().add(
|
||||
SelectOptionEvent(
|
||||
selectedOption: fromRoom.id!,
|
||||
),
|
||||
);
|
||||
roomIdSelected = fromRoom.id!;
|
||||
},
|
||||
),
|
||||
if (index < _bloc.roomsList.length - 1) ...[
|
||||
const SizedBox(height: 10),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@ -127,34 +142,6 @@ class _LocationFourScenePageState extends State<LocationFourScenePage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxOption(
|
||||
{required String label, required 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;
|
||||
_hasSelectionChanged = true;
|
||||
});
|
||||
onTap(label);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CircularCheckbox extends StatefulWidget {
|
||||
@ -200,3 +187,30 @@ class _CircularCheckboxState extends State<CircularCheckbox> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildCheckboxOption({
|
||||
required String label,
|
||||
required bool isSelected,
|
||||
required 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: isSelected,
|
||||
onChanged: (bool? value) {
|
||||
if (value == true) {
|
||||
onTap(label);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ class FourSelectSceneFourPage extends StatelessWidget {
|
||||
onTap: canSave
|
||||
? () {
|
||||
print('object');
|
||||
context.read<FourSceneBloc>().add(SaveSelectionEvent());
|
||||
// context.read<FourSceneBloc>().add(SaveSelectionEvent());
|
||||
}
|
||||
: null,
|
||||
child: BodyMedium(
|
||||
|
||||
Reference in New Issue
Block a user