zoukankan      html  css  js  c++  java
  • flutter floatingActionButton悬浮按钮控件

    import 'package:flutter/material.dart';
    
    void main() {
      runApp( MaterialApp(
        title: 'Flutter gesture',
        home: LearnFloatingActionButton(),
      ));
    }
    
    class LearnFloatingActionButton extends StatefulWidget{
      @override
      State<StatefulWidget> createState() {
        return _LearnFloatingActionButton();
      }
    }
    class _LearnFloatingActionButton extends State<LearnFloatingActionButton>{
      @override
      Widget build(BuildContext context) {
        return new Scaffold(
          body: new Center(
            child:new FloatingActionButton(
              child: new Icon(Icons.ac_unit),//子Widet 可以是文本或者图片
              tooltip: '长按之后提示的文字',//长按提示的文字
              foregroundColor: Colors.red,//设置显示图标或者文本的颜色//前提是子child没有设置
              backgroundColor: Colors.blueAccent,//设置按钮的背景色
    //          heroTag: ,//类似于一个标识
              elevation: 10.0,//设置阴影
              highlightElevation: 50.0,
              shape: const CircleBorder(),
    //          isExtended: true,
              onPressed: (){
                print('aaaaaaaaaaaaaa点击了悬浮按钮aaaaaaaaaaaaa');
              },
            ),
          ),
        );
      }
    }

  • 相关阅读:
    python-django学习
    c++异常处理
    Python输入输出
    Python变量
    Python异常处理
    Python起源与发展
    vsftpd基于mysql的认证方式
    vsftpd搭建ftp服务,并实现虚拟用户访问
    httpd结合php的fpm模式
    编译安装apache
  • 原文地址:https://www.cnblogs.com/gaozhang12345/p/11958069.html
Copyright © 2011-2022 走看看