diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a019ae00..6245735d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1457,4 +1457,12 @@ const Map localizedValues = { "en": "Drive-Thru", "ar": "من السيارة" }, + "NearestErDesc": { + "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." + }, + "NearestEr": { + "en": "Nearest ER", + "ar": "أقرب ER" + }, }; diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index bb8babe1..eaf0d4ef 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -20,6 +20,10 @@ class NearestEr extends StatelessWidget { @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double itemHeight = (size.height - kToolbarHeight - 24) / 2; + final double itemWidth = size.width / 2; + return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getProjectAvgERWaitingTimeOrders( @@ -27,14 +31,14 @@ class NearestEr extends StatelessWidget { : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Nearest ER', + appBarTitle: TranslationBase.of(context).NearestEr, baseViewModel: mode, body: mode.ProjectAvgERWaitingTimeModeList.length > 0 ? Container( child: ListView( children: [ Text( - "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "${TranslationBase.of(context).NearestErDesc}", textAlign: TextAlign.center, style: TextStyle( fontSize: 18.0, @@ -45,7 +49,7 @@ class NearestEr extends StatelessWidget { margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), child: GridView.count( crossAxisCount: 2, - // childAspectRatio: 2.2, + childAspectRatio: (itemWidth / itemWidth), crossAxisSpacing: 10, mainAxisSpacing: 10, controller: @@ -54,329 +58,43 @@ class NearestEr extends StatelessWidget { padding: const EdgeInsets.all(4.0), children: List.generate(7, (index) { return Container( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[index] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[index].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[index] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName, - ), + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[index] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[index].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[index] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName, + cardSize: itemWidth, ), ); }), ), ), - /* Container( - margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[0] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[0].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[0] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[1] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[1].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[1] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName, - ), - ), - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[2] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[2].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[2] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[3] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[3].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[3] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName, - ), - ), - flex: 0, - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[4] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[4].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[4] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[5] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[5].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[5] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName, - ), - ), - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[6] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[6].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[6] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName, - ), - ), - flex: 0, - ), - ], - ), - ], - )),*/ ], ), ) diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 8647ad62..69ccaffe 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -19,6 +19,8 @@ class CardPosition extends StatelessWidget { final latitude; final longitude; final projectname; + final cardSize; + const CardPosition( { @required this.image, @@ -30,6 +32,7 @@ class CardPosition extends StatelessWidget { @required this.latitude, @required this.longitude, @required this.projectname , + @required this.cardSize , }); @override @@ -40,17 +43,17 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:MediaQuery.of(context).size.width * 0.47,//165, - margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), + // width:MediaQuery.of(context).size.width * 0.47,//165, + margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) ], borderRadius: BorderRadius.circular(10), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + height: cardSize * 0.2 - 8, + margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0), child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle( @@ -59,12 +62,14 @@ class CardPosition extends StatelessWidget { fontSize: 2 * SizeConfig.textMultiplier)), ), Container( + height: cardSize * 0.5 - 8, alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), - child: Image.asset(this.image, width: 60.0, height: 60.0), + margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4), ), Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), + height: cardSize * 0.2 - 8, child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 736e7e14..257ceb8e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1245,6 +1245,8 @@ class TranslationBase { localizedValues['shoppingCart'][locale.languageCode]; String get covidTest => localizedValues['covidTest'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode]; + String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; + String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; }