|
|
|
|
@ -1,15 +1,20 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/pharmacies_List_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:maps_launcher/maps_launcher.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
|
|
|
|
|
|
|
|
|
@ -27,6 +32,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
var _data;
|
|
|
|
|
Helpers helpers = new Helpers();
|
|
|
|
|
MedicineProvider _medicineProvider;
|
|
|
|
|
//bool _isOutOfStuck = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -94,20 +100,43 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: _data == null ? 0 : _data.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
child: MedicineItemWidget(
|
|
|
|
|
label: _data[index]["LocationDescription"],
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
//Navigator.of(context).pushNamed(PHARMACIES_LIST);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => PharmaciesListScreen(
|
|
|
|
|
itemID: _data[index]["ItemID"]),
|
|
|
|
|
return Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
MedicineItemWidget(
|
|
|
|
|
label: _data[index]["LocationDescription"],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(flex: 2, child: SizedBox()),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 6,
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: "Call",
|
|
|
|
|
fontSize: 2,
|
|
|
|
|
color: Colors.brown[200],
|
|
|
|
|
padding: 0,
|
|
|
|
|
onPressed: () => launch("tel://"+_data[index]["PhoneNumber"])),
|
|
|
|
|
),
|
|
|
|
|
Expanded(flex: 1, child: SizedBox()),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 6,
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: "Direction",
|
|
|
|
|
fontSize: 2,
|
|
|
|
|
color: Color(PRIMARY_COLOR),
|
|
|
|
|
padding: 0,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
MapsLauncher.launchCoordinates(double.parse(_data[index]["Latitude"]), double.parse( _data[index]["Longitude"]), _data[index]["LocationDescription"] );
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
Expanded(flex: 2, child: SizedBox()),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -121,6 +150,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
|
|
|
|
|
_medicineProvider.getPharmaciesList(widget.itemID).then((result) {
|
|
|
|
|
this.setState(() {
|
|
|
|
|
_data = _medicineProvider.pharmaciesList;
|
|
|
|
|
//if(_data == null || _data.length == 0)
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return true;
|
|
|
|
|
|