mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-11-08 12:39:17 +00: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:
@@ -1,8 +1,10 @@
|
||||
# using_theme
|
||||
# Using Themes
|
||||
|
||||
Example app that shows how to setup a theme in your app.
|
||||
|
||||
<img src="demo_img.jpg" height="600em" />
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
For help getting started with Flutter, view our online
|
||||
[documentation](http://flutter.io/).
|
||||
For help getting started with Flutter, view online [documentation](http://flutter.io/).
|
||||
BIN
using_theme/demo_img.jpg
Executable file
BIN
using_theme/demo_img.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
@@ -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