|
@@ -4,21 +4,21 @@ import 'package:fis_measure/interfaces/process/items/item_metas.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
import 'package:fis_measure/process/primitives/rvsp.dart';
|
|
|
import 'package:fis_measure/utils/prompt_box.dart';
|
|
|
+import 'package:fis_measure/view/measure/custom_item_buttons/widgets.dart';
|
|
|
import 'package:fis_ui/index.dart';
|
|
|
-import 'package:fis_ui/interface/interactive_container.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
import 'normal_child.dart';
|
|
|
|
|
|
-class RVSPItemButton extends FStatefulWidget {
|
|
|
- const RVSPItemButton({super.key});
|
|
|
+class RapItemButton extends FStatefulWidget {
|
|
|
+ const RapItemButton({super.key});
|
|
|
|
|
|
@override
|
|
|
- FState<FStatefulWidget> createState() => _RVSPItemButtonState();
|
|
|
+ FState<FStatefulWidget> createState() => _RapItemButtonState();
|
|
|
}
|
|
|
|
|
|
-class _RVSPItemButtonState extends FState<RVSPItemButton> {
|
|
|
+class _RapItemButtonState extends FState<RapItemButton> {
|
|
|
static const _options = <double>[double.nan, 5, 10, 15];
|
|
|
late final RxInt _activeIndex;
|
|
|
double _customRapValue = 0;
|
|
@@ -132,6 +132,7 @@ class _RVSPItemButtonState extends FState<RVSPItemButton> {
|
|
|
return CustomChildInputOptionWidget(
|
|
|
isActive: isActive,
|
|
|
value: _customRapValue.toString(),
|
|
|
+ suffixWidget: const Text(" mmHg"),
|
|
|
onClick: () {
|
|
|
_activeIndex.value = index;
|
|
|
},
|
|
@@ -146,127 +147,3 @@ class _RVSPItemButtonState extends FState<RVSPItemButton> {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-class CustomChildInputOptionWidget extends StatelessWidget {
|
|
|
- final bool isActive;
|
|
|
- final String value;
|
|
|
- final Widget? suffixWidget;
|
|
|
- final VoidCallback onClick;
|
|
|
- final ValueChanged<String> onInputChanged;
|
|
|
-
|
|
|
- const CustomChildInputOptionWidget({
|
|
|
- super.key,
|
|
|
- required this.isActive,
|
|
|
- required this.value,
|
|
|
- required this.onClick,
|
|
|
- required this.onInputChanged,
|
|
|
- this.suffixWidget,
|
|
|
- });
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return CustomChildOptionWidget(
|
|
|
- isActive: isActive,
|
|
|
- onClick: onClick,
|
|
|
- child: _buildInput(context),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Widget _buildInput(BuildContext context) {
|
|
|
- final children = <Widget>[];
|
|
|
- children.add(
|
|
|
- FBorderInput(
|
|
|
- controller: TextEditingController(text: value),
|
|
|
- onChanged: (value) {
|
|
|
- onInputChanged.call(value);
|
|
|
- },
|
|
|
- ),
|
|
|
- );
|
|
|
- if (suffixWidget != null) {
|
|
|
- children.add(suffixWidget!);
|
|
|
- }
|
|
|
- return Row(
|
|
|
- children: children,
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class CustomChildOptionDivider extends StatelessWidget {
|
|
|
- const CustomChildOptionDivider({super.key});
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Divider(color: Colors.grey.shade100, height: 1);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class CustomChildTextOptionWidget extends StatelessWidget {
|
|
|
- final bool isActive;
|
|
|
- final String text;
|
|
|
- final VoidCallback onClick;
|
|
|
-
|
|
|
- const CustomChildTextOptionWidget({
|
|
|
- super.key,
|
|
|
- required this.isActive,
|
|
|
- required this.text,
|
|
|
- required this.onClick,
|
|
|
- });
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return CustomChildOptionWidget(
|
|
|
- child: Text(text),
|
|
|
- isActive: isActive,
|
|
|
- onClick: onClick,
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class CustomChildOptionWidget extends StatelessWidget {
|
|
|
- final bool isActive;
|
|
|
- final Widget child;
|
|
|
- final VoidCallback onClick;
|
|
|
-
|
|
|
- const CustomChildOptionWidget({
|
|
|
- super.key,
|
|
|
- required this.isActive,
|
|
|
- required this.child,
|
|
|
- required this.onClick,
|
|
|
- });
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Material(
|
|
|
- child: Container(
|
|
|
- margin: const EdgeInsets.only(bottom: 4),
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- onClick.call();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 18),
|
|
|
- alignment: Alignment.center,
|
|
|
- color: isActive
|
|
|
- ? Theme.of(context).secondaryHeaderColor
|
|
|
- : Colors.white,
|
|
|
- child: child,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class FPlaceHolderInteractiveContainer extends FStatelessWidget
|
|
|
- implements FInteractiveContainer {
|
|
|
- const FPlaceHolderInteractiveContainer({super.key});
|
|
|
-
|
|
|
- @override
|
|
|
- FWidget build(BuildContext context) {
|
|
|
- return const FSizedBox();
|
|
|
- }
|
|
|
-
|
|
|
- @override
|
|
|
- String get pageName => "";
|
|
|
-}
|