Merge branch 'find_us' into 'master'
Find us See merge request Cloud_Solution/diplomatic-quarter!51merge-update-with-lab-changes
commit
03e009c212
@ -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,37 @@
|
||||
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));
|
||||
}
|
||||
|
||||
});
|
||||
}, 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,120 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/feedback/status_feedback_page.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 FindUsPage extends StatefulWidget {
|
||||
@override
|
||||
_FindUsPageState createState() => _FindUsPageState();
|
||||
}
|
||||
|
||||
class _FindUsPageState extends State<FindUsPage> with SingleTickerProviderStateMixin{
|
||||
TabController _tabController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
@override
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: 'Locations',
|
||||
body: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(65.0),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
bottom: 1,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
height: 70.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 60.0,
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.7),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
indicatorWeight: 5.0,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorColor: Colors.red[800],
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding:
|
||||
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.30,
|
||||
child: Center(
|
||||
child: Texts(' Hospitals '),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.30,
|
||||
child: Center(
|
||||
child: Texts(' Pharmacies '),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[
|
||||
HospitalsPage(),//SendFeedbackPage(),
|
||||
PharmaciesPage()//StatusFeedbackPage()
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
|
||||
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';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:maps_launcher/maps_launcher.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: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 15,right: 15,top: 70),
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(model.FindusHospitalModelList.length, (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
|
||||
IconButton(
|
||||
icon: Icon(Icons.person_pin_circle_outlined),
|
||||
tooltip: 'Increase volume by 10',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName);
|
||||
// _volume += 10;
|
||||
});
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.phone),
|
||||
tooltip: 'Increase volume by 10',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
// _volume += 10;
|
||||
launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
// Texts(
|
||||
// 'Number :${model.FindusHospitalModelList[index].locationName}',
|
||||
// variant: 'overline',
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
// Texts('${model.FindusHospitalModelList[index].locationName}'),
|
||||
Divider(height: 4.5,color: Colors.grey[500],)
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
|
||||
Container(width: double.infinity,
|
||||
height: 45,color: Colors.red,),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,133 @@
|
||||
|
||||
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';
|
||||
import 'package:giffy_dialog/giffy_dialog.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>[
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
showDialog(
|
||||
context: context,builder: (_) => AssetGiffyDialog(
|
||||
title: Text(model.FindusPharmaciesModelList[index].locationName,
|
||||
style: TextStyle(
|
||||
fontSize: 22.0, fontWeight: FontWeight.w600),
|
||||
),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,),
|
||||
|
||||
// buttonOkText:Text("LOCATION"),
|
||||
// buttonOkColor: Colors.grey,
|
||||
buttonCancelText:Text('cancel') ,
|
||||
buttonCancelColor: Colors.grey,
|
||||
// onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);},
|
||||
// onCancelButtonPressed:(),
|
||||
|
||||
|
||||
|
||||
|
||||
) );
|
||||
},
|
||||
child: 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
|
||||
IconButton(
|
||||
icon: Icon(Icons.person_pin_circle_outlined),
|
||||
tooltip: 'Increase volume by 10',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
// _volume += 10;
|
||||
});
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.phone),
|
||||
tooltip: 'Increase volume by 10',
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
// _volume += 10;
|
||||
});
|
||||
},
|
||||
),
|
||||
// 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,93 @@
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/location_util.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
|
||||
|
||||
class HmgServicePage extends StatefulWidget {
|
||||
@override
|
||||
_HmgServicePageState createState() => _HmgServicePageState();
|
||||
}
|
||||
|
||||
class _HmgServicePageState extends State<HmgServicePage> {
|
||||
|
||||
LocationUtils locationUtils;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
locationUtils =
|
||||
new LocationUtils(isShowConfirmDialog: true, context: context);
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
|
||||
|
||||
super.initState();
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,//widget.isAppbar,
|
||||
appBarTitle: "HMG Services",//TranslationBase.of(context).bookAppo,
|
||||
body: Container(
|
||||
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: CardCommonContact(
|
||||
image: 'assets/images/new-design/find_us_icon.png',
|
||||
text: "Find us",
|
||||
subText: "",
|
||||
type: 0,
|
||||
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: CardCommonContact(
|
||||
image: 'assets/images/new-design/feedback_icon.png',
|
||||
text: "Feedback",
|
||||
subText: "",
|
||||
type: 1),
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: CardCommonContact(
|
||||
image: 'assets/images/new-design/live_chat_icon.png',
|
||||
text: "Live Chat",
|
||||
subText: "Service",
|
||||
type: 2,
|
||||
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Opacity(
|
||||
opacity: 0,
|
||||
child: CardCommonContact(
|
||||
image: 'assets/images/new-design/feedback_icon.png',
|
||||
text: "Feedback",
|
||||
subText: "",
|
||||
type: 3),
|
||||
),
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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