zoukankan      html  css  js  c++  java
  • Flutter-取消默認,自定義的appbar(PreferredSize)

    可以不使用默認的appbar,自定義佈局

    /*appBar: PreferredSize(
            child: Container(
              decoration: BoxDecoration(
                  color: Color(0Xffd3dda5),
                  borderRadius: BorderRadius.only(
                      bottomLeft: Radius.circular(20),
                      bottomRight: Radius.circular(20))),
              child: Container(
                  margin: EdgeInsets.only(bottom: 5),
                   double.infinity,
                  height: width * 0.4,
                  decoration: BoxDecoration(
                      image: DecorationImage(
                        image: AssetImage("images/ielts_top.png"),
                      ),
                      color: Color(0Xff9eba31),
                      borderRadius: BorderRadius.only(
                          bottomLeft: Radius.circular(20),
                          bottomRight: Radius.circular(20))),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Row(
                        children: <Widget>[
                          ImageIcon(AssetImage('images/personal_center.png'))
                        ],
                      ),
                      Container(
                        padding: EdgeInsets.only(left: 30),
                        child: Row(
                          children: <Widget>[
                            Container(
                              height: 45,
                               width*0.7,
                              decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius:BorderRadius.circular(30),//邊框
                              ),
                              child: Row(
                                mainAxisAlignment: MainAxisAlignment.spaceAround,
                                children: <Widget>[
                                  //Text('搜索補習年級詳情',style: TextStyle(color: Color(0Xffc7c7c8),fontSize: 18),),
                                  Container(
                                    width*0.5,
                                    height: 100,
                                    child: TextFormField(
                                      focusNode: _focusNode,
                                      maxLines: 1,
                                      onSaved: (value) { },
                                      //controller: phoneController,
                                      textAlign: TextAlign.left,
                                      //inputFormatters: [WhitelistingTextInputFormatter.digitsOnly,LengthLimitingTextInputFormatter(6)],
                                      decoration: InputDecoration(
                                        hintText: ('搜尋補習年級詳情'),
                                        contentPadding: EdgeInsets.only(top: -5,bottom: 0),
                                        hintStyle: TextStyle(
                                          color: Color(0Xffc7c7c8),
                                          fontSize: 20,
                                        ),
                                        alignLabelWithHint: true,
                                        border: OutlineInputBorder(borderSide: BorderSide.none),
                                      ),
                                    ),
                                  ),
                                  Icon(Icons.search, color: Color(0Xff4d80c5),)
                                ],
                              ),
                            )
                          ],
                        ),
                      )
                    ],
                  )
              ),
            ),
            preferredSize: Size(double.infinity, width * 0.35),
          ),*/
  • 相关阅读:
    反射和内置方法重写
    封装
    接口与抽象类 、多态
    面向对象--继承和组合
    python对象
    模块导入
    python序列化模块
    time random sys os 模块
    python re模块和collections
    python各种推导式
  • 原文地址:https://www.cnblogs.com/ssjf/p/12565220.html
Copyright © 2011-2022 走看看