/*
 * @Descripttion: 
 * @version: 
 * @Author: guanxiaoxin
 * @Date: 2023-10-07 14:24:20
 * @LastEditors: guanxiaoxin
 * @LastEditTime: 2023-10-09 13:06:06
 * @FilePath: \VNoteApp\lib\pages\check\widgets\exam_configurable\exam_input.dart
 */
import 'package:flutter/material.dart';
import 'package:vnoteapp/pages/check/models/form.dart';
import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';

class ExamInput extends StatefulWidget {
  const ExamInput({
    super.key,
    required this.currentFormObject,
    required this.currentInputValue,
    this.commonInput,
  });
  final FormObject currentFormObject;
  final String currentInputValue;
  final Function? commonInput;

  @override
  State<ExamInput> createState() => _ExamInputState();
}

class _ExamInputState extends State<ExamInput> {
  TextEditingController specialInputController = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return ExamCard(
      title: widget.currentFormObject.label ?? '',
      clickCard: () {
        widget.commonInput?.call();
      },
      content: Container(
        alignment: Alignment.bottomRight,
        padding: const EdgeInsets.only(
          bottom: 20,
          right: 30,
          left: 40,
        ),
        constraints: const BoxConstraints(minHeight: 150),
        child: RichText(
          text: TextSpan(
            text: widget.currentInputValue,
            style: const TextStyle(
              fontSize: 80,
              color: Colors.black,
            ),
            children: [
              TextSpan(
                text: widget.currentFormObject.append ?? '',
                style: const TextStyle(fontSize: 25),
              )
            ],
          ),
        ),
      ),
    );
  }
}
