import 'package:flutter/material.dart'; void main() { print("5hahahha"); runApp(new MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { print("4hahahha"); return new MaterialApp( home: new TestWidget(), ); } } class TestWidget extends StatefulWidget { @override State<StatefulWidget> createState() { print("3hahahha"); return _TestWidgetState(); } } class _TestWidgetState extends State<TestWidget> { int _count=0; @override Widget build(BuildContext context) { print("0hahahha"); return Center( child: Column( children: <Widget>[ Text((_count).toString()), RaisedButton( onPressed: () { setState(() { print("1hahahha"); _count++; }); }, ) ], ), ); } }