Contact us
parent
dd3608e9ee
commit
c2b7507005
@ -0,0 +1,80 @@
|
|||||||
|
class GetHMGLocationsModel {
|
||||||
|
dynamic cityID;
|
||||||
|
String cityName;
|
||||||
|
dynamic cityNameN;
|
||||||
|
dynamic distanceInKilometers;
|
||||||
|
bool isActive;
|
||||||
|
String latitude;
|
||||||
|
int locationID;
|
||||||
|
String locationName;
|
||||||
|
dynamic locationNameN;
|
||||||
|
dynamic locationType;
|
||||||
|
String longitude;
|
||||||
|
int pharmacyLocationID;
|
||||||
|
String phoneNumber;
|
||||||
|
int projectID;
|
||||||
|
String projectImageURL;
|
||||||
|
int setupID;
|
||||||
|
dynamic sortOrder;
|
||||||
|
|
||||||
|
GetHMGLocationsModel(
|
||||||
|
{this.cityID,
|
||||||
|
this.cityName,
|
||||||
|
this.cityNameN,
|
||||||
|
this.distanceInKilometers,
|
||||||
|
this.isActive,
|
||||||
|
this.latitude,
|
||||||
|
this.locationID,
|
||||||
|
this.locationName,
|
||||||
|
this.locationNameN,
|
||||||
|
this.locationType,
|
||||||
|
this.longitude,
|
||||||
|
this.pharmacyLocationID,
|
||||||
|
this.phoneNumber,
|
||||||
|
this.projectID,
|
||||||
|
this.projectImageURL,
|
||||||
|
this.setupID,
|
||||||
|
this.sortOrder});
|
||||||
|
|
||||||
|
GetHMGLocationsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
cityID = json['CityID'];
|
||||||
|
cityName = json['CityName'];
|
||||||
|
cityNameN = json['CityNameN'];
|
||||||
|
distanceInKilometers = json['DistanceInKilometers'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
latitude = json['Latitude'];
|
||||||
|
locationID = json['LocationID'];
|
||||||
|
locationName = json['LocationName'];
|
||||||
|
locationNameN = json['LocationNameN'];
|
||||||
|
locationType = json['LocationType'];
|
||||||
|
longitude = json['Longitude'];
|
||||||
|
pharmacyLocationID = json['PharmacyLocationID'];
|
||||||
|
phoneNumber = json['PhoneNumber'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
projectImageURL = json['ProjectImageURL'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
sortOrder = json['SortOrder'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['CityID'] = this.cityID;
|
||||||
|
data['CityName'] = this.cityName;
|
||||||
|
data['CityNameN'] = this.cityNameN;
|
||||||
|
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['Latitude'] = this.latitude;
|
||||||
|
data['LocationID'] = this.locationID;
|
||||||
|
data['LocationName'] = this.locationName;
|
||||||
|
data['LocationNameN'] = this.locationNameN;
|
||||||
|
data['LocationType'] = this.locationType;
|
||||||
|
data['Longitude'] = this.longitude;
|
||||||
|
data['PharmacyLocationID'] = this.pharmacyLocationID;
|
||||||
|
data['PhoneNumber'] = this.phoneNumber;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['ProjectImageURL'] = this.projectImageURL;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['SortOrder'] = this.sortOrder;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
|
||||||
|
import '../base_service.dart';
|
||||||
|
|
||||||
|
class FindusService extends BaseService {
|
||||||
|
//List<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List();
|
||||||
|
//Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
List<GetHMGLocationsModel> FindusModelList = List();
|
||||||
|
List<GetHMGLocationsModel> FindusHospitalModelList = List();
|
||||||
|
List<GetHMGLocationsModel> FindusPharmaciesModelList = List();
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
Future getAllFindUsOrders() async {
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_FINDUS_REQUEST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
FindusModelList.clear();
|
||||||
|
FindusHospitalModelList.clear();
|
||||||
|
FindusPharmaciesModelList.clear();
|
||||||
|
|
||||||
|
response['ListHMGLocation'].forEach((vital) {
|
||||||
|
if (GetHMGLocationsModel.fromJson(vital).locationType == 1) {
|
||||||
|
FindusHospitalModelList.add(GetHMGLocationsModel.fromJson(vital));
|
||||||
|
} else {
|
||||||
|
FindusPharmaciesModelList.add(GetHMGLocationsModel.fromJson(vital));
|
||||||
|
}
|
||||||
|
// FindusModelList.add(
|
||||||
|
// GetHMGLocationsModel.fromJson(vital));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/contactus/finadus_service.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class FindusViewModel extends BaseViewModel {
|
||||||
|
FindusService _findusService = locator<FindusService>();
|
||||||
|
|
||||||
|
List<GetHMGLocationsModel> get FindusModelList =>
|
||||||
|
_findusService.FindusModelList;
|
||||||
|
|
||||||
|
List<GetHMGLocationsModel> get FindusHospitalModelList=>
|
||||||
|
_findusService.FindusHospitalModelList;
|
||||||
|
|
||||||
|
List<GetHMGLocationsModel> get FindusPharmaciesModelList=>
|
||||||
|
_findusService.FindusPharmaciesModelList;
|
||||||
|
|
||||||
|
getFindUsRequestOrders() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
await _findusService.getAllFindUsOrders();
|
||||||
|
|
||||||
|
if (_findusService.hasError) {
|
||||||
|
error = _findusService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HospitalsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_HospitalsPageState createState() => _HospitalsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HospitalsPageState extends State<HospitalsPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<FindusViewModel>(
|
||||||
|
onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Container(
|
||||||
|
margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ),
|
||||||
|
padding: EdgeInsets.all(15.0),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.FindusHospitalModelList.length,//model.cOCItemList.length,
|
||||||
|
itemBuilder: (context, index) => Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(color: Colors.white, width: 0.5),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
// margin: EdgeInsets.all(4),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
// SizedBox(height: 8,),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
// margin: EdgeInsets.only(right: 15),
|
||||||
|
child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())),
|
||||||
|
Container(child: Texts('${model.FindusHospitalModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl
|
||||||
|
// Texts(
|
||||||
|
// 'Number :${model.FindusHospitalModelList[index].locationName}',
|
||||||
|
// variant: 'overline',
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Expanded(
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.start,
|
||||||
|
// children: <Widget>[
|
||||||
|
// Texts('${model.FindusHospitalModelList[index].locationName}'),
|
||||||
|
// Texts(
|
||||||
|
// '${model.FindusHospitalModelList[index].locationName}',
|
||||||
|
// variant: 'overline',
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// Texts('${model.FindusHospitalModelList[index].locationName}'),
|
||||||
|
Divider(height: 4.5,color: Colors.grey[500],)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PharmaciesPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_PharmaciesPageState createState() => _PharmaciesPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PharmaciesPageState extends State<PharmaciesPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<FindusViewModel>(
|
||||||
|
onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Container(
|
||||||
|
margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ),
|
||||||
|
padding: EdgeInsets.all(15.0),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.FindusPharmaciesModelList.length,//model.cOCItemList.length,
|
||||||
|
itemBuilder: (context, index) => Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(color: Colors.white, width: 0.5),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
// margin: EdgeInsets.all(4),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
// SizedBox(height: 8,),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
// margin: EdgeInsets.only(right: 15),
|
||||||
|
child: Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString())),
|
||||||
|
Container(child: Texts('${model.FindusPharmaciesModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl
|
||||||
|
// Texts(
|
||||||
|
// 'Number :${model.FindusHospitalModelList[index].locationName}',
|
||||||
|
// variant: 'overline',
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Expanded(
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.start,
|
||||||
|
// children: <Widget>[
|
||||||
|
// Texts('${model.FindusHospitalModelList[index].locationName}'),
|
||||||
|
// Texts(
|
||||||
|
// '${model.FindusHospitalModelList[index].locationName}',
|
||||||
|
// variant: 'overline',
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// Texts('${model.FindusHospitalModelList[index].locationName}'),
|
||||||
|
Divider(height: 4.5,color: Colors.grey[500],)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CardCommonContact extends StatelessWidget {
|
||||||
|
final image;
|
||||||
|
final text;
|
||||||
|
final subText;
|
||||||
|
final type;
|
||||||
|
const CardCommonContact(
|
||||||
|
{@required this.image,
|
||||||
|
@required this.text,
|
||||||
|
@required this.subText,
|
||||||
|
@required this.type});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
navigateToSearch(context, this.type);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
|
||||||
|
decoration: BoxDecoration(boxShadow: [
|
||||||
|
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
|
||||||
|
], borderRadius: BorderRadius.circular(10), color: Colors.white),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
||||||
|
child: Text(this.text,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
color: new Color(0xFFc5272d),
|
||||||
|
letterSpacing: 1.0,
|
||||||
|
fontSize: 20.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
||||||
|
child: Text(this.subText,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0),
|
||||||
|
child: Image.asset(this.image, width: 60.0, height: 60.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future navigateToSearch(context, type) async {
|
||||||
|
//===Switch case===
|
||||||
|
if (type == 0) {
|
||||||
|
Navigator.push(context, FadePage(page: FindUsPage()));
|
||||||
|
} else if (type == 1) {
|
||||||
|
Navigator.push(context, FadePage(page: FeedbackHomePage()));
|
||||||
|
} else if (type == 2) {
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// FadePage(
|
||||||
|
// page: FeedbackHomePage()));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue