Last active
March 8, 2020 22:35
-
-
Save nerder/eda6c1208a4cff0916df5e1b945b1fdd to your computer and use it in GitHub Desktop.
[Flutter Workshop] Step 0: Familiarize with the IDE shortcuts
This file contains hidden or 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
// IMPORTANT SHORTCUTS | |
// Run the code: [Cmd] + [Enter] | |
// Show quick fixes: [Alt] + [Enter] | |
// Comment-out code: [Cmd] + [/] | |
import 'package:flutter/material.dart'; | |
final Color twPink = Color.fromARGB(255, 239, 91, 161); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: twPink), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Center( | |
child: HelloTW(), | |
), | |
), | |
); | |
} | |
} | |
class HelloTW extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text('Hello', style: Theme.of(context).textTheme.headline3), | |
Padding( | |
padding: const EdgeInsets.only(left: 10, top: 10), | |
child: Image.network("https://www.thoughtworks.com/imgs/tw-logo.svg"), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment