Skip to content

Instantly share code, notes, and snippets.



Last active Jun 11, 2018
What would you like to do?
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
// This widget is the root of your application.
MyAppState createState() {
return new MyAppState();
class MyAppState extends State<MyApp> {
int _tapCount = 0;
Widget build(BuildContext context) {
return new MaterialApp(
home: new Material(
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Text("Button tapped $_tapCount times."),
const SizedBox(
height: 8.0,
new GestureDetector(
child: new Container(
color: const Color(0xffcc6600),
child: new Center(
child: new Text("Tap me"),
height: 48.0,
onTap: _onTap,
void _onTap() {
setState(() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.