Merge branch 'patient_app_services' into 'development'

fix pharmacies list

See merge request Cloud_Solution/doctor_app_flutter!519
merge-requests/521/merge
Mohammad Aljammal 4 years ago
commit 5560955bd7

@ -23,7 +23,6 @@ class PharmaciesListScreen extends StatefulWidget {
final String url; final String url;
// In the constructor, require a item id.
PharmaciesListScreen({Key key, @required this.itemID, this.url}) PharmaciesListScreen({Key key, @required this.itemID, this.url})
: super(key: key); : super(key: key);
@ -32,18 +31,9 @@ class PharmaciesListScreen extends StatefulWidget {
} }
class _PharmaciesListState extends State<PharmaciesListScreen> { class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
bool _isInit = true;
//bool _isOutOfStuck = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -145,90 +135,90 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
? Alignment.topRight ? Alignment.topRight
: Alignment.topLeft, : Alignment.topLeft,
), ),
Expanded( Container(
child: Container( width: SizeConfig.screenWidth * 0.99,
width: SizeConfig.screenWidth * 0.99, margin: EdgeInsets.only(left: 10,right: 10),
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: model.pharmaciesList == null ? 0 : model itemCount: model.pharmaciesList == null ? 0 : model
.pharmaciesList.length, .pharmaciesList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return RoundedContainer( return RoundedContainer(
child: Row( margin: EdgeInsets.only(top: 5),
children: <Widget>[ child: Row(
Expanded( children: <Widget>[
flex: 1, Expanded(
child: ClipRRect( flex: 1,
borderRadius: child: ClipRRect(
BorderRadius.all(Radius.circular(7)), borderRadius:
child: Image.network( BorderRadius.all(Radius.circular(7)),
model child: Image.network(
.pharmaciesList[index]["ProjectImageURL"],
height:
SizeConfig.imageSizeMultiplier * 15,
width:
SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 4,
child: AppText(
model model
.pharmaciesList[index]["LocationDescription"], .pharmaciesList[index]["ProjectImageURL"],
margin: 10, height:
SizeConfig.imageSizeMultiplier * 15,
width:
SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover,
), ),
), ),
Expanded( ),
flex: 2, Expanded(
child: Wrap( flex: 4,
direction: Axis.horizontal, child: AppText(
alignment: WrapAlignment.end, model
crossAxisAlignment: WrapCrossAlignment.end, .pharmaciesList[index]["LocationDescription"],
children: <Widget>[ margin: 10,
Padding( ),
padding: EdgeInsets.all(5), ),
child: InkWell( Expanded(
child: Icon( flex: 2,
Icons.call, child: Wrap(
color: Colors.red, direction: Axis.horizontal,
), alignment: WrapAlignment.end,
onTap: () => crossAxisAlignment: WrapCrossAlignment.end,
launch("tel://" + children: <Widget>[
model Padding(
.pharmaciesList[index]["PhoneNumber"]), 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), Padding(
child: InkWell( padding: EdgeInsets.all(5),
child: Icon( child: InkWell(
Icons.pin_drop, child: Icon(
color: Colors.red, 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"]);
},
), ),
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(
model
.pharmaciesList[index]["Latitude"]),
double.parse(
model
.pharmaciesList[index]["Longitude"]),
model.pharmaciesList[index]
["LocationDescription"]);
},
), ),
], ),
), ],
), ),
], ),
), ],
); ),
}), );
), }),
) )
]), ]),
),),); ),),);

Loading…
Cancel
Save