Last active
September 22, 2019 09:47
-
-
Save Zambrella/0fed9116d7403043c08ba96927a7263f to your computer and use it in GitHub Desktop.
After adding the app bar to the app
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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
// I'm building a material app so using the MaterialApp widget gives us access to all of Flutter's material widgets | |
return MaterialApp( | |
// Implements the basic material design visual layout structure | |
home: Scaffold( | |
// appBar is a property of the Scaffold widget. This widget creates the top app bar | |
appBar: AppBar( | |
title: Text( | |
'MMR CALCULATOR', | |
), | |
// By default, in Android, the the Title is left adjusted but I want it centered. I could either style the Text or use the centerTitle appBar property and set it to true | |
centerTitle: true, | |
), | |
// Empty body (for now) | |
body: null, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment