123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- import 'package:flutter/material.dart';
- import 'package:vitalapp/components/button.dart';
- import 'package:vitalapp/pages/check/models/form.dart';
- import 'package:vitalapp/pages/check/widgets/exam_configurable/exam_radio_and_select.dart';
- class FollowUpGxyAndTnbMedication extends StatelessWidget {
- final List<dynamic>? currentValues;
- final Function? addVeterinaryDrug;
- final FormObject currentFormObject;
- final Function? deleteVeterinaryDrug;
- final Function? editVeterinaryDrug;
- const FollowUpGxyAndTnbMedication({
- super.key,
- this.currentValues,
- this.addVeterinaryDrug,
- required this.currentFormObject,
- this.deleteVeterinaryDrug,
- this.editVeterinaryDrug,
- });
- @override
- Widget build(BuildContext context) {
- return Stack(
- children: [
- ExamCardRadioSelect(
- title: currentFormObject.label ?? "",
- required: currentFormObject.required,
- clickCard: null,
- content: Container(
- alignment: Alignment.centerLeft,
- padding: const EdgeInsets.only(
- right: 20,
- left: 20,
- bottom: 10,
- ),
- child: Column(children: [
- ...currentValues!.asMap().entries.map((entry) {
- var medicationModel = MedicationModel.fromJson(entry.value);
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Expanded(
- child: Text(
- "药物${entry.key + 1}:${medicationModel.name} 用法:${medicationModel.usage}次 每次${medicationModel.dosages}",
- style: TextStyle(fontSize: 18, color: Colors.black54),
- textAlign: TextAlign.left,
- ),
- ),
- IconButton(
- onPressed: () {
- editVeterinaryDrug!(entry.key);
- },
- icon: Icon(Icons.edit),
- ),
- IconButton(
- onPressed: () {
- deleteVeterinaryDrug!(entry.key);
- },
- icon: Icon(Icons.delete),
- ),
- ],
- );
- }).toList()
- ]),
- ),
- ),
- Positioned(
- right: 16,
- top: 8,
- child: SizedBox(
- width: 130,
- height: 54,
- child: VButton(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: const [
- Icon(Icons.add, size: 24),
- SizedBox(
- width: 8,
- ),
- Text(
- "新增",
- style: TextStyle(
- fontSize: 20,
- ),
- )
- ],
- ),
- onTap: () {
- addVeterinaryDrug!();
- },
- ),
- ),
- ),
- ],
- );
- }
- }
|