PAP-610: prevent show send email button if user have no vaccine

merge-update-with-lab-changes
Elham Rababh 5 years ago
parent c6a68083a4
commit 2e1c9780d7

@ -22,7 +22,7 @@ class VaccineViewModel extends BaseViewModel {
await _vaccineService.getMyVaccine(); await _vaccineService.getMyVaccine();
if (_vaccineService.hasError) { if (_vaccineService.hasError) {
error = _vaccineService.error; error = _vaccineService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -31,8 +31,8 @@ class _MyVaccinesState extends State<MyVaccines> {
builder: (BuildContext context, VaccineViewModel model, Widget child) => builder: (BuildContext context, VaccineViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myVaccines,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).myVaccines,
body: Container( body: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004, left: SizeConfig.screenWidth * 0.004,
@ -68,11 +68,15 @@ class _MyVaccinesState extends State<MyVaccines> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets
horizontal: 20.0, .symmetric(
horizontal:
20.0,
vertical: 20.0), vertical: 20.0),
child: Image.network( child: Image.network(
model.vaccineList[index] model
.vaccineList[
index]
.doctorImageURL, .doctorImageURL,
height: SizeConfig height: SizeConfig
.imageSizeMultiplier * .imageSizeMultiplier *
@ -91,12 +95,17 @@ class _MyVaccinesState extends State<MyVaccines> {
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Text( Text(
model.vaccineList[index] model
.vaccineList[
index]
.doctorTitle + .doctorTitle +
model.vaccineList[index] model
.vaccineList[
index]
.doctorName, .doctorName,
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
@ -106,7 +115,9 @@ class _MyVaccinesState extends State<MyVaccines> {
), ),
SizedBox(height: 7.0), SizedBox(height: 7.0),
Text( Text(
model.vaccineList[index] model
.vaccineList[
index]
.projectName, .projectName,
style: TextStyle( style: TextStyle(
fontSize: 17.0, fontSize: 17.0,
@ -115,7 +126,9 @@ class _MyVaccinesState extends State<MyVaccines> {
), ),
SizedBox(height: 7.0), SizedBox(height: 7.0),
Text( Text(
model.vaccineList[index] model
.vaccineList[
index]
.vaccineName, .vaccineName,
style: TextStyle( style: TextStyle(
fontSize: 17.0, fontSize: 17.0,
@ -125,7 +138,8 @@ class _MyVaccinesState extends State<MyVaccines> {
Text( Text(
'Date Taken ' + 'Date Taken ' +
convertDateFormat(model convertDateFormat(model
.vaccineList[index] .vaccineList[
index]
.invoiceDate), .invoiceDate),
style: TextStyle( style: TextStyle(
fontSize: 17.0), fontSize: 17.0),
@ -151,7 +165,8 @@ class _MyVaccinesState extends State<MyVaccines> {
], ],
), ),
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0
? Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
height: MediaQuery.of(context).size.height * 0.25, height: MediaQuery.of(context).size.height * 0.25,
@ -170,7 +185,8 @@ class _MyVaccinesState extends State<MyVaccines> {
// height: 80.0, // height: 80.0,
child: Button( child: Button(
disabled: true, disabled: true,
label: TranslationBase.of(context).checkVaccineAvailability, label: TranslationBase.of(context)
.checkVaccineAvailability,
backgroundColor: Color(0xff9EA3A4), backgroundColor: Color(0xff9EA3A4),
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, FadePage(page: MyVaccinesItemPage())), context, FadePage(page: MyVaccinesItemPage())),
@ -195,7 +211,8 @@ class _MyVaccinesState extends State<MyVaccines> {
), ),
], ],
), ),
), )
: Container(height: 0,),
), ),
); );
} }

Loading…
Cancel
Save