Refactor add_prescription_form
parent
228237bf96
commit
7afe24c2bc
@ -1 +0,0 @@
|
||||
|
||||
@ -1,168 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrescriptionDetailsPage extends StatelessWidget {
|
||||
final PrescriptionReport prescriptionReport;
|
||||
|
||||
PrescriptionDetailsPage({Key key, this.prescriptionReport});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).prescriptions,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
border: Border.all(color: Colors.grey[200], width: 0.5),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
child: Image.network(
|
||||
prescriptionReport.imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
width: 60,
|
||||
height: 70,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
prescriptionReport.itemDescription.isNotEmpty
|
||||
? prescriptionReport.itemDescription
|
||||
: prescriptionReport.itemDescriptionN),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
child: Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 0.5),
|
||||
outside: BorderSide(width: 0.5)),
|
||||
children: [
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).route,
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).frequency,
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
"${TranslationBase.of(context).dailyDoses}",
|
||||
fontSize: 14,
|
||||
))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 30,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).duration,
|
||||
fontSize: 14,
|
||||
))),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child:
|
||||
Center(child: Text(prescriptionReport.routeN))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child:
|
||||
Text(prescriptionReport.frequencyN ?? ''))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${prescriptionReport.doseDailyQuantity}'))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child:
|
||||
Center(child: Text('${prescriptionReport.days}')))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
AppText(TranslationBase.of(context).notes),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Divider(
|
||||
height: 0.5,
|
||||
color: Colors.grey[300],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AppText(prescriptionReport.remarks ?? ''),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,168 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
void prescriptionWarning(context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bc) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Container(
|
||||
height: 600,
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Container(
|
||||
child: ExpansionTile(
|
||||
title: AppText('Prescription warning and alerts(0)'),
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
'DOSESCREENINGRESULTFORETCETC',
|
||||
color: Color(0XFFB8382C),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border:
|
||||
Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Remarks',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.number,
|
||||
inputFormatter: ONLY_NUMBERS,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 95.0,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: 'CONTINUE',
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
authorizationForm(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
color: Colors.white,
|
||||
title: 'remove',
|
||||
fontColor: Colors.red,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
prescriptionWarning(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
void authorizationForm(context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bc) {
|
||||
return Container(
|
||||
height: 500,
|
||||
child: Form(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
'Prescription authorization'.toUpperCase(),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Auth ID',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.number,
|
||||
inputFormatter: ONLY_NUMBERS,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
||||
border: Border.all(
|
||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
||||
child: AppTextFormField(
|
||||
labelText: 'Password',
|
||||
borderColor: Colors.white,
|
||||
textInputType: TextInputType.text,
|
||||
inputFormatter: ONLY_LETTERS,
|
||||
obscureText: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 190.0,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: 'CONTINUE',
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
authorizationForm(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue