Advertisement
Guest User

Untitled

a guest
Apr 7th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.18 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(new MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6.   // This widget is the root of your application.
  7.   @override
  8.   Widget build(BuildContext context) {
  9.     return new MaterialApp(
  10.       title: 'Flutter Demo',
  11.       theme: new ThemeData(
  12.         primarySwatch: Colors.blue,
  13.       ),
  14.       home: new ListView(
  15.         children: <Widget>[
  16.           new CustomCard(),
  17.           new CustomCard(),
  18.           new CustomCard(),
  19.           new CustomCard(),
  20.           new CustomCard(),
  21.           new CustomCard()
  22.         ],
  23.       ),
  24.     );
  25.   }
  26. }
  27.  
  28. class CustomCard extends StatelessWidget {
  29.   CustomCard();
  30.  
  31.   factory CustomCard.forDesignTime() => new CustomCard();
  32.  
  33.   @override
  34.   Widget build(BuildContext context) {
  35.     return new Container(
  36.       height: 200.0,
  37.       width: double.infinity,
  38.       child: new Card(
  39.         child: new InkWell(
  40.           child: new Padding(
  41.             padding: const EdgeInsets.all(8.0),
  42.             child: new Row(
  43.               crossAxisAlignment: CrossAxisAlignment.start,
  44.               children: <Widget>[
  45.                 new Container(
  46.                   decoration: new BoxDecoration(
  47.                       color: Colors.blue,
  48.                       borderRadius:
  49.                           new BorderRadius.all(new Radius.circular(12.0))),
  50.                   child: new FadeInImage.assetNetwork(
  51.                     alignment: Alignment.center,
  52.                     fit: BoxFit.fitHeight,
  53.                     height: 1 * 44.8,
  54.                     width: 1 * 31.3,
  55.                     placeholder: "graphics/placeholder.png",
  56.                     image:
  57.                         'https://lh3.googleusercontent.com/oV45LX4lVsUj92o_zRKcDzQrBxqzYlNwOWeT5o5RaOBlTR-wqd87Ss7v13OQpwuTjktpLsiblsQJhA=w1080-h1081-rw-no',
  58.                   ),
  59.                 ),
  60.                 new Expanded(
  61.                   child: new Container(
  62.                     padding: const EdgeInsets.only(left: 8.0),
  63.                     child: new Column(
  64.                       children: <Widget>[
  65.                         new Text(
  66.                           'toto',
  67.                           style: new TextStyle(fontSize: 30.0),
  68.                           textAlign: TextAlign.center,
  69.                           //overflow: TextOverflow.fade,
  70.                           //softWrap: false,
  71.                         ),
  72.                         new Divider(),
  73.                         new Expanded(
  74.                           child: new Row(
  75.                             mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  76.                             children: <Widget>[
  77.                               new Expanded(
  78.                                 child: new Container(
  79.                                   child: new Row(
  80.                                     children: <Widget>[],
  81.                                   ),
  82.                                 ),
  83.                               ),
  84.                               new Padding(
  85.                                 padding: const EdgeInsets.only(right: 8.0),
  86.                                 child: new Column(
  87.                                   children: <Widget>[
  88.                                     new Text('runtime'),
  89.                                     new Text('language'),
  90.                                   ],
  91.                                 ),
  92.                               ),
  93.                             ],
  94.                           ),
  95.                         ),
  96.                         new Divider(),
  97.                         new Row(
  98.                           mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  99.                           children: _airTimeBuilder(['12', '13']),
  100.                         ),
  101.                       ],
  102.                     ),
  103.                   ),
  104.                 ),
  105.               ],
  106.             ),
  107.           ),
  108.           onTap: () {
  109.             print('what');
  110.           },
  111.         ),
  112.       ),
  113.     );
  114.   }
  115. }
  116.  
  117. List<Widget> _airTimeBuilder(List<String> airtimes) {
  118.   List<Widget> temporary = [];
  119.   for (int i = 0; i < airtimes.length; i++) {
  120.     temporary.add(new Chip(
  121.       label: new Text(airtimes[i]),
  122.     ));
  123.   }
  124.   return temporary;
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement