Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into blood_pressure

 Conflicts:
	lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart
merge-update-with-lab-changes
hussam al-habibeh 4 years ago
commit 9c6f83600b

@ -40,8 +40,7 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -66,9 +65,7 @@ class _HomePageState extends State<HomePage> {
height: 210, height: 210,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover),
'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover),
), ),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
@ -77,131 +74,112 @@ class _HomePageState extends State<HomePage> {
left: 5, left: 5,
right: 5, right: 5,
child: Container( child: Container(
width: width: MediaQuery.of(context).size.width * 0.8,
MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
height: 125, height: 125,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image:
"assets/images/new-design/covid_bg_transparent.png"), AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
),
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: Container(
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context)
.covidTest,
color: Colors.white,
fontWeight: FontWeight.w700,
), ),
Row( color: Colors.white.withOpacity(0.3),
mainAxisAlignment: borderRadius: BorderRadius.all(Radius.circular(5))),
MainAxisAlignment child: (model.user != null && model.user.outSA == 1)
.spaceAround, ? Container(
children: <Widget>[ width: double.infinity,
Container( height: double.infinity,
margin: EdgeInsets.only( color: Colors.grey.shade500.withOpacity(0.3),
top: 15.0, child: Icon(
), Icons.lock_outline,
child: SvgPicture.asset( size: 40,
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
), ),
Container( )
margin: EdgeInsets.only( : Container(
top: 5.0), child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Texts(
Texts( TranslationBase.of(context).covidTest,
TranslationBase.of( color: Colors.white,
context) fontWeight: FontWeight.w700,
.driveThru, ),
fontWeight: Row(
FontWeight.w700, mainAxisAlignment: MainAxisAlignment.spaceAround,
color: Colors.white, children: <Widget>[
), Container(
ButtonTheme( margin: EdgeInsets.only(
shape: top: 15.0,
RoundedRectangleBorder( ),
borderRadius: child: SvgPicture.asset(
BorderRadius 'assets/images/new-design/covid-19-car.svg',
.circular( width: 45.0,
5.0), height: 45.0),
), ),
minWidth: MediaQuery.of( Container(
context) margin: EdgeInsets.only(top: 5.0),
.size child: Column(
.width * children: <Widget>[
0.15, Texts(
height: 25.0, TranslationBase.of(context).driveThru,
child: RaisedButton( fontWeight: FontWeight.w700,
color: Colors color: Colors.white,
.red[800], ),
textColor: ButtonTheme(
Colors.white, shape: RoundedRectangleBorder(
disabledTextColor: borderRadius: BorderRadius.circular(5.0),
Colors.white, ),
disabledColor: minWidth: MediaQuery.of(context).size.width * 0.15,
new Color( height: 25.0,
0xFFbcc2c4), child: RaisedButton(
onPressed: () { color: Colors.red[800],
navigateToCovidDriveThru(); textColor: Colors.white,
}, disabledTextColor: Colors.white,
child: Center( disabledColor: new Color(0xFFbcc2c4),
child: Center( onPressed:
child: Center( (model.user != null && model.user.outSA == 1)
child: ? () {}
Center( : () {
child: navigateToCovidDriveThru();
Texts( },
TranslationBase.of(context) child: Center(
.bookNow, child: Center(
fontWeight: child: Center(
FontWeight.w700, child: Center(
color: Colors child: Texts(
.white, TranslationBase.of(context).bookNow,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
),
),
), ),
), ),
), ),
), ],
), ),
), ),
), ],
], ),
), ],
), ),
], )),
),
],
),
),
),
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())),
FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 125, height: 125,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white color: Colors.white.withOpacity(0.3),
.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: SvgPicture.asset( child: SvgPicture.asset(
projectViewModel.isArabic projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg' ? 'assets/images/new-design/livecare_arabic_logo.svg'
@ -217,23 +195,15 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
Container( Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80)
width: double.infinity,
height: projectViewModel.isArabic ? 110 : 80)
], ],
), ),
Positioned( Positioned(
top: 155, top: 155,
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
right: MediaQuery.of(context).size.width * right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
child: (!model.isLogin) child: (!model.isLogin)
? Container( ? Container(
width: double.infinity, width: double.infinity,
@ -241,14 +211,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
@ -264,37 +230,30 @@ class _HomePageState extends State<HomePage> {
fontSize: 23, fontSize: 23,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFileSubTitle,
.myMedicalFileSubTitle,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment:
? Alignment.bottomLeft projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
: Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 15, right: 15),
left: 15, right: 15),
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, borderRadius: BorderRadius.all(Radius.circular(0)),
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(0)),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).viewMore,
.viewMore,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
@ -313,14 +272,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
), ),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
@ -328,81 +283,51 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (projectViewModel.user != null && if (projectViewModel.user != null && model.isLogin)
model.isLogin)
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 8,
), ),
model.user.cRSVerificationStatus == model.user.cRSVerificationStatus == 2
2
? Row( ? Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
.fromLTRB(
8.0,
0.0,
8.0,
0.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/images/new-design/verification_check.svg"), "assets/images/new-design/verification_check.svg"),
), ),
], ],
) )
: model.user.cRSVerificationStatus == : model.user.cRSVerificationStatus == 3
3
? Row( ? Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
.fromLTRB( child: SvgPicture.asset(
8.0, "assets/images/new-design/pending.svg"),
0.0,
8.0,
0.0),
child: SvgPicture
.asset(
"assets/images/new-design/pending.svg"),
), ),
], ],
) )
: Row( : Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
@ -436,17 +361,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5), Radius.circular(5),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFile,
.myMedicalFile,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -485,10 +407,8 @@ class _HomePageState extends State<HomePage> {
width: 25, width: 25,
height: 40, height: 40,
), ),
Texts( Texts('${model.weightKg} ${TranslationBase.of(context).kg}',
'${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 17)
color: Colors.white,
fontSize: 17)
], ],
), ),
), ),
@ -503,9 +423,7 @@ class _HomePageState extends State<HomePage> {
width: 35, width: 35,
height: 40, height: 40,
), ),
Texts('${model.booldType}', Texts('${model.booldType}', color: Colors.white, fontSize: 17)
color: Colors.white,
fontSize: 17)
], ],
), ),
), ),
@ -519,12 +437,10 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
builder: (context) => PackagesHomePage()));
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -571,13 +487,14 @@ class _HomePageState extends State<HomePage> {
}, },
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -594,14 +511,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).homeHealthCare,
.homeHealthCare,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
)), )),
@ -613,18 +527,17 @@ class _HomePageState extends State<HomePage> {
if (projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => onTap: () =>
(model.user != null && model.user.outSA == 1) (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
? () {}
: getPharmacyToken(model),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -647,14 +560,11 @@ class _HomePageState extends State<HomePage> {
height: 20, height: 20,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).onlinePharmacy,
.onlinePharmacy,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
), ),
@ -677,13 +587,14 @@ class _HomePageState extends State<HomePage> {
}, },
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -700,14 +611,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).cmcHeading,
.cmcHeading,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
)), )),
@ -723,8 +631,7 @@ class _HomePageState extends State<HomePage> {
height: 8, height: 8,
), ),
InkWell( InkWell(
onTap: () => onTap: () => Navigator.push(context, FadePage(page: PaymentService())),
Navigator.push(context, FadePage(page: PaymentService())),
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
child: Row( child: Row(
@ -745,8 +652,7 @@ class _HomePageState extends State<HomePage> {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).onlinePaymentService,
.onlinePaymentService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -777,8 +683,7 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).offersAndPackages,
.offersAndPackages,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -818,13 +723,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).emergencyServices,
.emergencyServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: fontSize: SizeConfig.textMultiplier * 1.7,
SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -862,8 +765,7 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).viewAllHabibMedicalService,
.viewAllHabibMedicalService,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 10, fontSize: 10,
@ -884,15 +786,13 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5, opacity: 0.5,
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push( onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
context, FadePage(page: AllHabibMedicalService())),
), ),
DashboardItem( DashboardItem(
onTap: () { onTap: () {
// Navigator.push( // Navigator.push(
// context, FadePage(page: FeedbackHomePage())); // context, FadePage(page: FeedbackHomePage()));
Navigator.push( Navigator.push(context, FadePage(page: ContactUsPage()));
context, FadePage(page: ContactUsPage()));
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -1014,10 +914,8 @@ class DashboardItem extends StatelessWidget {
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: hasColorFilter colorFilter:
? new ColorFilter.mode( hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
) )
: null, : null,
), ),

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -29,22 +30,7 @@ class WeightMonthlyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: model.weighMonthTimeSeriesData.isEmpty body: ListView(
? Container(
child: Center(
child: Container(
child: Center(
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
@ -52,7 +38,7 @@ class WeightMonthlyPage extends StatelessWidget {
child: MonthLineChartCurved( child: MonthLineChartCurved(
horizontalInterval: 1.0, horizontalInterval: 1.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData, timeSeries: model.weighMonthTimeSeriesData.isEmpty?[TimeSeriesSales3(0, 0.0)]:model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)), )),
SizedBox( SizedBox(
@ -68,7 +54,11 @@ class WeightMonthlyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weighMonthTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -25,22 +26,7 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: model.weightWeekTimeSeriesData.isEmpty body: ListView(
? Container(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -48,7 +34,9 @@ class WeightWeeklyPage extends StatelessWidget {
child: LineChartCurved( child: LineChartCurved(
horizontalInterval: 1.0, horizontalInterval: 1.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData, timeSeries: model.weightWeekTimeSeriesData.isEmpty
? [TimeSeriesSales2(DateTime.now(), 0.0)]
: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
), ),
), ),
@ -65,9 +53,14 @@ class WeightWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightWeekTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(context, projectViewModel, model), children: fullData(context, projectViewModel, model),
), ),
@ -79,7 +72,8 @@ class WeightWeeklyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -88,8 +82,12 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -129,8 +127,12 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -28,22 +29,8 @@ class WeightYearPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: model.weightYearTimeSeriesData.isEmpty body:
? Container( ListView(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
@ -51,7 +38,7 @@ class WeightYearPage extends StatelessWidget {
child: LineChartCurved( child: LineChartCurved(
horizontalInterval: 2.0, horizontalInterval: 2.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData, timeSeries: model.weightYearTimeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "", indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)), )),
SizedBox( SizedBox(
@ -67,7 +54,11 @@ class WeightYearPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightYearTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),

@ -30,7 +30,7 @@ class BloodMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
children: [ children: [
Container( Container(

@ -25,7 +25,7 @@ class BloodYearPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
children: [ children: [
Container( Container(

@ -31,7 +31,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
children: [ children: [
Container( Container(

@ -22,6 +22,8 @@ int price = 0;
var languageID; var languageID;
bool isOverQuantity = false; bool isOverQuantity = false;
bool isInWishlit = false; bool isInWishlit = false;
//int isSelected = 1;
bool isSelected= true;
String itemID; String itemID;
var customerId; var customerId;
CompareList compareItems = new CompareList(); CompareList compareItems = new CompareList();
@ -642,14 +644,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
padding: EdgeInsets.only(bottom: 5), padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4), // margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) =>
model.getRecommendedProducts( onModelReady: (model) => model.getRecommendedProducts(widget.product.id.toString()),
widget.product.id.toString()),
builder: (_, model, wi) => Container( builder: (_, model, wi) => Container(
child: child:
// Text(model.recommendedProductList[0].id), // Text(model.recommendedProductList[0].id),
model.recommendedProductList.length != model.recommendedProductList.length != null
null
? Expanded( ? Expanded(
child: ListView.builder( child: ListView.builder(
scrollDirection: scrollDirection:
@ -657,11 +657,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
itemCount: model itemCount: model.recommendedProductList.length,
.recommendedProductList itemBuilder: (context, index) {
.length,
itemBuilder:
(context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -674,42 +671,22 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
elevation: 2, elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: Colors color: Colors.grey[300],
.grey[
300],
width: 2), width: 2),
borderRadius: borderRadius: BorderRadius.circular(10)),
BorderRadius margin: EdgeInsets.symmetric(
.circular(
10)),
margin: EdgeInsets
.symmetric(
horizontal: 8, horizontal: 8,
vertical: 0, vertical: 0,
), ),
child: Container( child: Container(
decoration: decoration: BoxDecoration(
BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(15),
borderRadius:
BorderRadius
.all(
Radius.circular(
15),
), ),
), ),
padding: EdgeInsets padding: EdgeInsets.symmetric(horizontal: 4),
.symmetric( width: MediaQuery.of(context).size.width / 3,
horizontal:
4),
width: MediaQuery.of(
context)
.size
.width /
3,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Stack( Stack(
children: [ children: [
@ -717,11 +694,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align( child: Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: IconButton( child: IconButton(
icon: Icon(!isInWishlit icon: Icon(!isInWishlit ? Icons.favorite_border : Icons.favorite),
? Icons.favorite_border
: Icons.favorite),
color: !isInWishlit ? Colors.grey : Colors.red, color: !isInWishlit ? Colors.grey : Colors.red,
onPressed: () async { onPressed: () async {
if (customerId != null) { if (customerId != null) {
if (!isInWishlit) { if (!isInWishlit) {
await addToWishlistFunction(model.recommendedProductList[index].id); await addToWishlistFunction(model.recommendedProductList[index].id);
@ -734,29 +710,36 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {}); setState(() {});
}, },
)), )),
// itemID.contains(model.recommendedProductList[index].id)
// child: Align(
// alignment: Alignment.topRight,
// child:itemID.contains(model.recommendedProductList[index].id)
// // !isInWishlist // // !isInWishlist
// ? IconButton( // ? IconButton(
// icon: Icon(Icons.favorite_border), // icon: Icon(Icons.favorite_border),
// color: Colors.red, // color: Colors.grey,
// iconSize: 30, // iconSize: 30,
// onPressed: () { // onPressed: () {
// setState(() { // setState(() {
// deleteFromWishlistFunction(itemID); // if (customerId != null && isInWishlit ) {
// }); // deleteFromWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// }, // },
// ) // )
// : IconButton( // : IconButton(
// icon: Icon(Icons.favorite), // icon: Icon(Icons.favorite),
// color: Colors.grey, // color: Colors.red,
// iconSize: 30, // iconSize: 30,
// onPressed: () { // onPressed: () {
// setState(() { // setState(() {
// addToWishlistFunction(itemID); // if (customerId != null && !isInWishlit ) {
// }); // addToWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// }, // },
// ) // )
// // ),
), ),
Container( Container(

@ -231,37 +231,21 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
Stack(children: [ Stack(children: [
Container( Container(
child: Align( child: Align(
alignment: alignment: Alignment.topRight,
Alignment child: itemID.contains(e.id)
.topRight,
child:
itemID.contains(e.id)
// !isInWishlist // !isInWishlist
? IconButton( ? IconButton(icon: Icon(Icons.favorite_border),
icon: color: Colors.grey, iconSize: 30,
Icon(Icons.favorite_border),
color:
Colors.grey,
iconSize:
30,
onPressed: onPressed:
() { () {
setState(() { setState(() {addToWishlistFunction(itemID);
addToWishlistFunction(itemID);
}); });
}, },
) )
: : IconButton(icon: Icon(Icons.favorite),
IconButton( color: Colors.red, iconSize: 30,
icon:
Icon(Icons.favorite),
color:
Colors.red,
iconSize:
30,
onPressed: onPressed:
() { () {setState(() {
setState(() {
deleteFromWishlistFunction(itemID); deleteFromWishlistFunction(itemID);
}); });
}, },
@ -269,149 +253,74 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
// //
), ),
), ),
Container( Container(margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
margin: EdgeInsets alignment: Alignment.center,
.fromLTRB(0, 16,
10, 16),
alignment:
Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20), // padding: EdgeInsets.only(left: 25, bottom: 20),
child: (e.images != child: (e.images != null && e.images.length > 0)
null && ? Image.network(e.images[0].src.toString(),
e.images.length >
0)
? Image.network(
e.images[0]
.src
.toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit fit: BoxFit.cover, height: 60,)
.cover, : Image.asset("assets/images/no_image.png", fit: BoxFit.cover, height: 60,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit
.cover,
height: 60,
), ),
), ),
Container( Container(width: e.rxMessage != null ? MediaQuery.of(context)
width: e.rxMessage != .size.width / 5 : 0,
null padding: EdgeInsets.all(4),
? MediaQuery.of( decoration: BoxDecoration(
context) color: Color(0xffb23838),
.size borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
), ),
child: Texts( child: Texts(e.rxMessage != null ? e.rxMessage : "",
e.rxMessage != null
? e.rxMessage
: "",
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
), ),
), ),
]), ]),
Container( Container(
margin: EdgeInsets margin: EdgeInsets
.symmetric( .symmetric(horizontal: 6, vertical: 0,
horizontal: 6,
vertical: 0,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Text( Text(
languageID == "ar" languageID == "ar" ? e.namen : e.name,
? e.namen
: e.name,
style: TextStyle( style: TextStyle(
color: Colors color: Colors.black, fontSize: 13.0,
.black,
fontSize: 13.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), ),
), ),
Padding( Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10), // padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: padding: const EdgeInsets.only(top: 10, bottom: 5),
const EdgeInsets child: Texts("SAR ${e.price}",
.only( bold: true, fontSize: 14,
top: 10,
bottom:
5),
child: Texts(
"SAR ${e.price}",
bold: true,
fontSize: 14,
), ),
), ),
], ],
), ),
), ),
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets padding: EdgeInsets.only(right: 10),
.only(
right:
10),
// margin: EdgeInsets.only(left: 5), // margin: EdgeInsets.only(left: 5),
child: Align( child: Align(alignment: Alignment.topLeft,
alignment: child: RatingBar.readOnly(initialRating: e.approvedRatingSum.toDouble(),
Alignment
.topLeft,
child: RatingBar
.readOnly(
initialRating: e
.approvedRatingSum
.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 13.0, size: 13.0, filledColor: Colors.yellow[700],
filledColor: emptyColor: Colors.grey[500],
Colors.yellow[ isHalfAllowed: true,
700], halfFilledIcon: Icons.star_half,
emptyColor: filledIcon: Icons.star,
Colors.grey[ emptyIcon: Icons.star,
500],
isHalfAllowed:
true,
halfFilledIcon:
Icons
.star_half,
filledIcon:
Icons
.star,
emptyIcon:
Icons
.star,
), ),
), ),
), ),
Texts( Texts("(${e.approvedTotalReviews.toString()})",
"(${e.approvedTotalReviews.toString()})",
// bold: true, // bold: true,
fontSize: 12, fontSize: 12,
), ),
@ -664,8 +573,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
return Card( return Card(
elevation: 2, elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: side: BorderSide(color: Colors.grey[300], width: 2),
BorderSide(color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)), borderRadius: BorderRadius.circular(10)),
// //
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
@ -692,14 +600,12 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
//wishlistVar[index].id.contains(model.recommendedProductList[index].id) //wishlistVar[index].id.contains(model.recommendedProductList[index].id)
!isInWishlist !isInWishlist
? IconButton( ? IconButton(
icon: Icon( icon: Icon(Icons.favorite_border),
Icons.favorite_border),
color: Colors.grey, color: Colors.grey,
iconSize: 30, iconSize: 30,
onPressed: () { onPressed: () {
setState(() { setState(() {
addToWishlistFunction( addToWishlistFunction(itemID);
itemID);
}); });
}, },
) )
@ -709,8 +615,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
iconSize: 30, iconSize: 30,
onPressed: () { onPressed: () {
setState(() { setState(() {
deleteFromWishlistFunction( deleteFromWishlistFunction(itemID);
itemID);
}); });
}, },
) )
@ -721,30 +626,20 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
margin: EdgeInsets.fromLTRB(0, 16, 10, 16), margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center, alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20), // padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index] child: (model.recommendedProductList[index].images != null &&
.images != model.recommendedProductList[index].images.length > 0)
null && ? Image.network(model.recommendedProductList[index].images[0].src.toString(),
model.recommendedProductList[index]
.images.length >
0)
? Image.network(
model.recommendedProductList[index]
.images[0].src
.toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
) )
: Image.asset( : Image.asset("assets/images/no_image.png",
"assets/images/no_image.png",
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
), ),
), ),
Container( Container(
width: model.recommendedProductList[index] width: model.recommendedProductList[index].rxMessage != null
.rxMessage !=
null
? MediaQuery.of(context).size.width / 5 ? MediaQuery.of(context).size.width / 5
: 0, : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
@ -754,11 +649,8 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
topLeft: Radius.circular(6)), topLeft: Radius.circular(6)),
), ),
child: Texts( child: Texts(
model.recommendedProductList[index] model.recommendedProductList[index].rxMessage != null
.rxMessage != ? model.recommendedProductList[index].rxMessage
null
? model.recommendedProductList[index]
.rxMessage
: "", : "",
color: Colors.white, color: Colors.white,
regular: true, regular: true,
@ -773,12 +665,9 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
vertical: 2, vertical: 2,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text( Text(model.recommendedProductList[index].name,
model
.recommendedProductList[index].name,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 13.0, fontSize: 13.0,
@ -799,8 +688,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
), ),
), ),
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -809,10 +697,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: model initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
.recommendedProductList[index]
.approvedRatingSum
.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 13.0, size: 13.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart'; import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Constants.dart'; import '../../Constants.dart';
@ -127,7 +128,9 @@ class _MobileNo extends State<MobileNo> {
controller: widget.controller, controller: widget.controller,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
maxLength: 10, maxLength: 10,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp("[0-9]")),
],
// maxLengthEnforced: true, // maxLengthEnforced: true,
// onChanged: (value) { // onChanged: (value) {
// widget.controller.text = countryCode; // widget.controller.text = countryCode;

Loading…
Cancel
Save