Last active
August 18, 2022 22:29
-
-
Save FlutterZeroGit/0d6c007a82d4c64f9dc4e26d8a52ae06 to your computer and use it in GitHub Desktop.
GestureDetector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
void hello() { | |
print('Hello World'); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar(title: const Text('FlutterZero')), | |
body: Center( | |
child: GestureDetector( | |
child: Icon( | |
Icons.home, | |
size: 100, | |
color: Colors.blue, | |
), | |
onTap: () => print('シングルクリック'), | |
onDoubleTap: () => print('ダブルクリック'), | |
onLongPress: () => print('ロングプレス'), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment