リスト 4.53


//flutter
import 'package:flutter/material.dart';

void main() {
  return runApp(TestPage());
}

//リスト4.53
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'GestureDetector',
      home: Scaffold(
        appBar: AppBar(title: Text('GestureDetector')),
        body: Center(
          child: GestureDetector(
            onTap: () => print('onTap'),
            onLongPress: () => print('onLongPress'),
            child: Container(
              width: 100,
              height: 100,
              color: Colors.grey,
            )
          )
        )
      )
    );
  }
}