Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First... You need to import pubspec.yaml on some depe like :: google_maps_flutter: ^0.5.21+7 and font_awesome_flutter version :)
- Google Point Map Flutter by Aung Khant :)
- class PointApp extends StatefulWidget {
- @override
- PointAppState createState() => PointAppState();
- }
- class PointAppState extends State<PointApp> {
- Completer<GoogleMapController> _controller = Completer();
- @override
- void initState() {
- super.initState();
- }
- double zoomVal = 5.0;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: IconButton(
- icon: Icon(FontAwesomeIcons.arrowLeft),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => NavigationDrawerDemo()),
- );
- },),
- title: Text("Yangon"),
- actions: <Widget>[
- IconButton(
- icon: Icon(FontAwesomeIcons.search),
- onPressed: () {
- //Need to Route n add Search Page
- }),
- ],
- ),
- body: Stack(
- children: <Widget>[
- _buildGoogleMap(context),
- _zoominusfunction(),
- _zoomplusfunction(),
- _buildContainer(),
- ],
- ),
- );
- }
- Widget _zoominusfunction() {
- return Align(
- alignment: Alignment.topLeft,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchMinus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal--;
- _minus(zoomVal);
- }),
- );
- }
- Widget _zoomplusfunction() {
- return Align(
- alignment: Alignment.topRight,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchPlus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal++;
- _plus(zoomVal);
- }),
- );
- }
- // for _minus Func
- Future<void> _minus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(16.9284, 96.2346), zoom: zoomVal)));
- }
- Future<void> _plus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(17.132582, 96.141762), zoom: zoomVal)));
- }
- // this method create Wid of Slide var
- Widget _buildContainer() {
- return Align(
- alignment: Alignment.bottomLeft,
- child: Container(
- margin: EdgeInsets.symmetric(vertical: 20.0),
- height: 150.0,
- child: ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipPcBXXmL5oczBzicqAhoQkzsX5SfOqVqmPlOlvQ=w225-h160-k-no",
- 16.8360031,96.1332521, "MHTi"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipMKRN-1zTYMUVPrH-CcKzfTo6Nai7wdL7D8PMkt=w340-h160-k-no",
- 16.7984618,96.1490159, "Shwe Dagon Pagoda"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://images.unsplash.com/photo-1504940892017-d23b9053d5d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
- 16.7783961,96.1532603, "BoGyoke Zay"),
- ),
- ],
- ),
- ),
- );
- }
- // box wid get goes h3r3
- Widget _boxes(String _image, double lat,double long,String pagodaName) {
- return GestureDetector(
- onTap: () {
- _gotoLocation(lat,long);
- },
- child: Container(
- child: new FittedBox(
- child: Material(
- color: Colors.white10,
- elevation: 14.0,
- borderRadius: BorderRadius.circular(24.0),
- shadowColor: Color(0x802196F3),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Container(
- width: 180,
- height: 200,
- child: ClipRRect(
- borderRadius: new BorderRadius.circular(24.0),
- child: Image(
- fit: BoxFit.fill,
- image: NetworkImage(_image),
- ),
- ),
- ),
- Container(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: myDetailsContainer1(pagodaName),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- Widget myDetailsContainer1(String pagodaName) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(left: 8.0),
- child: Container(
- child: Text(pagodaName,
- style: TextStyle(
- color: Color(0xff6200ee),
- fontSize: 24.0,
- fontWeight: FontWeight.bold),
- )),
- ),
- SizedBox(height: 5.0),
- Container(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Container(
- child: Text(
- "4.1",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStarHalf,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Text(
- "(946)",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- ],
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black45,
- fontSize: 18.0,
- ),
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Text(
- "Closed \u00B7 Open 17:00 Thu",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- fontWeight: FontWeight.bold),
- ),
- ),
- ],
- );
- }
- Widget _buildGoogleMap(BuildContext context) {
- return Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- child: GoogleMap(
- mapType: MapType.normal,
- initialCameraPosition: CameraPosition(target: LatLng(16.9284, 96.2346), zoom: 12),
- onMapCreated: (GoogleMapController controller) {
- _controller.complete(controller);
- },
- markers: {
- ygn1Marker,ygn2Marker,ygn3Marker,gramercyMarker,bernardinMarker,blueMarker
- },
- ),
- );
- }
- Future<void> _gotoLocation(double lat,double long) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(lat, long), zoom: 15,tilt: 50.0,
- bearing: 45.0,)));
- }
- }
- Marker gramercyMarker = Marker(
- markerId: MarkerId('gramercy'),
- position: LatLng(16.9284, 96.2346),
- infoWindow: InfoWindow(title: 'Gramercy Tavern'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker bernardinMarker = Marker(
- markerId: MarkerId('bernardin'),
- position: LatLng(16.8360031,96.1332521),
- infoWindow: InfoWindow(title: 'MHTi'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker blueMarker = Marker(
- markerId: MarkerId('bluehill'),
- position: LatLng(16.8293115,96.1549398), // s e do na
- infoWindow: InfoWindow(title: 'Sedona Hotel'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,class PointApp extends StatefulWidget {
- @override
- PointAppState createState() => PointAppState();
- }
- class PointAppState extends State<PointApp> {
- Completer<GoogleMapController> _controller = Completer();
- @override
- void initState() {
- super.initState();
- }
- double zoomVal = 5.0;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: IconButton(
- icon: Icon(FontAwesomeIcons.arrowLeft),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => NavigationDrawerDemo()),
- );
- },),
- title: Text("Yangon"),
- actions: <Widget>[
- IconButton(
- icon: Icon(FontAwesomeIcons.search),
- onPressed: () {
- //Need to Route n add Search Page
- }),
- ],
- ),
- body: Stack(
- children: <Widget>[
- _buildGoogleMap(context),
- _zoominusfunction(),
- _zoomplusfunction(),
- _buildContainer(),
- ],
- ),
- );
- }
- Widget _zoominusfunction() {
- return Align(
- alignment: Alignment.topLeft,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchMinus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal--;
- _minus(zoomVal);
- }),
- );
- }
- Widget _zoomplusfunction() {
- return Align(
- alignment: Alignment.topRight,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchPlus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal++;
- _plus(zoomVal);
- }),
- );
- }
- // for _minus Func
- Future<void> _minus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(16.9284, 96.2346), zoom: zoomVal)));
- }
- Future<void> _plus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(17.132582, 96.141762), zoom: zoomVal)));
- }
- // this method create Wid of Slide var
- Widget _buildContainer() {
- return Align(
- alignment: Alignment.bottomLeft,
- child: Container(
- margin: EdgeInsets.symmetric(vertical: 20.0),
- height: 150.0,
- child: ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipPcBXXmL5oczBzicqAhoQkzsX5SfOqVqmPlOlvQ=w225-h160-k-no",
- 16.8360031,96.1332521, "MHTi"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipMKRN-1zTYMUVPrH-CcKzfTo6Nai7wdL7D8PMkt=w340-h160-k-no",
- 16.7984618,96.1490159, "Shwe Dagon Pagoda"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://images.unsplash.com/photo-1504940892017-d23b9053d5d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
- 16.7783961,96.1532603, "BoGyoke Zay"),
- ),
- ],
- ),
- ),
- );
- }
- // box wid get goes h3r3
- Widget _boxes(String _image, double lat,double long,String pagodaName) {
- return GestureDetector(
- onTap: () {
- _gotoLocation(lat,long);
- },
- child: Container(
- child: new FittedBox(
- child: Material(
- color: Colors.white10,
- elevation: 14.0,
- borderRadius: BorderRadius.circular(24.0),
- shadowColor: Color(0x802196F3),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Container(
- width: 180,
- height: 200,
- child: ClipRRect(
- borderRadius: new BorderRadius.circular(24.0),
- child: Image(
- fit: BoxFit.fill,
- image: NetworkImage(_image),
- ),
- ),
- ),
- Container(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: myDetailsContainer1(pagodaName),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- Widget myDetailsContainer1(String pagodaName) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(left: 8.0),
- child: Container(
- child: Text(pagodaName,
- style: TextStyle(
- color: Color(0xff6200ee),
- fontSize: 24.0,
- fontWeight: FontWeight.bold),
- )),
- ),
- SizedBox(height: 5.0),
- Container(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Container(
- child: Text(
- "4.1",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStarHalf,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Text(
- "(946)",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- ],
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black45,
- fontSize: 18.0,
- ),
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Text(
- "Closed \u00B7 Open 17:00 Thu",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- fontWeight: FontWeight.bold),
- ),
- ),
- ],
- );
- }
- Widget _buildGoogleMap(BuildContext context) {
- return Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- child: GoogleMap(
- mapType: MapType.normal,
- initialCameraPosition: CameraPosition(target: LatLng(16.9284, 96.2346), zoom: 12),
- onMapCreated: (GoogleMapController controller) {
- _controller.complete(controller);
- },
- markers: {
- ygn1Marker,ygn2Marker,ygn3Marker,gramercyMarker,bernardinMarker,blueMarker
- },
- ),
- );
- }
- Future<void> _gotoLocation(double lat,double long) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(lat, long), zoom: 15,tilt: 50.0,
- bearing: 45.0,)));
- }
- }
- Marker gramercyMarker = Marker(
- markerId: MarkerId('gramercy'),
- position: LatLng(16.9284, 96.2346),
- infoWindow: InfoWindow(title: 'Gramercy Tavern'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker bernardinMarker = Marker(
- markerId: MarkerId('bernardin'),
- position: LatLng(16.8360031,96.1332521),
- infoWindow: InfoWindow(title: 'MHTi'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker blueMarker = Marker(
- markerId: MarkerId('bluehill'),
- position: LatLng(16.8293115,96.1549398), // s e do na
- infoWindow: InfoWindow(title: 'Sedona Hotel'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn1Marker = Marker(
- markerId: MarkerId('ygn1Marker'),
- position: LatLng(17.132582, 96.141762),
- infoWindow: InfoWindow(title: 'MHT Institute'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn2Marker = Marker(
- markerId: MarkerId('ygn2Marker'),class PointApp extends StatefulWidget {
- @override
- PointAppState createState() => PointAppState();
- }
- class PointAppState extends State<PointApp> {
- Completer<GoogleMapController> _controller = Completer();
- @override
- void initState() {
- super.initState();
- }
- double zoomVal = 5.0;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: IconButton(
- icon: Icon(FontAwesomeIcons.arrowLeft),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => NavigationDrawerDemo()),
- );
- },),
- title: Text("Yangon"),
- actions: <Widget>[
- IconButton(
- icon: Icon(FontAwesomeIcons.search),
- onPressed: () {
- //Need to Route n add Search Page
- }),
- ],
- ),
- body: Stack(
- children: <Widget>[
- _buildGoogleMap(context),
- _zoominusfunction(),
- _zoomplusfunction(),
- _buildContainer(),
- ],
- ),
- );
- }
- Widget _zoominusfunction() {
- return Align(
- alignment: Alignment.topLeft,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchMinus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal--;
- _minus(zoomVal);
- }),
- );
- }
- Widget _zoomplusfunction() {
- return Align(
- alignment: Alignment.topRight,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchPlus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal++;
- _plus(zoomVal);
- }),
- );
- }
- // for _minus Func
- Future<void> _minus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(16.9284, 96.2346), zoom: zoomVal)));
- }
- Future<void> _plus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(17.132582, 96.141762), zoom: zoomVal)));
- }
- // this method create Wid of Slide var
- Widget _buildContainer() {
- return Align(
- alignment: Alignment.bottomLeft,
- child: Container(
- margin: EdgeInsets.symmetric(vertical: 20.0),
- height: 150.0,
- child: ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipPcBXXmL5oczBzicqAhoQkzsX5SfOqVqmPlOlvQ=w225-h160-k-no",
- 16.8360031,96.1332521, "MHTi"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipMKRN-1zTYMUVPrH-CcKzfTo6Nai7wdL7D8PMkt=w340-h160-k-no",
- 16.7984618,96.1490159, "Shwe Dagon Pagoda"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://images.unsplash.com/photo-1504940892017-d23b9053d5d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
- 16.7783961,96.1532603, "BoGyoke Zay"),
- ),
- ],
- ),
- ),
- );
- }
- // box wid get goes h3r3
- Widget _boxes(String _image, double lat,double long,String pagodaName) {
- return GestureDetector(
- onTap: () {
- _gotoLocation(lat,long);
- },
- child: Container(
- child: new FittedBox(
- child: Material(
- color: Colors.white10,
- elevation: 14.0,
- borderRadius: BorderRadius.circular(24.0),
- shadowColor: Color(0x802196F3),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Container(
- width: 180,
- height: 200,
- child: ClipRRect(
- borderRadius: new BorderRadius.circular(24.0),
- child: Image(
- fit: BoxFit.fill,
- image: NetworkImage(_image),
- ),
- ),
- ),
- Container(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: myDetailsContainer1(pagodaName),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- Widget myDetailsContainer1(String pagodaName) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(left: 8.0),
- child: Container(
- child: Text(pagodaName,
- style: TextStyle(
- color: Color(0xff6200ee),
- fontSize: 24.0,
- fontWeight: FontWeight.bold),
- )),
- ),
- SizedBox(height: 5.0),
- Container(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Container(
- child: Text(
- "4.1",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStarHalf,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Text(
- "(946)",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- ],
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black45,
- fontSize: 18.0,
- ),
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Text(
- "Closed \u00B7 Open 17:00 Thu",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- fontWeight: FontWeight.bold),
- ),
- ),
- ],
- );
- }
- Widget _buildGoogleMap(BuildContext context) {
- return Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- child: GoogleMap(
- mapType: MapType.normal,
- initialCameraPosition: CameraPosition(target: LatLng(16.9284, 96.2346), zoom: 12),
- onMapCreated: (GoogleMapController controller) {
- _controller.complete(controller);
- },
- markers: {
- ygn1Marker,ygn2Marker,ygn3Marker,gramercyMarker,bernardinMarker,blueMarker
- },
- ),
- );
- }
- Future<void> _gotoLocation(double lat,double long) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(lat, long), zoom: 15,tilt: 50.0,
- bearing: 45.0,)));
- }
- }
- Marker gramercyMarker = Marker(
- markerId: MarkerId('gramercy'),
- position: LatLng(16.9284, 96.2346),
- infoWindow: InfoWindow(title: 'Gramercy Tavern'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker bernardinMarker = Marker(
- markerId: MarkerId('bernardin'),
- position: LatLng(16.8360031,96.1332521),
- infoWindow: InfoWindow(title: 'MHTi'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker blueMarker = Marker(
- markerId: MarkerId('bluehill'),
- position: LatLng(16.8293115,96.1549398), // s e do na
- infoWindow: InfoWindow(title: 'Sedona Hotel'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn1Marker = Marker(
- markerId: MarkerId('ygn1Marker'),
- position: LatLng(17.132582, 96.141762),
- infoWindow: InfoWindow(title: 'MHT Institute'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn2Marker = Marker(
- markerId: MarkerId('ygn2Marker'),
- position: LatLng(16.8293115,96.1549398),
- infoWindow: InfoWindow(title: 'Sedona 2'),class PointApp extends StatefulWidget {
- @override
- PointAppState createState() => PointAppState();
- }
- class PointAppState extends State<PointApp> {
- Completer<GoogleMapController> _controller = Completer();
- @override
- void initState() {
- super.initState();
- }
- double zoomVal = 5.0;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: IconButton(
- icon: Icon(FontAwesomeIcons.arrowLeft),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => NavigationDrawerDemo()),
- );
- },),
- title: Text("Yangon"),
- actions: <Widget>[
- IconButton(
- icon: Icon(FontAwesomeIcons.search),
- onPressed: () {
- //Need to Route n add Search Page
- }),
- ],
- ),
- body: Stack(
- children: <Widget>[
- _buildGoogleMap(context),
- _zoominusfunction(),
- _zoomplusfunction(),
- _buildContainer(),
- ],
- ),
- );
- }
- Widget _zoominusfunction() {
- return Align(
- alignment: Alignment.topLeft,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchMinus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal--;
- _minus(zoomVal);
- }),
- );
- }
- Widget _zoomplusfunction() {
- return Align(
- alignment: Alignment.topRight,
- child: IconButton(
- icon: Icon(FontAwesomeIcons.searchPlus,color:Color(0xff6200ee)),
- onPressed: () {
- zoomVal++;
- _plus(zoomVal);
- }),
- );
- }
- // for _minus Func
- Future<void> _minus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(16.9284, 96.2346), zoom: zoomVal)));
- }
- Future<void> _plus(double zoomVal) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(17.132582, 96.141762), zoom: zoomVal)));
- }
- // this method create Wid of Slide var
- Widget _buildContainer() {
- return Align(
- alignment: Alignment.bottomLeft,
- child: Container(
- margin: EdgeInsets.symmetric(vertical: 20.0),
- height: 150.0,
- child: ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipPcBXXmL5oczBzicqAhoQkzsX5SfOqVqmPlOlvQ=w225-h160-k-no",
- 16.8360031,96.1332521, "MHTi"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://lh5.googleusercontent.com/p/AF1QipMKRN-1zTYMUVPrH-CcKzfTo6Nai7wdL7D8PMkt=w340-h160-k-no",
- 16.7984618,96.1490159, "Shwe Dagon Pagoda"),
- ),
- SizedBox(width: 10.0),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: _boxes(
- "https://images.unsplash.com/photo-1504940892017-d23b9053d5d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
- 16.7783961,96.1532603, "BoGyoke Zay"),
- ),
- ],
- ),
- ),
- );
- }
- // box wid get goes h3r3
- Widget _boxes(String _image, double lat,double long,String pagodaName) {
- return GestureDetector(
- onTap: () {
- _gotoLocation(lat,long);
- },
- child: Container(
- child: new FittedBox(
- child: Material(
- color: Colors.white10,
- elevation: 14.0,
- borderRadius: BorderRadius.circular(24.0),
- shadowColor: Color(0x802196F3),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Container(
- width: 180,
- height: 200,
- child: ClipRRect(
- borderRadius: new BorderRadius.circular(24.0),
- child: Image(
- fit: BoxFit.fill,
- image: NetworkImage(_image),
- ),
- ),
- ),
- Container(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: myDetailsContainer1(pagodaName),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- Widget myDetailsContainer1(String pagodaName) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.only(left: 8.0),
- child: Container(
- child: Text(pagodaName,
- style: TextStyle(
- color: Color(0xff6200ee),
- fontSize: 24.0,
- fontWeight: FontWeight.bold),
- )),
- ),
- SizedBox(height: 5.0),
- Container(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- Container(
- child: Text(
- "4.1",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStar,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Icon(
- FontAwesomeIcons.solidStarHalf,
- color: Colors.amber,
- size: 15.0,
- ),
- ),
- Container(
- child: Text(
- "(946)",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- ],
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black45,
- fontSize: 18.0,
- ),
- )),
- SizedBox(height: 5.0),
- Container(
- child: Text(
- "American \u00B7 \u0024\u0024 \u00B7 1.6 mi",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- ),
- )),
- Container(
- child: Text(
- "Closed \u00B7 Open 17:00 Thu",
- style: TextStyle(
- color: Colors.black54,
- fontSize: 18.0,
- fontWeight: FontWeight.bold),
- ),
- ),
- ],
- );
- }
- Widget _buildGoogleMap(BuildContext context) {
- return Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- child: GoogleMap(
- mapType: MapType.normal,
- initialCameraPosition: CameraPosition(target: LatLng(16.9284, 96.2346), zoom: 12),
- onMapCreated: (GoogleMapController controller) {
- _controller.complete(controller);
- },
- markers: {
- ygn1Marker,ygn2Marker,ygn3Marker,gramercyMarker,bernardinMarker,blueMarker
- },
- ),
- );
- }
- Future<void> _gotoLocation(double lat,double long) async {
- final GoogleMapController controller = await _controller.future;
- controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(target: LatLng(lat, long), zoom: 15,tilt: 50.0,
- bearing: 45.0,)));
- }
- }
- Marker gramercyMarker = Marker(
- markerId: MarkerId('gramercy'),
- position: LatLng(16.9284, 96.2346),
- infoWindow: InfoWindow(title: 'Gramercy Tavern'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker bernardinMarker = Marker(
- markerId: MarkerId('bernardin'),
- position: LatLng(16.8360031,96.1332521),
- infoWindow: InfoWindow(title: 'MHTi'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker blueMarker = Marker(
- markerId: MarkerId('bluehill'),
- position: LatLng(16.8293115,96.1549398), // s e do na
- infoWindow: InfoWindow(title: 'Sedona Hotel'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn1Marker = Marker(
- markerId: MarkerId('ygn1Marker'),
- position: LatLng(17.132582, 96.141762),
- infoWindow: InfoWindow(title: 'MHT Institute'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn2Marker = Marker(
- markerId: MarkerId('ygn2Marker'),
- position: LatLng(16.8293115,96.1549398),
- infoWindow: InfoWindow(title: 'Sedona 2'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn3Marker = Marker(
- markerId: MarkerId('ygn3Marker'),
- position: LatLng(16.8092588,96.1593468),
- infoWindow: InfoWindow(title: 'Tarmwe Township'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn3Marker = Marker(
- markerId: MarkerId('ygn3Marker'),
- position: LatLng(16.8092588,96.1593468),
- infoWindow: InfoWindow(title: 'Tarmwe Township'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- position: LatLng(16.8293115,96.1549398),
- infoWindow: InfoWindow(title: 'Sedona 2'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn3Marker = Marker(
- markerId: MarkerId('ygn3Marker'),
- position: LatLng(16.8092588,96.1593468),
- infoWindow: InfoWindow(title: 'Tarmwe Township'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- ),
- );
- Marker ygn1Marker = Marker(
- markerId: MarkerId('ygn1Marker'),
- position: LatLng(17.132582, 96.141762),
- infoWindow: InfoWindow(title: 'MHT Institute'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn2Marker = Marker(
- markerId: MarkerId('ygn2Marker'),
- position: LatLng(16.8293115,96.1549398),
- infoWindow: InfoWindow(title: 'Sedona 2'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
- Marker ygn3Marker = Marker(
- markerId: MarkerId('ygn3Marker'),
- position: LatLng(16.8092588,96.1593468),
- infoWindow: InfoWindow(title: 'Tarmwe Township'),
- icon: BitmapDescriptor.defaultMarkerWithHue(
- BitmapDescriptor.hueViolet,
- ),
- );
Add Comment
Please, Sign In to add comment