|
|
|
|
@ -55,7 +55,17 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).pharmaciesList,
|
|
|
|
|
body: Container(
|
|
|
|
|
body: !_medicineProvider.isFinished
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: _medicineProvider.hasError
|
|
|
|
|
? Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
_medicineProvider.errorMsg,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Theme.of(context).errorColor),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
:Container(
|
|
|
|
|
height: SizeConfig.screenHeight,
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
@ -63,84 +73,70 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
physics: const AlwaysScrollableScrollPhysics(),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: !_medicineProvider.isFinished
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: _medicineProvider.hasError
|
|
|
|
|
? Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
_medicineProvider.errorMsg,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Theme.of(context).errorColor),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: StreamBuilder<Object>(
|
|
|
|
|
stream: null,
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
return Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.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(
|
|
|
|
|
TranslationBase.of(context).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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
})),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.description,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginTop: 0,
|
|
|
|
|
marginRight: 10,
|
|
|
|
|
marginBottom: 2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
_medicineProvider.pharmaciesList[0]["ItemDescription"],
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginTop: 0,
|
|
|
|
|
marginRight: 10,
|
|
|
|
|
marginBottom: 10,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).price,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginTop: 0,
|
|
|
|
|
marginRight: 10,
|
|
|
|
|
marginBottom: 2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
_medicineProvider.pharmaciesList[0]["SellingPrice"]
|
|
|
|
|
.toString(),
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginTop: 0,
|
|
|
|
|
marginRight: 10,
|
|
|
|
|
marginBottom: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 2,
|
|
|
|
|
@ -165,7 +161,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: _data == null ? 0 : _data.length,
|
|
|
|
|
itemCount: _medicineProvider.pharmaciesList == null ? 0 : _medicineProvider.pharmaciesList.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -176,7 +172,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(7)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
_data[index]["ProjectImageURL"],
|
|
|
|
|
_medicineProvider.pharmaciesList[index]["ProjectImageURL"],
|
|
|
|
|
height:
|
|
|
|
|
SizeConfig.imageSizeMultiplier * 15,
|
|
|
|
|
width:
|
|
|
|
|
@ -188,7 +184,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: AppText(
|
|
|
|
|
_data[index]["LocationDescription"],
|
|
|
|
|
_medicineProvider.pharmaciesList[index]["LocationDescription"],
|
|
|
|
|
margin: 10,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -207,7 +203,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
onTap: () => launch("tel://" +
|
|
|
|
|
_data[index]["PhoneNumber"]),
|
|
|
|
|
_medicineProvider.pharmaciesList[index]["PhoneNumber"]),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
@ -220,10 +216,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
onTap: () {
|
|
|
|
|
MapsLauncher.launchCoordinates(
|
|
|
|
|
double.parse(
|
|
|
|
|
_data[index]["Latitude"]),
|
|
|
|
|
_medicineProvider.pharmaciesList[index]["Latitude"]),
|
|
|
|
|
double.parse(
|
|
|
|
|
_data[index]["Longitude"]),
|
|
|
|
|
_data[index]
|
|
|
|
|
_medicineProvider.pharmaciesList[index]["Longitude"]),
|
|
|
|
|
_medicineProvider.pharmaciesList[index]
|
|
|
|
|
["LocationDescription"]);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -241,19 +237,15 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> pharmaciesList() async {
|
|
|
|
|
_medicineProvider.getPharmaciesList(widget.itemID).then((result) {
|
|
|
|
|
this.setState(() {
|
|
|
|
|
_data = _medicineProvider.pharmaciesList;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return true;
|
|
|
|
|
pharmaciesList() async {
|
|
|
|
|
_medicineProvider.getPharmaciesList(widget.itemID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Image imageFromBase64String(String base64String) {
|
|
|
|
|
return Image.memory(base64Decode(base64String));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO CHECK THE URL IS NULL OR NOT
|
|
|
|
|
Uint8List dataFromBase64String(String base64String) {
|
|
|
|
|
return base64Decode(base64String);
|
|
|
|
|
}
|
|
|
|
|
|