• flutter ui


    快速生成无状态模板

    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Container(
          
        );
      }
    }

    快速生成有状态模板

    void main() => runApp(MyApp());
    
    class MyApp extends StatefulWidget {
      @override
      _MyAppState createState() => _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
      @override
      Widget build(BuildContext context) {
        return Container(
          
        );
      }
    }

    1.MaterialApp

    脚手架模板

     有状态

    import 'package:flutter/material.dart';
    
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatefulWidget {
      @override
      _MyAppState createState() => _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(
              title: Text("测试"),
            ),
            body:Center(child: Text('data'),)
          ),
        );
      }
    }

    2.Scaffold

     脚手架

    3.AppBar

    标题行

    return Scaffold(
          appBar: AppBar(
            leading: IconButton(icon: Icon(Icons.arrow_back), onPressed: () {}),
            title: Text('AppBar'),
            actions: <Widget>[
              IconButton(icon: Icon(Icons.add), onPressed: () {}),
              IconButton(icon: Icon(Icons.add), onPressed: () {}),
            flexibleSpace: Container(
              color: Colors.red,
            ),
            bottom: PreferredSize(
              child: Container(
                height: 50,
                 double.infinity,
                color: Colors.grey,
                child: Text('bottom'),
              ),
              preferredSize: Size(30, 100),
            ),
          ),
        ); 

    4.文本框

    new Text('文本框');

    属性

     

     

    监听一

     onChanged:每次改变接受文本的值

    onSubmitted:每次按输入法的确定键接收一个值

    监听二

    输入框

    new TextField(
          //
        );

     8.TabBar

    unselectedLabelColor: 设置未被选中的标签颜色

    indicatorColor:选中标签的下划线颜色

    indicatorSize:选中下划线的长度

    .主题

    splashColor:水波纹颜色

    .装饰盒子

    decoration:BoxDecoration(

    )

    border:设置边框

    borderRadius:圆角设置

    borderShdow:阴影

    ..shape:形状

    ..gradient:渐变

    image:

    sizeBox

    固定尺寸盒子

    alignment

    对齐

     

    0.0表示居中

    stack 

    叠加

    AspectRatio 设置宽高比

    pageView 翻页

     ExpansionPanel 收缩面板

    chip  

     ActionChip

    FilterChip

    ChoiceChip

     DataTable

     stepper

    RefreshIndicator 下拉




    TabBarView

     主题颜色

  • 相关阅读:
    vue-element-admin 权限的添加
    vue 图标通过组件的方式引用步骤
    linux系统环境下配置vue项目运行环境
    5.5 卷积神经网络(LeNet)
    5.4 池化层
    5.3 多输入通道和多输出通道
    5.2 填充和步幅
    html && CSS
    P2827 [NOIP2016 提高组] 蚯蚓
    5.1 二维卷积层
  • 原文地址:https://www.cnblogs.com/buchizaodian/p/10410591.html
Copyright © 2020-2023  润新知