import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../custom_validation_error.dart';

class UpdateChiefComplaints extends StatelessWidget {
  const UpdateChiefComplaints({
    Key key,
    @required this.formKey,
    @required this.complaintsController,
    @required this.illnessController,
    @required this.medicationController,
    this.complaintsControllerError,
    this.illnessControllerError,
    this.medicationControllerError,
  }) : super(key: key);

  final GlobalKey<FormState> formKey;
  final TextEditingController complaintsController;
  final TextEditingController illnessController;
  final TextEditingController medicationController;
  final String complaintsControllerError;
  final String illnessControllerError;
  final String medicationControllerError;

  @override
  Widget build(BuildContext context) {
    return Form(
      key: formKey,
      child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
        SizedBox(
          height: 20,
        ),
        //TODO handel error cases
        NewTextFields(
          hintText: TranslationBase.of(context).addChiefComplaints,
          controller: complaintsController,
          maxLines: 25,
          minLines: 3,
        ),

        Container(
            child: CustomValidationError(
          error: complaintsControllerError,
        )),
         SizedBox(
          height: 20,
        ),

            NewTextFields(
              hintText: TranslationBase
                  .of(context)
                  .historyOfPresentIllness,
              controller: illnessController,
              maxLines: 25,
              minLines: 3,
            ),
            Container(
                child: CustomValidationError(error: illnessControllerError,)),
            SizedBox(
              height: 20,
            ),
            SizedBox(
              height: 10,
            ),
            UpdateMedicationWidget(
              medicationController: medicationController,
            ),
            SizedBox(
              height: 10,
            ),
            NewTextFields(
              hintText: TranslationBase
                  .of(context)
                  .currentMedications,
              controller: medicationController,
              maxLines: 25,
              minLines: 3,
            ),
            Container(child: CustomValidationError(
              error: medicationControllerError,)),
            SizedBox(
              height: 10,
            ),
          ]),
    );
  }
}