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.
diplomatic-quarter/lib/pages/ErService/widgets/card_position.dart

109 lines
3.3 KiB
Dart

4 years ago
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
4 years ago
import 'package:diplomaticquarterapp/config/size_config.dart';
4 years ago
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:flutter/material.dart';
4 years ago
import 'package:giffy_dialog/giffy_dialog.dart';
4 years ago
import 'package:url_launcher/url_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart';
4 years ago
import '../NearestEr.dart';
class CardPosition extends StatelessWidget {
final image;
final text;
final subText;
final type;
4 years ago
final telephone;
final networkImage;
4 years ago
final latitude;
final longitude;
final projectname;
4 years ago
const CardPosition(
{
@required this.image,
@required this.text,
@required this.subText,
4 years ago
@required this.type,
@required this.telephone,
4 years ago
@required this.networkImage ,
@required this.latitude,
@required this.longitude,
@required this.projectname ,
});
4 years ago
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
4 years ago
navigateToSearch(context, this.type,this.telephone,this.networkImage,this.latitude,this.longitude,this.projectname);
4 years ago
4 years ago
},
child: Container(
width:MediaQuery.of(context).size.width * 0.47,//165,
4 years ago
margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0),
4 years ago
decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
4 years ago
4 years ago
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(this.text,
overflow: TextOverflow.clip,
style: TextStyle(
4 years ago
color: Colors.black,
4 years ago
letterSpacing: 1.0,
4 years ago
fontSize: 2 * SizeConfig.textMultiplier)),
4 years ago
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(this.subText,
overflow: TextOverflow.clip,
style: TextStyle(
4 years ago
color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)),
4 years ago
),
],
),
),
);
}
4 years ago
Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async {
4 years ago
showDialog(
4 years ago
context: context,builder: (_) => AssetGiffyDialog(
title: Text(projectname,
4 years ago
style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
4 years ago
),image:Image.network(networkImage, fit: BoxFit.cover,),
4 years ago
buttonOkText:Text("LOCATION"),
buttonOkColor: Colors.grey,
buttonCancelText:Text('CAll') ,
buttonCancelColor: Colors.grey,
4 years ago
onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);},
onCancelButtonPressed :() {launch("tel://" +telephone);}
4 years ago
) );
4 years ago
4 years ago
}
4 years ago
}
4 years ago
4 years ago