psychiatric_prescription.dart 953 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 PsychiatricPrescription extends StatefulWidget {
  8. @override
  9. State<StatefulWidget> createState() {
  10. return PsychiatricPrescriptionState();
  11. }
  12. }
  13. class PsychiatricPrescriptionState extends State<PsychiatricPrescription> {
  14. String? _template;
  15. @override
  16. void initState() {
  17. Get.find<ITemplateManager>()
  18. .getTemplateByKey("PsychiatricPrescription")
  19. .then((value) {
  20. setState(() {
  21. _template = value;
  22. });
  23. });
  24. super.initState();
  25. }
  26. @override
  27. Widget build(BuildContext context) {
  28. return _template == null
  29. ? Center(
  30. child: CircularProgressIndicator(),
  31. )
  32. : FormView(_template!);
  33. }
  34. }