mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
58 lines
1.7 KiB
Dart
58 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
|
|
import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart';
|
|
|
|
class AlertDialogFunctionsOperationsBody extends StatefulWidget {
|
|
const AlertDialogFunctionsOperationsBody({
|
|
super.key,
|
|
required this.functions,
|
|
required this.index,
|
|
});
|
|
|
|
final List<SceneStaticFunction> functions;
|
|
final int index;
|
|
|
|
@override
|
|
State<AlertDialogFunctionsOperationsBody> createState() =>
|
|
_AlertDialogFunctionsOperationsBodyState();
|
|
}
|
|
|
|
class _AlertDialogFunctionsOperationsBodyState
|
|
extends State<AlertDialogFunctionsOperationsBody> {
|
|
String? groupValue = "";
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
...widget.functions[widget.index].operationalValues.map(
|
|
(operation) => SceneListTile(
|
|
iconsSize: 25,
|
|
minLeadingWidth: 15,
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
assetPath: operation.icon,
|
|
titleString: operation.value,
|
|
textAlign: TextAlign.start,
|
|
trailingWidget: Radio(
|
|
value: operation.value,
|
|
groupValue: groupValue,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
groupValue = value;
|
|
});
|
|
},
|
|
),
|
|
onPressed: () {
|
|
setState(() {
|
|
groupValue = operation.value;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|