zoukankan      html  css  js  c++  java
  • 浅尝flutter中的http请求

    import 'package:flutter/material.dart';
    
    class News extends StatefulWidget {
      final String title,imglink; 
      News(this.title,this.imglink);
      @override
      createState() => new NewsState();  
    }
    class NewsState extends State<News> {
      @override
      Widget  build(BuildContext context){   
        return new Center(
         child:new Container(
           height: 120.0,
           padding:new EdgeInsets.only(left:20.0,right:20.0),
           decoration: new BoxDecoration(
             border:new Border(
               bottom: new BorderSide( 1.0,color:const Color(0xff999999))
             )
           ),
           child: new Row(
             mainAxisAlignment: MainAxisAlignment.spaceEvenly,
             children: <Widget>[
               new Expanded(
                 flex:2,
                 child: new Column(
                   crossAxisAlignment: CrossAxisAlignment.start,
                   mainAxisAlignment:MainAxisAlignment.spaceBetween ,
                   children: <Widget>[
                     new Container(
                       padding:new EdgeInsets.only(top:15.0),
                       decoration: new BoxDecoration(
                       ),
                       child:new Text(
                         widget.title,
                         style: new TextStyle(
                           fontSize: 18.0
                         ),
                       ),
                     ),
                      new Container(
                       padding:const EdgeInsets.only(right:13.0,bottom:15.0),
                       decoration: new BoxDecoration(
                       ),
                       child:new Row(
                         mainAxisAlignment: MainAxisAlignment.spaceBetween,
                         children: <Widget>[
                           new Text(
                             '本地新闻',
                           ),
                            new Text(
                             '2018-03-11',
                           ),
                         ],
                       )
                     
                     ),
                   ],
                 ),
               ),
               new Expanded(
                 flex:1,
                 child: new Image.network(
                   widget.imglink,
                   scale: 1.0,
                   fit: BoxFit.cover,
                 ),
               ),
             ],
           ),
         ),
        );
      }
    }
    

      

  • 相关阅读:
    学习使用&运算符
    企业发放的奖金根据利润提成。
    取一个整数a从右端开始的47位。
    jQuery Select操作大集合
    js 获取某年某月的最后一天
    sql 语句区分大小写查询
    js 冒泡排序
    一个初学者的程序自学计划
    JWNL体验
    (转)GIS相关的SCI、EI期刊
  • 原文地址:https://www.cnblogs.com/xiongwei/p/10431813.html
Copyright © 2011-2022 走看看