tuberculosis_prescription.dart 918 B

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