Advertisement
mrblab24

place_preview.dart

Dec 19th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.92 KB | None | 0 0
  1. import 'package:admin/utils/cached_image.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_html/flutter_html.dart';
  4.  
  5. showPlacePreview(
  6.     context,
  7.     String name,
  8.     String location,
  9.     String imageUrl_1,
  10.     String description,
  11.     double lat,
  12.     double lng) {
  13.  
  14.   showDialog(
  15.       context: context,
  16.       builder: (BuildContext context) {
  17.         return Dialog(
  18.           child: Container(
  19.             width: MediaQuery.of(context).size.width * 0.50,
  20.             child: ListView(
  21.               children: <Widget>[
  22.                 Stack(
  23.                   children: <Widget>[
  24.                     Container(
  25.                       height: 350,
  26.                       width: MediaQuery.of(context).size.width,
  27.                       child: CustomCacheImage(imageUrl: imageUrl_1, radius: 0.0)
  28.                      
  29.                       // Image(
  30.                       //     fit: BoxFit.cover, image: NetworkImage(imageUrl_1)),
  31.                     ),
  32.                     Positioned(
  33.                       top: 10,
  34.                       right: 20,
  35.                       child: CircleAvatar(
  36.                         child: IconButton(
  37.                             icon: Icon(Icons.close),
  38.                             onPressed: () => Navigator.pop(context)),
  39.                       ),
  40.                     )
  41.                   ],
  42.                 ),
  43.                 SizedBox(
  44.                   height: 20,
  45.                 ),
  46.                 Padding(
  47.                   padding:
  48.                       const EdgeInsets.only(left: 20, right: 20, bottom: 20),
  49.                   child: Column(
  50.                     crossAxisAlignment: CrossAxisAlignment.start,
  51.                     children: <Widget>[
  52.                       Text(
  53.                         name,
  54.                         style: TextStyle(
  55.                             fontSize: 20,
  56.                             fontWeight: FontWeight.w700,
  57.                             color: Colors.black),
  58.                       ),
  59.                       Container(
  60.                         margin: EdgeInsets.only(top: 5, bottom: 10),
  61.                         height: 3,
  62.                         width: 100,
  63.                         decoration: BoxDecoration(
  64.                             color: Colors.indigoAccent,
  65.                             borderRadius: BorderRadius.circular(15)),
  66.                       ),
  67.                       Row(
  68.                         mainAxisAlignment: MainAxisAlignment.start,
  69.                         children: <Widget>[
  70.                           Icon(Icons.location_on, size: 16, color: Colors.grey),
  71.                           Text(
  72.                             location,
  73.                             style: TextStyle(color: Colors.grey, fontSize: 13),
  74.                           ),
  75.                           SizedBox(
  76.                             width: 15,
  77.                           ),
  78.                           RichText(
  79.                               text: TextSpan(
  80.                                   text: 'Latitude: ',
  81.                                   style: TextStyle(color: Colors.grey),
  82.                                   children: <TextSpan>[
  83.                                 TextSpan(
  84.                                     text: lat.toString(),
  85.                                     style: TextStyle(
  86.                                         fontWeight: FontWeight.w700,
  87.                                         color: Colors.grey[700])),
  88.                               ])),
  89.                           SizedBox(
  90.                             width: 5,
  91.                           ),
  92.                           RichText(
  93.                               text: TextSpan(
  94.                                   text: 'Longitude: ',
  95.                                   style: TextStyle(color: Colors.grey),
  96.                                   children: <TextSpan>[
  97.                                 TextSpan(
  98.                                     text: lng.toString(),
  99.                                     style: TextStyle(
  100.                                         fontWeight: FontWeight.w700,
  101.                                         color: Colors.grey[700])),
  102.                               ])),
  103.                         ],
  104.                       ),
  105.                       SizedBox(
  106.                         height: 30,
  107.                       ),
  108.                       Html(
  109.                           defaultTextStyle: TextStyle(
  110.                               fontSize: 16,
  111.                               fontWeight: FontWeight.w600,
  112.                               color: Colors.grey[600]),
  113.                           data: '''$description'''),
  114.                       SizedBox(
  115.                         height: 20,
  116.                       ),
  117.                      
  118.                     ],
  119.                   ),
  120.                 ),
  121.                 SizedBox(
  122.                   height: 20,
  123.                 ),
  124.               ],
  125.             ),
  126.           ),
  127.         );
  128.       });
  129. }
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement