Skip to content

Commit

Permalink
tuto iamshaunjp#7 statelesswidget
Browse files Browse the repository at this point in the history
  • Loading branch information
fadouaabdoul committed Dec 7, 2023
1 parent b6939b1 commit f9b26fc
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue, //<-- SEE HERE
title: Text('my first app'),
centerTitle: true,
),
body: Center(
child: Text('hello Fadoua'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
print("clicked");
// logic of the button
home: Home(),
)
);

class Home extends StatelessWidget {
const Home({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue, //<-- SEE HERE
title: Text('my first app'),
centerTitle: true,
),
body: Center(
child: Text('hello Fadoua'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
print("clicked");
// logic of the button
},
child: Text('click'),
),
),
));
child: Text('click'),
),
);

}
}


0 comments on commit f9b26fc

Please sign in to comment.