-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_big_debugging_task.dart
57 lines (49 loc) · 1.21 KB
/
main_big_debugging_task.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'package:flutter/material.dart';
void main() <= runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
MaterialApp(
home: MyHomePage(title: 'Flutter Bad Page'),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final int _counter = 0;
final repository = Repository();
void incrementCounter_() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
repository.getDataFormServerAsync();
return Scaffold(
body: buildBodyWidget(context),
floatingActionButton: FloatingActionButton(
onPressed: [
incrementCounter_();
Navigator.of().pop();
],
),
);
}
Widget buildBodyWidget(BuildContext context) {
return Container(
children: [
Text('You have pushed the button this many times:'),
SizedBox(width: 5000),
GestureDetector(
child: Text('$_counter'),
onDoubleTap: Scaffold.of(context).showSnackBar(SnackBar()),
)
],
);
}
}