123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import 'package:flutter/material.dart';
- import 'package:vitalapp/components/dialog_number.dart';
- import 'package:vitalapp/pages/check/models/form.dart';
- import 'package:vitalapp/pages/check/widgets/exam_configurable/exam_card.dart';
- // ignore: must_be_immutable
- class ExamBodyTemperature extends StatefulWidget {
- ExamBodyTemperature({
- super.key,
- required this.currentFormObject,
- required this.currentInputValue,
- this.bodyTemperatureInput,
- });
- FormObject currentFormObject;
- String currentInputValue;
- Function(String value)? bodyTemperatureInput;
- @override
- State<ExamBodyTemperature> createState() => _ExamBodyTemperatureState();
- }
- class _ExamBodyTemperatureState extends State<ExamBodyTemperature> {
- @override
- void initState() {
- super.initState();
- }
- @override
- void dispose() {
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- return Stack(
- children: [
- _buildTemperature(),
- ],
- );
- }
- Widget _buildTemperature() {
- return ExamCard(
- title: widget.currentFormObject.label ?? '',
- clickCard: () {
- _inputTemperature();
- },
- content: Container(
- alignment: Alignment.bottomRight,
- padding: const EdgeInsets.only(
- bottom: 20,
- right: 30,
- left: 40,
- ),
- constraints: const BoxConstraints(minHeight: 50),
- child: FittedBox(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.end,
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- RichText(
- text: TextSpan(
- text: widget.currentInputValue,
- style: const TextStyle(
- fontSize: 26,
- color: Colors.black,
- ),
- children: [
- TextSpan(
- text: widget.currentFormObject.append ?? '',
- style: const TextStyle(fontSize: 26),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- Future<void> _inputTemperature() async {
- String? result = await VDialogNumber(
- title: widget.currentFormObject.label,
- initialValue: widget.currentInputValue,
- ).show();
- if (result?.isNotEmpty ?? false) {
- widget.currentInputValue = result ?? '';
- widget.bodyTemperatureInput!.call(widget.currentInputValue);
- }
- }
- }
|