|
1 | 1 | import 'package:flutter/material.dart'; |
| 2 | +import 'app/cherrypic_app.dart'; |
2 | 3 |
|
3 | 4 | void main() { |
4 | | - runApp(const MyApp()); |
5 | | -} |
6 | | - |
7 | | -class MyApp extends StatelessWidget { |
8 | | - const MyApp({super.key}); |
9 | | - |
10 | | - @override |
11 | | - Widget build(BuildContext context) { |
12 | | - return MaterialApp( |
13 | | - title: 'Cherrypic App', |
14 | | - theme: ThemeData( |
15 | | - primarySwatch: Colors.pink, |
16 | | - ), |
17 | | - home: const MyHomePage(), |
18 | | - ); |
19 | | - } |
20 | | -} |
21 | | - |
22 | | -class MyHomePage extends StatefulWidget { |
23 | | - const MyHomePage({super.key}); |
24 | | - |
25 | | - @override |
26 | | - State<MyHomePage> createState() => _MyHomePageState(); |
27 | | -} |
28 | | - |
29 | | -class _MyHomePageState extends State<MyHomePage> { |
30 | | - int _counter = 0; |
31 | | - |
32 | | - void _incrementCounter() { |
33 | | - setState(() { |
34 | | - _counter++; |
35 | | - }); |
36 | | - } |
37 | | - |
38 | | - @override |
39 | | - Widget build(BuildContext context) { |
40 | | - return Scaffold( |
41 | | - appBar: AppBar( |
42 | | - title: const Text('Cherrypic'), |
43 | | - ), |
44 | | - body: Center( |
45 | | - child: Column( |
46 | | - mainAxisAlignment: MainAxisAlignment.center, |
47 | | - children: <Widget>[ |
48 | | - const Text( |
49 | | - 'You have pushed the button this many times:', |
50 | | - ), |
51 | | - Text( |
52 | | - '$_counter', |
53 | | - style: Theme.of(context).textTheme.headlineMedium, |
54 | | - ), |
55 | | - ], |
56 | | - ), |
57 | | - ), |
58 | | - floatingActionButton: FloatingActionButton( |
59 | | - onPressed: _incrementCounter, |
60 | | - tooltip: 'Increment', |
61 | | - child: const Icon(Icons.add), |
62 | | - ), |
63 | | - ); |
64 | | - } |
| 5 | + runApp(const CherrypicApp()); |
65 | 6 | } |
0 commit comments