import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'package:vitalapp/managers/interfaces/template.dart'; import 'package:vitalapp/pages/form/form_view.dart'; ///5岁以下儿童营养不良患者健康教育处方 class UnderFiveMalnutritionPrescription extends StatefulWidget { @override State createState() { return UnderFiveMalnutritionPrescriptionState(); } } class UnderFiveMalnutritionPrescriptionState extends State { String? _template; @override void initState() { var _path = "assets/under_fiveMalnutrition_prescription.json"; rootBundle.loadString(_path).then((value) { setState(() { _template = value; }); }); // Get.find() // .getTemplateByKey("UnderFiveMalnutritionPrescription") // .then((value) { // setState(() { // _template = value; // }); // }); super.initState(); } @override Widget build(BuildContext context) { return _template == null ? Center( child: CircularProgressIndicator(), ) : FormView(_template!); } }