Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(new MyApp());
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return new MaterialApp(
- theme: new ThemeData(platform: TargetPlatform.android),
- home: new Scaffold(
- body: new GestureDetector(
- onTapDown: (TapDownDetails details) {
- print("tapped down button 1");
- },
- onTapUp: (TapUpDetails details) {
- print("tapped up button 1");
- },
- onTapCancel: () {
- print("tapped cancel button 1");
- },
- onTap: () {
- print("tapped button 1");
- },
- child: new Container(
- height: 400.0,
- width: 400.0,
- color: Colors.red,
- child: new Column(
- children: <Widget>[
- new GestureDetector(
- onTapDown: (TapDownDetails details) {
- print("tapped down button 2");
- },
- onTapUp: (TapUpDetails details) {
- print("tapped up button 2");
- },
- onTapCancel: () {
- print("tapped cancel button 2");
- },
- onTap: () {
- print("tapped button 2");
- },
- child: Container(
- height: 200.0,
- width: 200.0,
- color: Colors.blue,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
Add Comment
Please, Sign In to add comment