Skip to content

Commit f9b26fc

Browse files
committed
tuto iamshaunjp#7 statelesswidget
1 parent b6939b1 commit f9b26fc

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

lib/main.dart

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
import 'package:flutter/material.dart';
22

33
void main() => runApp(MaterialApp(
4-
home: Scaffold(
5-
appBar: AppBar(
6-
backgroundColor: Colors.blue, //<-- SEE HERE
7-
title: Text('my first app'),
8-
centerTitle: true,
9-
),
10-
body: Center(
11-
child: Text('hello Fadoua'),
12-
),
13-
floatingActionButton: FloatingActionButton(
14-
onPressed: () {
15-
print("clicked");
16-
// logic of the button
4+
home: Home(),
5+
)
6+
);
7+
8+
class Home extends StatelessWidget {
9+
const Home({super.key});
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return Scaffold(
14+
appBar: AppBar(
15+
backgroundColor: Colors.blue, //<-- SEE HERE
16+
title: Text('my first app'),
17+
centerTitle: true,
18+
),
19+
body: Center(
20+
child: Text('hello Fadoua'),
21+
),
22+
floatingActionButton: FloatingActionButton(
23+
onPressed: () {
24+
print("clicked");
25+
// logic of the button
1726
},
18-
child: Text('click'),
19-
),
20-
),
21-
));
27+
child: Text('click'),
28+
),
29+
);
30+
31+
}
32+
}
33+
2234

0 commit comments

Comments
 (0)