Last active
April 11, 2022 03:24
-
-
Save suragch/79c76fb1854801c9cdb08c77a620b8be to your computer and use it in GitHub Desktop.
Exam prep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
backgroundColor: Colors.yellow, | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
Icon(Icons.home, size: 100), | |
Text( | |
'This is my button!', | |
style: TextStyle(fontSize: 30), | |
), | |
SizedBox(height: 20), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
ElevatedButton( | |
child: Text('1', style: TextStyle(fontSize: 30)), | |
onPressed: () { | |
print('1'); | |
}, | |
), | |
SizedBox(width: 20), | |
ElevatedButton( | |
child: Text('2', style: TextStyle(fontSize: 30)), | |
onPressed: () { | |
print('2'); | |
}, | |
), | |
SizedBox(width: 20), | |
ElevatedButton( | |
child: Text('3', style: TextStyle(fontSize: 30)), | |
onPressed: () { | |
print('3'); | |
}, | |
), | |
], | |
), | |
SizedBox(height: 20), | |
Container( | |
width: 300, | |
child: Image.asset('images/cat.jpg'), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment