Created
August 4, 2023 13:54
-
-
Save morozander/b081d6382945989871ca863b32e916e0 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
// With Flutter, you create user interfaces by combining "widgets" | |
// You'll learn all about them (and much more) throughout this course! | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
// Every custom widget must have a build() method | |
// It tells Flutter, which widgets make up your custom widget | |
// Again: You'll learn all about that throughout the course! | |
@override | |
Widget build(BuildContext context) { | |
// Below, a bunch of built-in widgets are used (provided by Flutter) | |
// They will be explained in the next sections | |
// In this course, you will, of course, not just use them a lot but | |
// also learn about many other widgets! | |
return MaterialApp( | |
title: 'Flutter First App', | |
theme: ThemeData(useMaterial3: true), | |
home: Scaffold( | |
appBar: AppBar( | |
title: const Text('Welcome to Flutter'), | |
), | |
body: Container( | |
width: double.infinity, | |
padding: const EdgeInsets.all(12), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: const [ | |
Text( | |
'Flutter - The Complete Guide', | |
textAlign: TextAlign.center, | |
style: TextStyle( | |
fontSize: 24, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
SizedBox(height: 16), | |
Text( | |
'Learn Flutter step-by-step, from the ground up.', | |
textAlign: TextAlign.center, | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment