Merge branch 'Jul_fixes' into 'development'

Jul fixes

See merge request Cloud_Solution/diplomatic-quarter!322
merge-requests/323/head
Sultan khan 5 years ago
commit 15f620d720

@ -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);
} }

@ -292,7 +292,9 @@ class MobileNumberTextFiled extends StatelessWidget {
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), color: Colors.white), borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row(children: <Widget>[ child: Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: Icon( child: Icon(

@ -416,7 +416,7 @@ class _HomePageState extends State<HomePage> {
height: 40, height: 40,
), ),
Texts( Texts(
"${model.heightCm}", "${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white, color: Colors.white,
fontSize: 17, fontSize: 17,
) )
@ -434,7 +434,7 @@ class _HomePageState extends State<HomePage> {
width: 25, width: 25,
height: 40, height: 40,
), ),
Texts('${model.weightKg}', Texts('${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white, color: Colors.white,
fontSize: 17) fontSize: 17)
], ],
@ -445,8 +445,6 @@ class _HomePageState extends State<HomePage> {
), ),
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/blood_icon.png', 'assets/images/blood_icon.png',
@ -456,6 +454,7 @@ class _HomePageState extends State<HomePage> {
Texts( Texts(
'${model.booldType}', '${model.booldType}',
color: Colors.white, color: Colors.white,
fontSize: 17
) )
], ],
), ),

@ -27,7 +27,7 @@ class LineChartCurved extends StatelessWidget {
getYaxix(); getYaxix();
calculateMaxAndMin(); calculateMaxAndMin();
return AspectRatio( return AspectRatio(
aspectRatio: 1.1, aspectRatio: 1.0,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)), borderRadius: BorderRadius.all(Radius.circular(18)),
@ -80,14 +80,6 @@ class LineChartCurved extends StatelessWidget {
} }
getYaxix() { getYaxix() {
// int indexess= (timeSeries.length*0.30).toInt();
// for (int index = 0; index < timeSeries.length; index++) {
// int mIndex = indexess * index;
// if (mIndex < timeSeries.length) {
// yAxixs.add(timeSeries[mIndex].sales);
// }
// }
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexes * index; int mIndex = indexes * index;
if (mIndex < timeSeries.length) { if (mIndex < timeSeries.length) {
@ -181,7 +173,7 @@ class LineChartCurved extends StatelessWidget {
minX: minX, minX: minX,
maxX: maxX, maxX: maxX,
maxY: maxY, maxY: maxY,
minY: minY, minY: 0,
lineBarsData: getData(context), lineBarsData: getData(context),
); );
} }

@ -30,173 +30,190 @@ class _MyVaccinesState extends State<MyVaccines> {
onModelReady: (model) => model.getVaccine(), onModelReady: (model) => model.getVaccine(),
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,
right: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04, top: SizeConfig.screenWidth * 0.04,
), ),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(
backgroundColor: Colors.white, backgroundColor: Colors.white,
child: ExpansionTile( child: ExpansionTile(
title: Container( title: Container(
height: 65.0, height: 65.0,
child: Text('2018'), child: Text('2018'),
), ),
children: <Widget>[ children: <Widget>[
Container( Container(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.vaccineList == null itemCount: model.vaccineList == null
? 0 ? 0
: model.vaccineList.length, : model.vaccineList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Column( return Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(
child: Column( child: Column(
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Expanded( Row(
child: Column( children: <Widget>[
children: <Widget>[ Expanded(
Padding( child: Column(
padding: EdgeInsets.symmetric( children: <Widget>[
horizontal: 20.0, Padding(
vertical: 20.0), padding: EdgeInsets
child: Image.network( .symmetric(
model.vaccineList[index] horizontal:
.doctorImageURL, 20.0,
height: SizeConfig vertical: 20.0),
child: Image.network(
model
.vaccineList[
index]
.doctorImageURL,
height: SizeConfig
.imageSizeMultiplier * .imageSizeMultiplier *
23, 23,
width: SizeConfig width: SizeConfig
.imageSizeMultiplier * .imageSizeMultiplier *
20, 20,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
),
],
), ),
], flex: 2,
), ),
flex: 2, Expanded(
), child: Container(
Expanded( child: Column(
child: Container( crossAxisAlignment:
child: Column( CrossAxisAlignment
crossAxisAlignment: .start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Text(
Text( model
model.vaccineList[index] .vaccineList[
index]
.doctorTitle + .doctorTitle +
model.vaccineList[index] model
.doctorName, .vaccineList[
style: TextStyle( index]
fontWeight: .doctorName,
style: TextStyle(
fontWeight:
FontWeight.w900, FontWeight.w900,
fontSize: 16.6, fontSize: 16.6,
), ),
), ),
SizedBox(height: 7.0), SizedBox(height: 7.0),
Text( Text(
model.vaccineList[index] model
.projectName, .vaccineList[
style: TextStyle( index]
fontSize: 17.0, .projectName,
letterSpacing: 0.5, style: TextStyle(
), fontSize: 17.0,
), letterSpacing: 0.5,
SizedBox(height: 7.0), ),
Text( ),
model.vaccineList[index] SizedBox(height: 7.0),
.vaccineName, Text(
style: TextStyle( model
fontSize: 17.0, .vaccineList[
), index]
), .vaccineName,
SizedBox(height: 7.0), style: TextStyle(
Text( fontSize: 17.0,
'Date Taken ' + ),
convertDateFormat(model ),
.vaccineList[index] SizedBox(height: 7.0),
.invoiceDate), Text(
style: TextStyle( 'Date Taken ' +
fontSize: 17.0), convertDateFormat(model
.vaccineList[
index]
.invoiceDate),
style: TextStyle(
fontSize: 17.0),
),
],
), ),
], ),
flex: 5,
), ),
), ],
flex: 5,
), ),
], ],
), ),
], ),
), ],
), );
], }),
); )
}), ],
) ),
], ),
), // SpaceBetweenTexts(space: 165.0),
), ],
// SpaceBetweenTexts(space: 165.0),
],
),
),
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12),
height: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
child: Column(
children: [
Divider(
height: 2,
thickness: 1,
),
SizedBox(
height: 6,
),
Container(
width: double.infinity,
// height: 80.0,
child: Button(
disabled: true,
label: TranslationBase.of(context).checkVaccineAvailability,
backgroundColor: Color(0xff9EA3A4),
onTap: () => Navigator.push(
context, FadePage(page: MyVaccinesItemPage())),
),
), ),
if (projectViewModel.havePrivilege(27)) ),
Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0
width: double.infinity, ? Container(
// height: 80.0, color: Theme.of(context).scaffoldBackgroundColor,
child: SecondaryButton( padding: EdgeInsets.all(12),
label: TranslationBase.of(context).sendEmail, height: MediaQuery.of(context).size.height * 0.25,
color: Color(0xffF62426), width: double.infinity,
textColor: Colors.white, child: Column(
disabled: model.vaccineList.length == 0, children: [
loading: model.state == ViewState.BusyLocal, Divider(
onTap: () async { height: 2,
model.sendEmail( thickness: 1,
message: TranslationBase.of(context) ),
.emailSentSuccessfully); SizedBox(
}, height: 6,
), ),
), Container(
], width: double.infinity,
// height: 80.0,
child: Button(
disabled: true,
label: TranslationBase.of(context)
.checkVaccineAvailability,
backgroundColor: Color(0xff9EA3A4),
onTap: () => Navigator.push(
context, FadePage(page: MyVaccinesItemPage())),
),
),
if (projectViewModel.havePrivilege(27))
Container(
width: double.infinity,
// height: 80.0,
child: SecondaryButton(
label: TranslationBase.of(context).sendEmail,
color: Color(0xffF62426),
textColor: Colors.white,
disabled: model.vaccineList.length == 0,
loading: model.state == ViewState.BusyLocal,
onTap: () async {
model.sendEmail(
message: TranslationBase.of(context)
.emailSentSuccessfully);
},
),
),
],
),
)
: Container(height: 0,),
), ),
),
),
); );
} }

Loading…
Cancel
Save