zoukankan      html  css  js  c++  java
  • flutter 底部的Taps

    import 'package:flutter/material.dart';
    
    void main() => runApp(new MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        final title = 'Gesture Demo';
    
        return new MaterialApp(
          title: title,
          home: new MyHomePage(title: title),
        );
      }
    }
    
    class MyHomePage extends StatelessWidget {
      final String title;
      MyHomePage({Key key, this.title}) : super(key: key);
      @override
      Widget build(BuildContext context) {
        return new Scaffold(
          appBar: new AppBar(
            title: new Text(title),
          ),
          body: new Center(child: new MyButton()),
        );
      }
    }
    
    class MyButton extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        // Our GestureDetector wraps our button
        return new GestureDetector(
          // When the child is tapped, show a snackbar
          onTap: () {
            final snackBar = new SnackBar(content: new Text("Tap"));
    
            Scaffold.of(context).showSnackBar(snackBar);
          },
          // Our Custom Button!
          child: new Container(
            padding: new EdgeInsets.all(12.0),
            decoration: new BoxDecoration(
              color: Theme.of(context).buttonColor,
              borderRadius: new BorderRadius.circular(8.0),
            ),
            child: new Text('My Button'),
          ),
        );
      }
    }

  • 相关阅读:
    (转)php读写文件
    CentOS5.2下安装GCC4.1.2
    使用php模拟post提交数据
    Linux系统信息查看命令大全
    强制卸载MYSQL
    Php文件操作
    redhat linux上安装 gcc编译器
    centos5.2安装mysql6.0
    如何收缩数据库日志文件(ldf)
    浑沌的JSON,JS Object,JS Array
  • 原文地址:https://www.cnblogs.com/sea-stream/p/12159033.html
Copyright © 2011-2022 走看看