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

merge-requests/322/head
Elham Rababh 5 years ago
parent c6a68083a4
commit 2e1c9780d7

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

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

Loading…
Cancel
Save