import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../medication/update_medication_widget.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
        AppTextFieldCustom(
          hintText: TranslationBase.of(context).addChiefComplaints,
          controller: complaintsController,
          maxLines: 25,
          minLines: 7,
          hasBorder: true,
          validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null ,

        ),
         SizedBox(
          height: 20,
        ),

        AppTextFieldCustom(
              hintText: TranslationBase
                  .of(context)
                  .historyOfPresentIllness,
              controller: illnessController,
              maxLines: 25,
              minLines: 7,
          hasBorder: true,
          validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
            ),
            SizedBox(
              height: 10,
            ),
            UpdateMedicationWidget(
              medicationController: medicationController,
            ),
            SizedBox(
              height: 10,
            ),
        AppTextFieldCustom(
              hintText: TranslationBase
                  .of(context)
                  .currentMedications,
              controller: medicationController,
          maxLines: 25,
              minLines: 7,
              hasBorder: true,
              validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null ,

            ),
            SizedBox(
              height: 10,
            ),
          ]),
    );
  }
}