import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';

import '../../shared_soap_widgets/SOAP_open_items.dart';
import 'add_medication.dart';

class UpdateMedicationWidget extends StatefulWidget {
  final TextEditingController medicationController;

  UpdateMedicationWidget({
    Key key,
    this.medicationController,
  });

  @override
  _UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState();
}

class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [

        SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () {
          openMedicationList(context);

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


  openMedicationList(BuildContext context) {
    showModalBottomSheet(
        backgroundColor: Colors.white,
        isScrollControlled: true,
        isDismissible: false,
        context: context,
        builder: (context) {
          return AddMedication(
            addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
            medicationController: widget.medicationController,
          );
        });
  }
}



