hypertrophic_osteoarthropathy_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. ///大骨节病患者健康教育处方
  7. class HypertrophicOsteoarthropathy extends StatefulWidget {
  8. @override
  9. State<StatefulWidget> createState() {
  10. return HypertrophicOsteoarthropathyState();
  11. }
  12. }
  13. class HypertrophicOsteoarthropathyState
  14. extends State<HypertrophicOsteoarthropathy> {
  15. String? _template;
  16. @override
  17. void initState() {
  18. // Get.find<ITemplateManager>()
  19. // .getTemplateByKey("HypertrophicOsteoarthropathyPrescription")
  20. // .then((value) {
  21. // setState(() {
  22. // _template = value;
  23. // });
  24. // });
  25. var _path = "assets/hypertrophic_osteoarthropathy_prescription.json";
  26. rootBundle.loadString(_path).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. }