mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-07-15 02:46:03 +08:00
updated readme of each example with a screenshot/gif and more details about the example.
added more comments to code
This commit is contained in:
@ -3,15 +3,27 @@ import 'package:flutter/material.dart';
|
||||
void main() {
|
||||
runApp(new MaterialApp(
|
||||
home: new Scaffold(
|
||||
// AppBar
|
||||
appBar: new AppBar(
|
||||
// AppBar Title
|
||||
title: new Text("Using Theme"),
|
||||
),
|
||||
body: new Container(
|
||||
child: new Center(
|
||||
child: new Text("Hello World!", style: new TextStyle(color: Colors.white),),
|
||||
child: new Text(
|
||||
"Hello World!",
|
||||
// Set the text style, text color to white
|
||||
style: new TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
decoration: new BoxDecoration(color: Colors.purple)),
|
||||
// Another way to set the background color
|
||||
decoration: new BoxDecoration(color: Colors.lightBlueAccent)),
|
||||
),
|
||||
// Set the theme's primary color, accent color,
|
||||
theme: new ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.lightBlueAccent,
|
||||
backgroundColor: Colors.blueAccent,
|
||||
),
|
||||
theme: new ThemeData(primarySwatch: Colors.deepPurple),
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user