find us and prescription availability hospital location ui changes,
parent
68642c3ba4
commit
f13871de9a
@ -0,0 +1,108 @@
|
||||
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:maps_launcher/maps_launcher.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'my_rich_text.dart';
|
||||
|
||||
class HospitalLocation extends StatelessWidget {
|
||||
final GetHMGLocationsModel location;
|
||||
final bool showCity;
|
||||
|
||||
HospitalLocation(this.location, {Key key, this.showCity = false}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
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(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
location.locationName.trim(),
|
||||
style: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600, color: Color(0xff2E303A)),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
child: Image.network(
|
||||
location?.projectImageURL?.toString() ?? 'https://hmgwebservices.com/Images/Hospitals/15.jpg',
|
||||
width: 48,
|
||||
height: 48,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName?.trim().toString(), projectViewModel.isArabic),
|
||||
MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
contactButton(Icons.location_on, TranslationBase.of(context).locationa, () {
|
||||
MapsLauncher.launchCoordinates(double.parse(location.latitude), double.parse(location.longitude), location.locationName);
|
||||
}),
|
||||
SizedBox(height: 10),
|
||||
contactButton(Icons.call, TranslationBase.of(context).callNow, () {
|
||||
launch("tel://" + location.phoneNumber);
|
||||
}),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget contactButton(IconData _iconData, String title, VoidCallback callback) {
|
||||
return SizedBox(
|
||||
height: 32,
|
||||
child: FlatButton.icon(
|
||||
color: Color(0xffF5F5F5),
|
||||
shape: StadiumBorder(side: BorderSide(color: Color(0xffF0F0F0), width: 1)),
|
||||
onPressed: callback,
|
||||
icon: Icon(
|
||||
_iconData,
|
||||
size: 12,
|
||||
color: Color(0xff2E303A),
|
||||
),
|
||||
label: Text(
|
||||
title,
|
||||
style: TextStyle(fontSize: 12, letterSpacing: -0.48, fontWeight: FontWeight.w600, color: Color(0xff2E303A)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyRichText extends StatelessWidget {
|
||||
final String title;
|
||||
final String value;
|
||||
final bool isArabic;
|
||||
MyRichText(this.title,this.value,this.isArabic,{Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RichText(
|
||||
maxLines: 1,
|
||||
text: TextSpan(
|
||||
text: title,
|
||||
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: " $value",
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue