exam_toxic_substance.dart 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import 'package:flutter/material.dart';
  2. import 'package:vnoteapp/pages/check/models/form.dart';
  3. import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
  4. // ignore: must_be_immutable
  5. class ExamToxicSubstance extends StatelessWidget {
  6. const ExamToxicSubstance({
  7. super.key,
  8. required this.currentFormObject,
  9. required this.options,
  10. required this.selectRaidoChange,
  11. required this.currentSelected,
  12. // required this.changeScore,
  13. // required this.currentScore,
  14. });
  15. final FormObject currentFormObject;
  16. final List<Option> options;
  17. final Function selectRaidoChange;
  18. final String currentSelected;
  19. // final Function changeScore;
  20. // final String currentScore;
  21. @override
  22. Widget build(BuildContext context) {
  23. return ExamCard(
  24. title: currentFormObject.label ?? '',
  25. content: Column(
  26. children: [
  27. Container(
  28. padding: const EdgeInsets.all(32).copyWith(
  29. top: 0,
  30. ),
  31. child: TextField(
  32. readOnly: true,
  33. controller: TextEditingController(text: ''),
  34. style: const TextStyle(fontSize: 30),
  35. onTap: () => {},
  36. ),
  37. ),
  38. Container(
  39. alignment: Alignment.centerLeft,
  40. padding: const EdgeInsets.only(left: 32, bottom: 12),
  41. child: const Text(
  42. '防护措施:',
  43. style: TextStyle(
  44. fontSize: 25,
  45. ),
  46. ),
  47. ),
  48. Container(
  49. padding: const EdgeInsets.symmetric(
  50. horizontal: 16,
  51. ),
  52. width: double.infinity,
  53. child: Row(
  54. children: [
  55. Wrap(
  56. children: options
  57. .map(
  58. (e) => Container(
  59. padding: const EdgeInsets.all(8),
  60. child: InkWell(
  61. onTap: () => selectRaidoChange(e),
  62. borderRadius: BorderRadius.circular(50),
  63. child: Ink(
  64. decoration: BoxDecoration(
  65. border: Border.all(
  66. color: currentSelected == e.value
  67. ? Colors.blue
  68. : Colors.black26,
  69. ),
  70. borderRadius: const BorderRadius.all(
  71. Radius.circular(50),
  72. ),
  73. color: currentSelected == e.value
  74. ? Colors.blue
  75. : Colors.transparent,
  76. ),
  77. child: Container(
  78. padding: const EdgeInsets.all(15),
  79. alignment: Alignment.center,
  80. width: 250,
  81. child: FittedBox(
  82. child: Text(
  83. e.label ?? '',
  84. style: TextStyle(
  85. fontSize: 20,
  86. color: currentSelected == e.value
  87. ? Colors.white
  88. : Colors.black54,
  89. ),
  90. ),
  91. ),
  92. ),
  93. ),
  94. ),
  95. ),
  96. )
  97. .toList(),
  98. ),
  99. if (currentSelected == '2')
  100. Container(
  101. child: Row(
  102. children: [
  103. const SizedBox(
  104. width: 16,
  105. ),
  106. SizedBox(
  107. width: 200,
  108. child: TextField(
  109. readOnly: true,
  110. controller: TextEditingController(text: ''),
  111. style: const TextStyle(fontSize: 30),
  112. onTap: () => {},
  113. ),
  114. )
  115. ],
  116. ),
  117. )
  118. ],
  119. ),
  120. ),
  121. ],
  122. ),
  123. );
  124. }
  125. }