import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter GestureDetector', theme: ThemeData( primarySwatch: Colors.green,), home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @override MyHomePageState createState() => new MyHomePageState(); } class MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Gestures Exemplo'), centerTitle: true, ), body: Center(child: GestureDetector( onTap: () { print('A caixa foi Clicada'); }, child: Container( height: 60.0, width: 120.0, padding: EdgeInsets.all(10.0), decoration: BoxDecoration( color: Colors.cyan, borderRadius: BorderRadius.circular(15.0), ), child: Center(child: Text('Clique Aqui')), ) )), ); } }