under_fiveMalnutrition_prescription.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:get/get.dart';
  4. import 'package:vitalapp/managers/interfaces/template.dart';
  5. import 'package:vitalapp/pages/form/form_view.dart';
  6. ///5岁以下儿童营养不良患者健康教育处方
  7. class UnderFiveMalnutritionPrescription extends StatefulWidget {
  8. @override
  9. State<StatefulWidget> createState() {
  10. return UnderFiveMalnutritionPrescriptionState();
  11. }
  12. }
  13. class UnderFiveMalnutritionPrescriptionState
  14. extends State<UnderFiveMalnutritionPrescription> {
  15. String? _template;
  16. @override
  17. void initState() {
  18. var _path = "assets/under_fiveMalnutrition_prescription.json";
  19. rootBundle.loadString(_path).then((value) {
  20. setState(() {
  21. _template = value;
  22. });
  23. });
  24. // Get.find<ITemplateManager>()
  25. // .getTemplateByKey("UnderFiveMalnutritionPrescription")
  26. // .then((value) {
  27. // setState(() {
  28. // _template = value;
  29. // });
  30. // });
  31. super.initState();
  32. }
  33. @override
  34. Widget build(BuildContext context) {
  35. return _template == null
  36. ? Center(
  37. child: CircularProgressIndicator(),
  38. )
  39. : FormView(_template!);
  40. }
  41. }