|
|
|
@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
@ -29,303 +30,333 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
|
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
|
return DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder: (BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 980,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchMedicine,
|
|
|
|
|
controller: drugIdController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).orderType,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).strength,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context).route,
|
|
|
|
|
controller: routeController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
|
controller: frequencyController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
|
controller: doseController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).indication,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).fromDate,
|
|
|
|
|
keyboardType: TextInputType.datetime,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: durationController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
postProcedure(
|
|
|
|
|
model: model,
|
|
|
|
|
duration: durationController.text,
|
|
|
|
|
dose: doseController.text,
|
|
|
|
|
frequency:
|
|
|
|
|
frequencyController.text,
|
|
|
|
|
route: routeController.text,
|
|
|
|
|
drugId: drugIdController.text,
|
|
|
|
|
strength: strengthController.text,
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// NewPrescriptionScreen()),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
return //BaseView<PrescriptionViewModel>(
|
|
|
|
|
//onModelReady: (model) => model.getDrugs(),
|
|
|
|
|
//builder: (BuildContext context, PrescriptionViewModel model,
|
|
|
|
|
//Widget child) =>
|
|
|
|
|
DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 980,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.medicines
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchMedicine,
|
|
|
|
|
controller: drugIdController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.orderType,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.strength,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
|
controller: routeController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.frequency,
|
|
|
|
|
controller: frequencyController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.doseTime,
|
|
|
|
|
controller: doseController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.indication,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.fromDate,
|
|
|
|
|
keyboardType: TextInputType.datetime,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.duration,
|
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: durationController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.instruction,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState
|
|
|
|
|
.validate()) {
|
|
|
|
|
postProcedure(
|
|
|
|
|
model: model,
|
|
|
|
|
duration:
|
|
|
|
|
durationController.text,
|
|
|
|
|
dose: doseController.text,
|
|
|
|
|
frequency:
|
|
|
|
|
frequencyController.text,
|
|
|
|
|
route: routeController.text,
|
|
|
|
|
drugId: drugIdController.text,
|
|
|
|
|
strength:
|
|
|
|
|
strengthController.text,
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// NewPrescriptionScreen()),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
//);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// openAllergiesList(BuildContext context) {
|
|
|
|
|
// showModalBottomSheet(
|
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
// isScrollControlled: true,
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (context) {
|
|
|
|
|
// return AddAllergies(
|
|
|
|
|
// addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// widget.myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
postProcedure(
|
|
|
|
|
{String duration,
|
|
|
|
|
String dose,
|
|
|
|
|