trichomoniasis_vaginitis.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 TrichomoniasisVaginitis extends StatefulWidget {
  8. @override
  9. State<StatefulWidget> createState() {
  10. return TrichomoniasisVaginitisState();
  11. }
  12. }
  13. class TrichomoniasisVaginitisState extends State<TrichomoniasisVaginitis> {
  14. String? _template;
  15. @override
  16. void initState() {
  17. // Get.find<ITemplateManager>()
  18. // .getTemplateByKey("PrescriptionForTrichomoniasisVaginitis")
  19. // .then((value) {
  20. // setState(() {
  21. // _template = value;
  22. // });
  23. // });
  24. var _path = "assets/prescription_for_trichomoniasis_vaginitis.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. }