mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 10:06:16 +00:00
push functions static data
This commit is contained in:
57
lib/features/scene/widgets/alert_dialog_functions_body.dart
Normal file
57
lib/features/scene/widgets/alert_dialog_functions_body.dart
Normal file
@ -0,0 +1,57 @@
|
||||
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: 22,
|
||||
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;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user