Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 11.25 KB | None | 0 0
  1.               body: Column(
  2.                 children: <Widget>[
  3.                   _buildCarousel(context, 0, mnemonics.length, mnemonics),
  4.  
  5.                   new Expanded(
  6.                       child: new Container(
  7.                         color: Colors.white,
  8.                           child: new Center(
  9.                                   child: y==0 ? getToken != null
  10.                                       ? new Container(
  11.                                           child: Column(
  12.                                           children: <Widget>[
  13.                                             new Flexible(
  14.                                                 child: ListView.builder(
  15.                                               itemCount: getToken.tokens != null
  16.                                                   ? getToken.tokens.length
  17.                                                   : 1,
  18.                                               itemBuilder:
  19.                                                   (BuildContext context,
  20.                                                       int itemIndex) {
  21.                                                 if (itemIndex == 0) {
  22.                                                   return new Card(
  23.                                                       elevation: 15,
  24.                                                       margin:
  25.                                                           EdgeInsets.all(10),
  26.                                                       child: Stack(children: <
  27.                                                           Widget>[
  28.                                                         Container(
  29.                                                           decoration: new BoxDecoration(
  30.                                                               border: new Border(
  31.                                                                   left: BorderSide(
  32.                                                                       color: Colors
  33.                                                                           .green,
  34.                                                                       width:
  35.                                                                           3.5,
  36.                                                                       style: BorderStyle
  37.                                                                           .solid))),
  38.                                                           child: Column(
  39.                                                             mainAxisAlignment:
  40.                                                                 MainAxisAlignment
  41.                                                                     .start,
  42.                                                             crossAxisAlignment:
  43.                                                                 CrossAxisAlignment
  44.                                                                     .start,
  45.                                                             children: <Widget>[
  46.                                                               SizedBox(
  47.                                                                   height: 20),
  48.                                                               Row(children: <
  49.                                                                   Widget>[
  50.                                                                 SizedBox(
  51.                                                                   width: 10,
  52.                                                                 ),
  53.                                                                 Image.asset(
  54.                                                                     "assets/icons/ethereum.png",
  55.                                                                     fit: BoxFit
  56.                                                                         .fill,
  57.                                                                     alignment:
  58.                                                                         Alignment
  59.                                                                             .centerLeft,
  60.                                                                     height: 63,
  61.                                                                     width: 40),
  62.                                                                 SizedBox(
  63.                                                                   width: 10,
  64.                                                                 ),
  65.                                                                 Column(
  66.                                                                     mainAxisAlignment:
  67.                                                                         MainAxisAlignment
  68.                                                                             .start,
  69.                                                                     crossAxisAlignment:
  70.                                                                         CrossAxisAlignment
  71.                                                                             .start,
  72.                                                                     children: <
  73.                                                                         Widget>[
  74.                                                                       Text(
  75.                                                                           "Ethereum (ETH)",
  76.                                                                           style:
  77.                                                                               new TextStyle(fontSize: 20)),
  78.                                                                       Text(
  79.                                                                           "${(getToken.eTH.balance).toStringAsFixed(5)} ETH",
  80.                                                                           style:
  81.                                                                               TextStyle(fontWeight: FontWeight.bold))
  82.                                                                     ])
  83.                                                               ]),
  84.                                                               SizedBox(
  85.                                                                   height: 20),
  86.                                                             ],
  87.                                                           ),
  88.                                                         )
  89.                                                       ]));
  90.                                                 } else {
  91.                                                   return new Card(
  92.                                                       elevation: 8,
  93.                                                       margin:
  94.                                                           EdgeInsets.all(10),
  95.                                                       child: Stack(children: <
  96.                                                           Widget>[
  97.                                                         Container(
  98.                                                           decoration: new BoxDecoration(
  99.                                                               border: new Border(
  100.                                                                   left: BorderSide(
  101.                                                                       color: Colors
  102.                                                                           .red,
  103.                                                                       width:
  104.                                                                           3.5,
  105.                                                                       style: BorderStyle
  106.                                                                           .solid))),
  107.                                                           child: Column(
  108.                                                             mainAxisAlignment:
  109.                                                                 MainAxisAlignment
  110.                                                                     .start,
  111.                                                             crossAxisAlignment:
  112.                                                                 CrossAxisAlignment
  113.                                                                     .start,
  114.                                                             children: <Widget>[
  115.                                                               SizedBox(
  116.                                                                   height: 20),
  117.                                                               Row(children: <
  118.                                                                   Widget>[
  119.                                                                 SizedBox(
  120.                                                                   width: 10,
  121.                                                                 ),
  122.                                                                 Text(
  123.                                                                     "${getToken.tokens[itemIndex - 1].tokenInfo.name} (${getToken.tokens[itemIndex - 1].tokenInfo.symbol})",
  124.                                                                     style: new TextStyle(
  125.                                                                         fontSize:
  126.                                                                             20))
  127.                                                               ]),
  128.                                                               Row(children: <
  129.                                                                   Widget>[
  130.                                                                 SizedBox(
  131.                                                                     width: 10),
  132.                                                                 Text(
  133.                                                                     "${(getToken.tokens[itemIndex - 1].balance / math.pow(10, getToken.tokens[itemIndex - 1].tokenInfo.decimals)).toStringAsFixed(5)} ${getToken.tokens[itemIndex - 1].tokenInfo.symbol}",
  134.                                                                     style: TextStyle(
  135.                                                                         fontWeight:
  136.                                                                             FontWeight.bold))
  137.                                                               ]),
  138.                                                               SizedBox(
  139.                                                                   height: 20),
  140.                                                             ],
  141.                                                           ),
  142.                                                         )
  143.                                                       ]));
  144.                                                 }
  145.                                               },
  146.                                             ))
  147.                                           ],
  148.                                         ))
  149.                                       :new Text(
  150.                                   "Error: Something went wrong (EC2876)") :new CircularProgressIndicator() )
  151.                               ))
  152.                 ],
  153.               ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement