123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- import 'package:flutter/material.dart';
- import 'package:vnoteapp/pages/check/models/form.dart';
- import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
- // ignore: must_be_immutable
- class ExamToxicSubstance extends StatelessWidget {
- const ExamToxicSubstance({
- super.key,
- required this.currentFormObject,
- required this.options,
- required this.selectRaidoChange,
- required this.currentSelected,
- // required this.changeScore,
- // required this.currentScore,
- });
- final FormObject currentFormObject;
- final List<Option> options;
- final Function selectRaidoChange;
- final String currentSelected;
- // final Function changeScore;
- // final String currentScore;
- @override
- Widget build(BuildContext context) {
- return ExamCard(
- title: currentFormObject.label ?? '',
- content: Column(
- children: [
- Container(
- padding: const EdgeInsets.all(32).copyWith(
- top: 0,
- ),
- child: TextField(
- readOnly: true,
- controller: TextEditingController(text: ''),
- style: const TextStyle(fontSize: 30),
- onTap: () => {},
- ),
- ),
- Container(
- alignment: Alignment.centerLeft,
- padding: const EdgeInsets.only(left: 32, bottom: 12),
- child: const Text(
- '防护措施:',
- style: TextStyle(
- fontSize: 25,
- ),
- ),
- ),
- Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 16,
- ),
- width: double.infinity,
- child: Row(
- children: [
- Wrap(
- children: options
- .map(
- (e) => Container(
- padding: const EdgeInsets.all(8),
- child: InkWell(
- onTap: () => selectRaidoChange(e),
- borderRadius: BorderRadius.circular(50),
- child: Ink(
- decoration: BoxDecoration(
- border: Border.all(
- color: currentSelected == e.value
- ? Colors.blue
- : Colors.black26,
- ),
- borderRadius: const BorderRadius.all(
- Radius.circular(50),
- ),
- color: currentSelected == e.value
- ? Colors.blue
- : Colors.transparent,
- ),
- child: Container(
- padding: const EdgeInsets.all(15),
- alignment: Alignment.center,
- width: 250,
- child: FittedBox(
- child: Text(
- e.label ?? '',
- style: TextStyle(
- fontSize: 20,
- color: currentSelected == e.value
- ? Colors.white
- : Colors.black54,
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- )
- .toList(),
- ),
- if (currentSelected == '2')
- Container(
- child: Row(
- children: [
- const SizedBox(
- width: 16,
- ),
- SizedBox(
- width: 200,
- child: TextField(
- readOnly: true,
- controller: TextEditingController(text: ''),
- style: const TextStyle(fontSize: 30),
- onTap: () => {},
- ),
- )
- ],
- ),
- )
- ],
- ),
- ),
- ],
- ),
- );
- }
- }
|