Skip to content

Instantly share code, notes, and snippets.

@FlutterZeroGit
Last active August 18, 2022 22:29
Show Gist options
  • Save FlutterZeroGit/0d6c007a82d4c64f9dc4e26d8a52ae06 to your computer and use it in GitHub Desktop.
Save FlutterZeroGit/0d6c007a82d4c64f9dc4e26d8a52ae06 to your computer and use it in GitHub Desktop.
GestureDetector
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