File tree Expand file tree Collapse file tree 2 files changed +60
-111
lines changed
Expand file tree Collapse file tree 2 files changed +60
-111
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart';
2+
3+ void main() => runApp(MyApp());
4+
5+ class MyApp extends StatelessWidget {
6+ @override
7+ Widget build(BuildContext context) {
8+ return MaterialApp(
9+ title: 'Flutter Demo',
10+ theme: ThemeData( primarySwatch: Colors.blue ),
11+ home: MyHomePage(title: 'Flutter Demo Home Page'),
12+ );
13+ }
14+ }
15+
16+ class MyHomePage extends StatefulWidget {
17+ MyHomePage({Key key, this.title}) : super(key: key);
18+ final String title;
19+
20+ @override
21+ _MyHomePageState createState() => _MyHomePageState();
22+ }
23+
24+ class _MyHomePageState extends State<MyHomePage> {
25+ int _counter = 0;
26+
27+ void _incrementCounter() {
28+ setState(() {
29+ _counter++;
30+ });
31+ }
32+
33+ @override
34+ Widget build(BuildContext context) {
35+ return Scaffold(
36+ appBar: AppBar(
37+ title: Text(widget.title),
38+ ),
39+ body: Center(
40+ child: Column(
41+ mainAxisAlignment: MainAxisAlignment.center,
42+ children: <Widget>[
43+ Text(
44+ 'You have pushed the button this many times:',
45+ ),
46+ Text(
47+ '$_counter',
48+ style: Theme.of(context).textTheme.display1,
49+ ),
50+ ],
51+ ),
52+ ),
53+ floatingActionButton: FloatingActionButton(
54+ onPressed: _incrementCounter,
55+ tooltip: 'Increment',
56+ child: Icon(Icons.add),
57+ ),
58+ );
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments