Iodine_deficiency_disorder.dart 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. ///碘缺乏病患者健康教育处方
  7. class IodineDeficiencyDisorder extends StatefulWidget {
  8. @override
  9. State<StatefulWidget> createState() {
  10. return IodineDeficiencyDisorderState();
  11. }
  12. }
  13. class IodineDeficiencyDisorderState extends State<IodineDeficiencyDisorder> {
  14. String? _template;
  15. @override
  16. void initState() {
  17. // Get.find<ITemplateManager>()
  18. // .getTemplateByKey("PrescriptionForIodineDeficiencyDisorder")
  19. // .then((value) {
  20. // setState(() {
  21. // _template = value;
  22. // });
  23. // });
  24. var _path = "assets/prescription_for_Iodine_deficiency_disorder.json";
  25. rootBundle.loadString(_path).then((value) {
  26. setState(() {
  27. _template = value;
  28. });
  29. });
  30. super.initState();
  31. }
  32. @override
  33. Widget build(BuildContext context) {
  34. return _template == null
  35. ? Center(
  36. child: CircularProgressIndicator(),
  37. )
  38. : FormView(_template!);
  39. }
  40. }