zoukankan      html  css  js  c++  java
  • flutter 封装的组件

    search组件

    Widget serachBar(){

        return Container(

          ScreenUtil().setWidth(750),

          height: MediaQuery.of(context).padding.top + ScreenUtil().setHeight(80),

          decoration: BoxDecoration(

            color: Colors.blue,

          ),

          child: Container(

            // padding: EdgeInsets.only(bottom:5),

            child: Column(

              children: <Widget>[

                SizedBox(height:MediaQuery.of(context).padding.top + 5),

                Row(

                  mainAxisAlignment: MainAxisAlignment.spaceAround,

                  crossAxisAlignment: CrossAxisAlignment.center,

                  children: <Widget>[

                    ClipRRect(

                      borderRadius: BorderRadius.circular(20), 

                        child: Container(

                          ScreenUtil().setWidth(750) * 0.85,

                          height: ScreenUtil().setHeight(60),

                          color: Colors.white,

                          child:Padding(

                            padding: EdgeInsets.only(left:10,right: 10),

                              child: Row(

                                crossAxisAlignment: CrossAxisAlignment.center,

                                children: <Widget>[

                                  Icon(Icons.search,color: Colors.grey,size: 26,),

                                  Container(

                                        // color: Colors.green,

                                      120.0,

                                      height: 30.0,

                                      child: TextField(

                                        style: TextStyle(

                                          decorationColor: Colors.red,

                                          color: Colors.black12,

                                          fontSize: ScreenUtil().setSp(30),

                                          // textBaseline: TextBaseline.alphabetic

                                        ),

                                        keyboardType: TextInputType.number,

                                        decoration: InputDecoration(

                                          fillColor: Colors.white30,

                                          border: InputBorder.none,  //去掉下划线

                                          prefixStyle: TextStyle(color: Colors.grey),

                                          contentPadding: EdgeInsets.all(8),

                                          hintText: '请输入商品名称',

                                          hintStyle: TextStyle(color: Colors.grey,fontSize: ScreenUtil().setSp(30))

                                        ), autofocus: false, ),

                                      ) ,

                                ],

                              ),

                            )

                      ) ,

                    ),

                    InkWell(

                      onTap: () { },

                      child: Icon(CupertinoIcons.photo_camera,color: Colors.white,size: ScreenUtil().setSp(70))

                  )

                    //IconButton(alignment: Alignment.topCenter,icon: Icon(CupertinoIcons.photo_camera,color: Colors.white,size: ScreenUtil().setSp(70)), onPressed: (){}),

                    // Container(

                    //   height: ScreenUtil().setSp(80),

                    //   ScreenUtil().setSp(750) * 0.1,

                    //   // color: Colors.grey,

                    //   // padding: EdgeInsets.only(bottom: 10),

                    //   child: IconButton(alignment: Alignment.topCenter,icon: Icon(CupertinoIcons.photo_camera,color: Colors.white,size: ScreenUtil().setSp(70)), onPressed: (){}),

                    // )

                  ],

                ),

              ],

            ),

            

          ),

          

        );

      }

  • 相关阅读:
    Windows 10 Universal App 开发记录
    Windows Phone 8.1 开发会用到的方法
    Android Activity设置全屏
    Android视频录制命令screenrecord
    Android ScrollView中嵌套ListView只显示一行的解决办法
    Android 4.4.4: java.lang.SecurityException: Package com.android.settings does not belong to 1001
    自定义Android spinner样式并添加监听事件
    GSON快速实现内部类
    android的Banner轮播图框架
    Okhttp与Okhttputils的用法及区别
  • 原文地址:https://www.cnblogs.com/sundaysme/p/12581948.html
Copyright © 2011-2022 走看看