pharmacies list
parent
a59a2d5ad3
commit
c30fcbc2b5
@ -0,0 +1,46 @@
|
||||
/*
|
||||
*@author: Ibrahim Albitar
|
||||
*@Date:27/4/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc:
|
||||
*/
|
||||
class PharmaciesListRequestModel {
|
||||
|
||||
// {"ItemID":90417,
|
||||
// "LanguageID":2,
|
||||
// "stamp":"2020-03-08T07:49:14.067Z",
|
||||
// "IPAdress":"11.11.11.11",
|
||||
// "VersionID":1.2,
|
||||
// "Channel":9,
|
||||
// "TokenID":"PpIU/OWJ40yxMHQtCXL0DA==",
|
||||
// "SessionID":"dz1hqVj1Fk",
|
||||
// "IsLoginForDoctorApp":true,
|
||||
// "PatientOutSA":false,
|
||||
// "PatientTypeID":1}
|
||||
|
||||
int ItemID;
|
||||
int LanguageID;
|
||||
String stamp;
|
||||
String IPAdress;
|
||||
double VersionID;
|
||||
String TokenID;
|
||||
String SessionID;
|
||||
bool IsLoginForDoctorApp;
|
||||
bool PatientOutSA;
|
||||
int PatientTypeID;
|
||||
int Channel;
|
||||
|
||||
PharmaciesListRequestModel(
|
||||
{this.ItemID,
|
||||
this.PatientTypeID,
|
||||
this.LanguageID,
|
||||
this.stamp,
|
||||
this.IPAdress,
|
||||
this.VersionID,
|
||||
this.TokenID,
|
||||
this.SessionID,
|
||||
this.IsLoginForDoctorApp,
|
||||
this.Channel,
|
||||
this.PatientOutSA});
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
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/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
||||
|
||||
class PharmaciesListScreen extends StatefulWidget {
|
||||
@override
|
||||
_PharmaciesListState createState() => _PharmaciesListState();
|
||||
}
|
||||
|
||||
class _PharmaciesListState extends State<PharmaciesListScreen> {
|
||||
var _pharmaciesModel = PharmaciesListRequestModel(
|
||||
ItemID: 90417,
|
||||
IsLoginForDoctorApp: true,
|
||||
PatientOutSA: false,
|
||||
PatientTypeID: 1,
|
||||
LanguageID: 2,
|
||||
IPAdress: "11.11.11.11",
|
||||
VersionID: 1.2,
|
||||
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
|
||||
stamp: "2020-04-23T21:01:21.492Z",
|
||||
Channel: 9,
|
||||
SessionID: "e29zoooEJ4");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (context) => MedicineProvider(), //change builder to create
|
||||
child: Consumer<MedicineProvider>(
|
||||
builder: (context, provider, child) => AppScaffold(
|
||||
appBarTitle: "Pharmacies List",
|
||||
body: RaisedButton(
|
||||
onPressed: () {
|
||||
MedicineProvider medicineProvider =
|
||||
Provider.of<MedicineProvider>(context);
|
||||
pharmaciesList(context, medicineProvider);
|
||||
},
|
||||
))));
|
||||
}
|
||||
|
||||
pharmaciesList(context, MedicineProvider medicineProvider) {
|
||||
medicineProvider.getPharmaciesList(_pharmaciesModel).then((res) {
|
||||
print(res.toString());
|
||||
if (res['MessageStatus'] == 1) {
|
||||
print("ListPharmcy " + res['PharmList'].toString());
|
||||
|
||||
//Navigator.of(context).pushNamed();
|
||||
} else {
|
||||
// handel error
|
||||
// widget.showCenterShortLoadingToast("watting");
|
||||
//helpers.showErrorToast(res['ErrorEndUserMessage']);
|
||||
print(res['MessageStatus'].toString());
|
||||
}
|
||||
// Navigator.of(context).pushNamed(HOME);
|
||||
}).catchError((err) {
|
||||
print('$err');
|
||||
//helpers.showErrorToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue