Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(new MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6. @override
  7. Widget build(BuildContext context) {
  8. return new MaterialApp(
  9. theme: new ThemeData(platform: TargetPlatform.android),
  10. home: new Scaffold(
  11. body: new GestureDetector(
  12. onTapDown: (TapDownDetails details) {
  13. print("tapped down button 1");
  14. },
  15. onTapUp: (TapUpDetails details) {
  16. print("tapped up button 1");
  17. },
  18. onTapCancel: () {
  19. print("tapped cancel button 1");
  20. },
  21. onTap: () {
  22. print("tapped button 1");
  23. },
  24. child: new Container(
  25. height: 400.0,
  26. width: 400.0,
  27. color: Colors.red,
  28. child: new Column(
  29. children: <Widget>[
  30. new GestureDetector(
  31. onTapDown: (TapDownDetails details) {
  32. print("tapped down button 2");
  33. },
  34. onTapUp: (TapUpDetails details) {
  35. print("tapped up button 2");
  36. },
  37. onTapCancel: () {
  38. print("tapped cancel button 2");
  39. },
  40. onTap: () {
  41. print("tapped button 2");
  42. },
  43. child: Container(
  44. height: 200.0,
  45. width: 200.0,
  46. color: Colors.blue,
  47. ),
  48. ),
  49. ],
  50. ),
  51. ),
  52. ),
  53. ),
  54. );
  55. }
  56. }
Add Comment
Please, Sign In to add comment