exam_input.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * @Descripttion:
  3. * @version:
  4. * @Author: guanxiaoxin
  5. * @Date: 2023-10-07 14:24:20
  6. * @LastEditors: guanxiaoxin
  7. * @LastEditTime: 2023-10-09 13:06:06
  8. * @FilePath: \VNoteApp\lib\pages\check\widgets\exam_configurable\exam_input.dart
  9. */
  10. import 'package:flutter/material.dart';
  11. import 'package:vitalapp/pages/check/models/form.dart';
  12. import 'package:vitalapp/pages/check/widgets/exam_configurable/exam_card.dart';
  13. class ExamInput extends StatefulWidget {
  14. const ExamInput({
  15. super.key,
  16. required this.currentFormObject,
  17. required this.currentInputValue,
  18. this.commonInput,
  19. });
  20. final FormObject currentFormObject;
  21. final String currentInputValue;
  22. final Function? commonInput;
  23. @override
  24. State<ExamInput> createState() => _ExamInputState();
  25. }
  26. class _ExamInputState extends State<ExamInput> {
  27. TextEditingController specialInputController = TextEditingController();
  28. @override
  29. Widget build(BuildContext context) {
  30. return ExamCard(
  31. title: widget.currentFormObject.label ?? '',
  32. clickCard: () {
  33. widget.commonInput?.call();
  34. },
  35. content: Container(
  36. alignment: Alignment.bottomRight,
  37. padding: const EdgeInsets.only(
  38. bottom: 20,
  39. right: 30,
  40. left: 40,
  41. ),
  42. constraints: const BoxConstraints(minHeight: 50),
  43. child: RichText(
  44. text: TextSpan(
  45. text: widget.currentInputValue,
  46. style: const TextStyle(
  47. fontSize: 26,
  48. color: Colors.black,
  49. ),
  50. children: [
  51. TextSpan(
  52. text: widget.currentFormObject.append ?? '',
  53. style: const TextStyle(fontSize: 26),
  54. )
  55. ],
  56. ),
  57. ),
  58. ),
  59. );
  60. }
  61. }