Advertisement
Guest User

Untitled

a guest
Jul 11th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 5.77 KB | None | 0 0
  1. class _ProfilePageState extends State<ProfilePage> {
  2.   @override
  3.   Widget build(BuildContext context) {
  4.     return Scaffold(
  5.       appBar: AppBar(
  6.         backgroundColor: Colors.transparent,
  7.         elevation: 0.0,
  8.         leading: IconButton(
  9.           icon: Icon(Icons.arrow_back),
  10.           color: Colors.black,
  11.           onPressed: () {
  12.             Navigator.of(context).pop();
  13.           },
  14.         ),
  15.         actions: <Widget>[
  16.           IconButton(
  17.             icon: Icon(Icons.more_vert),
  18.           )
  19.         ],
  20.       ),
  21.       body: ListView(
  22.         children: <Widget>[
  23.           Column(
  24.             mainAxisAlignment: MainAxisAlignment.center,
  25.             children: <Widget>[
  26.               Hero(
  27.                 tag: 'assets/test01.jpg',
  28.                 child: Container(
  29.                   height: 125.0,
  30.                   width: 125.0,
  31.                   decoration: BoxDecoration(
  32.                       borderRadius: BorderRadius.circular(62.5),
  33.                       image: DecorationImage(
  34.                           fit: BoxFit.cover,
  35.                           image: AssetImage('assets/test01.jpg'))),
  36.                 ),
  37.               ),
  38.               SizedBox(height: 25.0),
  39.               Text(
  40.                 'Mark Stewart',
  41.                 style: TextStyle(
  42.                     fontFamily: 'Montserrat',
  43.                     fontSize: 20.0,
  44.                     fontWeight: FontWeight.bold),
  45.               ),
  46.               SizedBox(height: 4.0),
  47.               Text(
  48.                 'San Jose, CA',
  49.                 style: TextStyle(fontFamily: 'Montserrat', color: Colors.grey),
  50.               ),
  51.               Padding(
  52.                 padding: EdgeInsets.all(30.0),
  53.                 child:StarDisplay(),
  54.               ),
  55.               Padding(
  56.                 padding: EdgeInsets.only(left: 15.0),
  57.                 child: Row(
  58.                   crossAxisAlignment: CrossAxisAlignment.center,
  59.                   children: <Widget>[
  60.                     IconButton(icon: Icon(Icons.table_chart)),
  61.                     IconButton(
  62.                       icon: Icon(Icons.menu),
  63.                       onPressed: () {},
  64.                     )
  65.                   ],
  66.                 ),
  67.               ),
  68.               buildImages(),
  69.               buildInfoDetail(),
  70.               buildImages(),
  71.               buildInfoDetail(),
  72.             ],
  73.           )
  74.         ],
  75.       ),
  76.     );
  77.   }
  78.  
  79.   Widget buildImages() {
  80.     return Padding(
  81.       padding: EdgeInsets.only(top: 15.0, left: 15.0, right: 15.0),
  82.       child: Container(
  83.           height: 200.0,
  84.           decoration: BoxDecoration(
  85.               borderRadius: BorderRadius.circular(15.0),
  86.               image: DecorationImage(
  87.                   image: AssetImage('assets/beach1.jpg'), fit: BoxFit.cover))),
  88.     );
  89.   }
  90.  
  91.   Widget buildInfoDetail() {
  92.     return Padding(
  93.       padding:
  94.       EdgeInsets.only(left: 25.0, right: 25.0, top: 10.0, bottom: 15.0),
  95.       child: Row(
  96.         mainAxisAlignment: MainAxisAlignment.spaceBetween,
  97.         children: <Widget>[
  98.           Column(
  99.             crossAxisAlignment: CrossAxisAlignment.start,
  100.             children: <Widget>[
  101.               Text(
  102.                 'Maldives - 12 Days',
  103.                 style: TextStyle(
  104.                     fontWeight: FontWeight.bold,
  105.                     fontFamily: 'Montserrat',
  106.                     fontSize: 15.0),
  107.               ),
  108.               SizedBox(height: 7.0),
  109.               Row(
  110.                 children: <Widget>[
  111.                   Text(
  112.                     'Teresa Soto',
  113.                     style: TextStyle(
  114.                         color: Colors.grey.shade700,
  115.                         fontFamily: 'Montserrat',
  116.                         fontSize: 11.0),
  117.                   ),
  118.                   SizedBox(width: 4.0),
  119.                   Icon(
  120.                     Icons.timer,
  121.                     size: 4.0,
  122.                     color: Colors.black,
  123.                   ),
  124.                   SizedBox(width: 4.0),
  125.                   Text(
  126.                     '3 Videos',
  127.                     style: TextStyle(
  128.                         color: Colors.grey.shade500,
  129.                         fontFamily: 'Montserrat',
  130.                         fontSize: 11.0),
  131.                   )
  132.                 ],
  133.               )
  134.             ],
  135.           ),
  136.           Row(
  137.             crossAxisAlignment: CrossAxisAlignment.center,
  138.             children: <Widget>[
  139.               SizedBox(width: 7.0),
  140.               InkWell(
  141.                 onTap: () {},
  142.                 child: Container(
  143.                   height: 20.0,
  144.                   width: 20.0,
  145.                   child: Image.asset('assets/navarrow.png'),
  146.                 ),
  147.               ),
  148.               SizedBox(width: 7.0),
  149.               InkWell(
  150.                 onTap: () {},
  151.                 child: Container(
  152.                   height: 20.0,
  153.                   width: 20.0,
  154.                   child: Image.asset('assets/chatbubble.png'),
  155.                 ),
  156.               ),
  157.               SizedBox(width: 7.0),
  158.               InkWell(
  159.                 onTap: () {},
  160.                 child: Container(
  161.                   height: 22.0,
  162.                   width: 22.0,
  163.                   child: Image.asset('assets/fav.png'),
  164.                 ),
  165.               )
  166.             ],
  167.           )
  168.         ],
  169.       ),
  170.     );
  171.   }
  172. }
  173.  
  174.  
  175. class StarDisplay extends StatelessWidget {
  176.   final int value;
  177.   const StarDisplay({Key key, this.value = 0})
  178.       : assert(value != null),
  179.         super(key: key);
  180.   @override
  181.   Widget build(BuildContext context) {
  182.     return Row(
  183.       mainAxisSize: MainAxisSize.min,
  184.       children: List.generate(5, (index) {
  185.         return Icon(
  186.           index < value ? Icons.star : Icons.star_border,size: 38,
  187.         );
  188.       }),
  189.     );
  190.   }
  191. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement