|
|
|
|
@ -1,9 +1,7 @@
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/my_referred_patient_model.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
|
|
|
|
|
@ -18,35 +16,24 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyReferredPatientWidget extends StatefulWidget {
|
|
|
|
|
final MyReferredPatientModel myReferredPatientModel;
|
|
|
|
|
|
|
|
|
|
final MyReferredPatientModel myReferredPatientModel;
|
|
|
|
|
MyReferredPatientWidget({Key key, this.myReferredPatientModel});
|
|
|
|
|
|
|
|
|
|
MyReferredPatientWidget({Key key, this.myReferredPatientModel});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_MyReferredPatientWidgetState createState() => _MyReferredPatientWidgetState();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_MyReferredPatientWidgetState createState() =>
|
|
|
|
|
_MyReferredPatientWidgetState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
|
|
|
|
|
bool _showDetails = false;
|
|
|
|
|
bool _isLoading = false;
|
|
|
|
|
final _formKey = GlobalKey<FormState>();
|
|
|
|
|
String error;
|
|
|
|
|
TextEditingController answerController;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -58,7 +45,6 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}',
|
|
|
|
|
@ -86,43 +72,48 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Divider(color: Colors.grey),
|
|
|
|
|
|
|
|
|
|
// VerticalDivider(color: Colors.black,
|
|
|
|
|
// thickness: 2, width: 20,
|
|
|
|
|
// indent: 200,
|
|
|
|
|
// endIndent: 200,),
|
|
|
|
|
Divider(color: Colors.grey),
|
|
|
|
|
|
|
|
|
|
// VerticalDivider(color: Colors.black,
|
|
|
|
|
// thickness: 2, width: 20,
|
|
|
|
|
// indent: 200,
|
|
|
|
|
// endIndent: 200,),
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
'File No',
|
|
|
|
|
fontSize:
|
|
|
|
|
1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
'${widget.myReferredPatientModel.patientId}',
|
|
|
|
|
fontSize:
|
|
|
|
|
1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
'File No',
|
|
|
|
|
fontSize:
|
|
|
|
|
1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
'${widget.myReferredPatientModel.patientId}',
|
|
|
|
|
fontSize:
|
|
|
|
|
1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: SizeConfig.realScreenWidth * .1,//0.1,
|
|
|
|
|
height:
|
|
|
|
|
SizeConfig.realScreenWidth * .1, //0.1,
|
|
|
|
|
width: 0.8,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
margin: EdgeInsets.only(left: 15, right: 15),
|
|
|
|
|
),
|
|
|
|
|
// VerticalDivider(color:Colors.black,thickness: 1, width: 2,
|
|
|
|
|
// indent: 1,
|
|
|
|
|
// endIndent: 2,),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
'Referral Doctor',
|
|
|
|
|
@ -133,10 +124,9 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
Texts(
|
|
|
|
|
widget.myReferredPatientModel
|
|
|
|
|
.referralDoctorName,
|
|
|
|
|
maxLength: 80,
|
|
|
|
|
readMore: true,
|
|
|
|
|
maxLength: 80,
|
|
|
|
|
readMore: true,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -255,12 +245,12 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
'${widget.myReferredPatientModel.referringDoctorRemarks}',
|
|
|
|
|
style: "bodyText1",
|
|
|
|
|
readMore: true,
|
|
|
|
|
@ -278,8 +268,8 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
'${widget.myReferredPatientModel.referredDoctorRemarks}',
|
|
|
|
|
style: "bodyText1",
|
|
|
|
|
readMore: true,
|
|
|
|
|
@ -288,54 +278,19 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(height: 10.0),
|
|
|
|
|
if (error != null && error.isNotEmpty)
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(6.0),
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.errorColor
|
|
|
|
|
.withOpacity(0.06),
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 8.0, horizontal: 12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Texts(error ?? "",
|
|
|
|
|
style: "bodyText1",
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.errorColor)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10.0),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(height: 10.0),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Button(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
final form = _formKey.currentState;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await Provider.of<MyReferredPatientProvider>(context, listen: false).replay(widget.myReferredPatientModel);
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
});
|
|
|
|
|
} catch (e) {
|
|
|
|
|
setState(() {
|
|
|
|
|
error = e.toString();
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await Provider.of<MyReferredPatientProvider>(
|
|
|
|
|
context,
|
|
|
|
|
listen: false)
|
|
|
|
|
.verify(widget.myReferredPatientModel);
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
title: 'Verify',
|
|
|
|
|
loading: _isLoading,
|
|
|
|
|
@ -351,4 +306,4 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|