You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
216 lines
8.6 KiB
Dart
216 lines
8.6 KiB
Dart
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart';
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
import 'package:maps_launcher/maps_launcher.dart';
|
|
|
|
class HospitalsPage extends StatefulWidget {
|
|
final List<GetHMGLocationsModel> findusHospitalModelList;
|
|
|
|
HospitalsPage({Key key, this.findusHospitalModelList});
|
|
|
|
@override
|
|
_HospitalsPageState createState() => _HospitalsPageState();
|
|
}
|
|
|
|
class _HospitalsPageState extends State<HospitalsPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SingleChildScrollView(
|
|
physics: BouncingScrollPhysics(),
|
|
padding: EdgeInsets.only(bottom: 21, top: 21, left: 21, right: 21),
|
|
child: Column(
|
|
children: [
|
|
ListView.separated(
|
|
physics: NeverScrollableScrollPhysics(),
|
|
shrinkWrap: true,
|
|
padding: EdgeInsets.zero,
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
itemBuilder: (context, index) {
|
|
GetHMGLocationsModel _location = widget.findusHospitalModelList[index];
|
|
return Container(
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(10.0),
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
//spreadRadius: 5,
|
|
blurRadius: 27,
|
|
offset: Offset(0, -3),
|
|
),
|
|
],
|
|
color: Colors.white),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
InkWell(
|
|
onTap: () {
|
|
showDialog(
|
|
context: context,
|
|
builder: (_) => AssetGiffyDialog(
|
|
title: Text(
|
|
_location.locationName,
|
|
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
|
|
),
|
|
image: Image.network(
|
|
_location.projectImageURL.toString(),
|
|
fit: BoxFit.cover,
|
|
),
|
|
buttonCancelText: Text(TranslationBase.of(context).cancel),
|
|
buttonCancelColor: Colors.grey,
|
|
onlyCancelButton: true,
|
|
),
|
|
);
|
|
},
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(12),
|
|
child: Image.network(
|
|
_location.projectImageURL.toString(),
|
|
width: 48,
|
|
height: 48,
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.only(left: 12, right: 12),
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
_location.locationName?.trim() ?? "",
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w600,
|
|
color: Color(0xff2E303A),
|
|
letterSpacing: -0.56,
|
|
),
|
|
),
|
|
|
|
Text(
|
|
TranslationBase.of(context).km+" "+ _location.distanceInKilometers.toString() ?? "",
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
color: Color(0xff2E303A),
|
|
letterSpacing: -0.56,
|
|
),
|
|
),
|
|
],
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
),
|
|
),
|
|
), //model.cOCItemList[index].cOCTitl
|
|
IconButton(
|
|
icon: Icon(
|
|
Icons.location_on,
|
|
color: Color(0xff2B353E),
|
|
),
|
|
constraints: BoxConstraints(),
|
|
padding: EdgeInsets.all(8),
|
|
tooltip: '',
|
|
onPressed: () {
|
|
setState(() {
|
|
MapsLauncher.launchCoordinates(double.parse(_location.latitude), double.parse(_location.longitude), _location.locationName);
|
|
});
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: Icon(
|
|
Icons.phone,
|
|
color: Color(0xff2B353E),
|
|
),
|
|
constraints: BoxConstraints(),
|
|
padding: EdgeInsets.all(8),
|
|
tooltip: '',
|
|
onPressed: () {
|
|
setState(() {
|
|
launch("tel://" + _location.phoneNumber);
|
|
});
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
itemCount: widget.findusHospitalModelList.length,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 14),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(10.0),
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
//spreadRadius: 5,
|
|
blurRadius: 27,
|
|
offset: Offset(0, -3),
|
|
),
|
|
],
|
|
color: Colors.white),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
IconButton(
|
|
icon: new Image.asset('assets/images/new-design/youtube.png'),
|
|
iconSize: 48,
|
|
tooltip: 'Youtube',
|
|
onPressed: () {
|
|
setState(() {
|
|
launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals");
|
|
});
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: new Image.asset('assets/images/new-design/linkedin.png'),
|
|
tooltip: 'LinkedIn',
|
|
iconSize: 48,
|
|
onPressed: () {
|
|
setState(() {
|
|
launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group");
|
|
});
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: new Image.asset('assets/images/new-design/twitter.png'),
|
|
tooltip: 'Twitter',
|
|
iconSize: 48,
|
|
onPressed: () {
|
|
setState(() {
|
|
launch("https://twitter.com/HMG");
|
|
});
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: new Image.asset('assets/images/new-design/facebook.png'),
|
|
tooltip: 'facebook',
|
|
iconSize: 48,
|
|
onPressed: () {
|
|
setState(() {
|
|
launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn");
|
|
});
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|