zoukankan      html  css  js  c++  java
  • Flutter_03_画一个按钮和一根线

    import 'package:flutter/material.dart';
    
    /// 一个按钮和一根线
    class ButtonAndLine extends StatelessWidget {
      const ButtonAndLine({Key? key}) : super(key: key);
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text('一个按钮和一根线'),
          ),
          body: Container(
            padding: EdgeInsets.only(top: 10),
            child: Column(
              children: [
                /// FractionallySizedBox 百分比布局
                // 1、尺寸限制盒子
                FractionallySizedBox(
                  widthFactor: 0.9,
                  // 2、装饰盒子
                  child: DecoratedBox(
                    decoration: BoxDecoration(
                      // 渐变
                      gradient: LinearGradient(
                        colors: [Colors.lightBlueAccent, Colors.blue],
                      ),
                      // 圆角
                      borderRadius: BorderRadius.circular(6.0),
                      // 阴影
                      boxShadow: [
                        BoxShadow(
                            color: Colors.black54,
                            offset: Offset(2.0, 2.0),
                            blurRadius: 4.0)
                      ],
                    ),
                    // 3、材料设计的Button
                    child: MaterialButton(
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(6)),
                      height: 45,
                      onPressed: () => print("click btn"),
                      disabledColor: Colors.grey,
                      highlightColor: Colors.transparent,
                      splashColor: Colors.transparent,
                      // color: Colors.deepOrange,
                      child: Text(
                        "登录",
                        style: TextStyle(color: Colors.white, fontSize: 16),
                      ),
                    ),
                  ),
                ),
                SizedBox(height: 10),
    
                /// 绘制线条
                Divider(
                  // height: 30,
                  color: Colors.lightBlueAccent,
                  indent: 10,
                  endIndent: 10,
                  // 线的厚度
                  thickness: 2,
                ),
              ],
            ),
          ),
        );
      }
    }
    
  • 相关阅读:
    词法分析程序
    0909关于编译原理
    深度学习中图像检测的评价标准
    【 记忆网络 1 】 Memory Network
    ssm又乱码
    百度地图标注没了
    Fragment与Activity交互(使用Handler)
    在android里用ExpandableListView实现二层和三层列表
    java中outer的使用
    android中使用Http下载文件并保存到本地SD卡
  • 原文地址:https://www.cnblogs.com/carp-li/p/15106736.html
Copyright © 2011-2022 走看看