From 0e459de1a3f061f8e18432789aa7f3d9319a7718 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 19 Apr 2021 21:29:18 +0300 Subject: [PATCH] fix pharmacies list --- .../medicine/pharmacies_list_screen.dart | 162 ++++++++---------- 1 file changed, 76 insertions(+), 86 deletions(-) diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 6af1d5b7..49c39c53 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,7 +23,6 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - // In the constructor, require a item id. PharmaciesListScreen({Key key, @required this.itemID, this.url}) : super(key: key); @@ -32,18 +31,9 @@ class PharmaciesListScreen extends StatefulWidget { } class _PharmaciesListState extends State { - var _data; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - bool _isInit = true; - //bool _isOutOfStuck = false; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _isInit = false; - } @override Widget build(BuildContext context) { @@ -145,90 +135,90 @@ class _PharmaciesListState extends State { ? Alignment.topRight : Alignment.topLeft, ), - Expanded( - child: Container( - width: SizeConfig.screenWidth * 0.99, - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.network( - model - .pharmaciesList[index]["ProjectImageURL"], - height: - SizeConfig.imageSizeMultiplier * 15, - width: - SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, - ), - ), - ), - Expanded( - flex: 4, - child: AppText( + Container( + width: SizeConfig.screenWidth * 0.99, + margin: EdgeInsets.only(left: 10,right: 10), + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: model.pharmaciesList == null ? 0 : model + .pharmaciesList.length, + itemBuilder: (BuildContext context, int index) { + return RoundedContainer( + margin: EdgeInsets.only(top: 5), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( model - .pharmaciesList[index]["LocationDescription"], - margin: 10, + .pharmaciesList[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), ), - Expanded( - flex: 2, - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.end, - children: [ - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.call, - color: Colors.red, - ), - onTap: () => - launch("tel://" + - model - .pharmaciesList[index]["PhoneNumber"]), + ), + Expanded( + flex: 4, + child: AppText( + model + .pharmaciesList[index]["LocationDescription"], + margin: 10, + ), + ), + Expanded( + flex: 2, + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.end, + crossAxisAlignment: WrapCrossAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.call, + color: Colors.red, ), + onTap: () => + launch("tel://" + + model + .pharmaciesList[index]["PhoneNumber"]), ), - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.pin_drop, - color: Colors.red, - ), - onTap: () { - MapsLauncher.launchCoordinates( - double.parse( - model - .pharmaciesList[index]["Latitude"]), - double.parse( - model - .pharmaciesList[index]["Longitude"]), - model.pharmaciesList[index] - ["LocationDescription"]); - }, + ), + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.pin_drop, + color: Colors.red, ), + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + model + .pharmaciesList[index]["Latitude"]), + double.parse( + model + .pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index] + ["LocationDescription"]); + }, ), - ], - ), + ), + ], ), - ], - ), - ); - }), - ), + ), + ], + ), + ); + }), ) ]), ),),);