diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 60f24862..6974eaa4 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -51,166 +51,173 @@ class _PharmaciesListState extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: "Pharmacies List", - body: Column(children: [ - RoundedContainer( - child: !_medicineProvider.isFinished - ? DrAppCircularProgressIndeicator() - : _medicineProvider.hasError - ? Center( - child: Text( - _medicineProvider.errorMsg, - style: - TextStyle(color: Theme.of(context).errorColor), - ), - ) - : StreamBuilder( - stream: null, - builder: (context, snapshot) { - return Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.memory( - dataFromBase64String(widget.url), - height: SizeConfig.imageSizeMultiplier * 21, - width: SizeConfig.imageSizeMultiplier * 20, - fit: BoxFit.cover, + body: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ + RoundedContainer( + child: !_medicineProvider.isFinished + ? DrAppCircularProgressIndeicator() + : _medicineProvider.hasError + ? Center( + child: Text( + _medicineProvider.errorMsg, + style: + TextStyle(color: Theme.of(context).errorColor), + ), + ) + : StreamBuilder( + stream: null, + builder: (context, snapshot) { + return Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.memory( + dataFromBase64String(widget.url), + height: SizeConfig.imageSizeMultiplier * 21, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.cover, + ), ), ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + AppText( + "Description", + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + "Price", + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["SellingPrice"].toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + ); + })), + Container( + margin: EdgeInsets.only(top:SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4,), + child: Align( + alignment: Alignment.centerLeft, + child: AppText( + "You can Find it in", + fontWeight: FontWeight.bold, + ))), + Expanded( + child: Container( + width: SizeConfig.screenWidth * 0.99, + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics() , + itemCount: _data == null ? 0 : _data.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( + _data[index]["ProjectImageURL"], + height: SizeConfig.imageSizeMultiplier * 15, + width: SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - AppText( - "Description", - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - _data[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - "Price", - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - _data[0]["SellingPrice"].toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - ); - })), - Container( - margin: EdgeInsets.only(top:SizeConfig.widthMultiplier * 2, - bottom: SizeConfig.widthMultiplier * 2, - right: SizeConfig.widthMultiplier * 4, - left: SizeConfig.widthMultiplier * 4,), - child: Align( - alignment: Alignment.centerLeft, - child: AppText( - "You can Find it in", - fontWeight: FontWeight.bold, - ))), - Expanded( - child: Container( - width: SizeConfig.screenWidth * 0.99, - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: _data == null ? 0 : _data.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( - _data[index]["ProjectImageURL"], - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, ), ), - ), - Expanded( - flex: 4, - child: AppText( - _data[index]["LocationDescription"], - margin: 10, + Expanded( + flex: 4, + child: AppText( + _data[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, + 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://" + _data[index]["PhoneNumber"]), ), - onTap: () => launch( - "tel://" + _data[index]["PhoneNumber"]), ), - ), - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.pin_drop, - color: Colors.red, + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.pin_drop, + color: Colors.red, + ), + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + _data[index]["Latitude"]), + double.parse( + _data[index]["Longitude"]), + _data[index]["LocationDescription"]); + }, ), - onTap: () { - MapsLauncher.launchCoordinates( - double.parse( - _data[index]["Latitude"]), - double.parse( - _data[index]["Longitude"]), - _data[index]["LocationDescription"]); - }, ), - ), - ], + ], + ), ), - ), - ], - ), - ); - }), - ), - ) - ])); + ], + ), + ); + }), + ), + ) + ]), + )); } Future pharmaciesList() async {