updated readme of each example with a screenshot/gif and more details about the example.
added more comments to code
@ -1,8 +1,12 @@
|
||||
# handling_routes
|
||||
# Handling Routes
|
||||
|
||||
Mobile apps typically reveal their contents via full-screen elements called "screens" or "pages". In Flutter these elements are called routes and they're managed by a Navigator widget. The navigator manages a stack of Route objects and provides methods for managing the stack, like Navigator.push and Navigator.pop.
|
||||
|
||||
Read [[Documentation](https://docs.flutter.io/flutter/widgets/Navigator-class.html)]
|
||||
|
||||
<img src="demo_img.gif" 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
handling_routes/demo_img.gif
Normal file
After Width: | Height: | Size: 540 KiB |
@ -4,28 +4,42 @@ class AboutPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
// AppBar
|
||||
appBar: new AppBar(
|
||||
// Title
|
||||
title: new Text("About Page"),
|
||||
// App Bar background color
|
||||
backgroundColor: Colors.blue,
|
||||
),
|
||||
// Body
|
||||
body: new Container(
|
||||
// Center the content
|
||||
child: new Center(
|
||||
child: new Column(
|
||||
// Center content in the column
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// add children to the column
|
||||
children: <Widget>[
|
||||
// Text
|
||||
new Text(
|
||||
"About Page\nClick on below icon to goto Home Page",
|
||||
// Setting the style for the Text
|
||||
style: new TextStyle(fontSize: 20.0),
|
||||
// Set text alignment to center
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// Icon Button
|
||||
new IconButton(
|
||||
icon: new Icon(
|
||||
Icons.home,
|
||||
color: Colors.blue,
|
||||
color: Colors.red,
|
||||
),
|
||||
// Execute when pressed
|
||||
onPressed: () {
|
||||
// use the navigator to goto a named route
|
||||
Navigator.of(context).pushNamed('/');
|
||||
},
|
||||
// Setting the size of icon
|
||||
iconSize: 80.0,
|
||||
)
|
||||
],
|
||||
|
@ -4,28 +4,42 @@ class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
// AppBar
|
||||
appBar: new AppBar(
|
||||
// Title
|
||||
title: new Text("Home Page"),
|
||||
// App Bar background color
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
// Body
|
||||
body: new Container(
|
||||
// Center the content
|
||||
child: new Center(
|
||||
child: new Column(
|
||||
// Center content in the column
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// add children to the column
|
||||
children: <Widget>[
|
||||
// Text
|
||||
new Text(
|
||||
"Home Page\nClick on below icon to goto About Page",
|
||||
style: new TextStyle(fontSize: 20.0),
|
||||
// Setting the style for the Text
|
||||
style: new TextStyle(fontSize: 20.0,),
|
||||
// Set text alignment to center
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// Icon Button
|
||||
new IconButton(
|
||||
icon: new Icon(
|
||||
Icons.info,
|
||||
color: Colors.green,
|
||||
color: Colors.blue,
|
||||
),
|
||||
// Execute when pressed
|
||||
onPressed: () {
|
||||
// use the navigator to goto a named route
|
||||
Navigator.of(context).pushNamed('/about');
|
||||
},
|
||||
// Setting the size of icon
|
||||
iconSize: 80.0,
|
||||
)
|
||||
],
|
||||
|
@ -1,8 +1,10 @@
|
||||
# load_local_image
|
||||
# Load Local Image
|
||||
|
||||
Example app showing implementation which loads up an image from a local folder.
|
||||
|
||||
<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
load_local_image/demo_img.jpg
Executable file
After Width: | Height: | Size: 768 KiB |
@ -15,7 +15,10 @@ class MyApp extends StatelessWidget {
|
||||
),
|
||||
body: new Container(
|
||||
child: new Center(
|
||||
child: new Text("Hellow World!"),
|
||||
child: new Text(
|
||||
"Hello World!",
|
||||
style: new TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
// Set the image as the background of the Container
|
||||
decoration: new BoxDecoration(
|
||||
|
@ -1,8 +1,10 @@
|
||||
# load_local_json
|
||||
# Load Local JSON
|
||||
|
||||
Example app showing implementation which loads up a json file from a local folder.
|
||||
|
||||
<img src="demo_img.gif" 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
load_local_json/demo_img.gif
Normal file
After Width: | Height: | Size: 4.1 MiB |
@ -30,9 +30,11 @@ class MyAppState extends State<MyApp> {
|
||||
.of(context)
|
||||
.loadString('data_repo/starwars_data.json'),
|
||||
builder: (context, snapshot) {
|
||||
// Decode the JSON
|
||||
var new_data = JSON.decode(snapshot.data.toString());
|
||||
|
||||
return new ListView.builder(
|
||||
// Build the ListView
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return new Card(
|
||||
child: new Column(
|
||||
|
@ -1,8 +1,10 @@
|
||||
# simple_material_app
|
||||
# Simple Material App
|
||||
|
||||
A simple material 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
simple_material_app/demo_img.jpg
Executable file
After Width: | Height: | Size: 103 KiB |
@ -13,7 +13,9 @@ void main() {
|
||||
),
|
||||
// Body
|
||||
body: new Container(
|
||||
// Center the content
|
||||
child: new Center(
|
||||
// Add Text
|
||||
child: new Text("Hello World!"),
|
||||
),
|
||||
),
|
||||
|
@ -1,8 +1,14 @@
|
||||
# stateful_widget
|
||||
# Stateful Widget
|
||||
|
||||
A widget that has mutable state.
|
||||
|
||||
A stateful widget is a widget that describes part of the user interface by building a constellation of other widgets that describe the user interface more concretely. The building process continues recursively until the description of the user interface is fully concrete
|
||||
|
||||
Read [[Documentation](https://docs.flutter.io/flutter/widgets/StatefulWidget-class.html)]
|
||||
|
||||
<img src="demo_img.gif" 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
stateful_widget/demo_img.gif
Normal file
After Width: | Height: | Size: 353 KiB |
@ -1,8 +1,14 @@
|
||||
# stateless_widgets
|
||||
# Stateless Widget
|
||||
|
||||
A widget that does not require mutable state.
|
||||
|
||||
A stateless widget is a widget that describes part of the user interface by building a constellation of other widgets that describe the user interface more concretely. The building process continues recursively until the description of the user interface is fully concrete
|
||||
|
||||
Read [[Documentation](https://docs.flutter.io/flutter/widgets/StatelessWidget-class.html)]
|
||||
|
||||
<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
stateless_widgets/demo_img.jpg
Executable file
After Width: | Height: | Size: 175 KiB |
@ -1,8 +1,10 @@
|
||||
# tip_calculator
|
||||
# Tip Calculator
|
||||
|
||||
Example app showing implementation which calculates the tip.
|
||||
|
||||
<img src="demo_img.gif" 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
tip_calculator/demo_img.gif
Normal file
After Width: | Height: | Size: 807 KiB |
@ -1,8 +1,14 @@
|
||||
# using_alert_dialog
|
||||
# Using Alert Dialog
|
||||
|
||||
A material design alert dialog.
|
||||
|
||||
An alert dialog informs the user about situations that require acknowledgement. An alert dialog has an optional title and an optional list of actions. The title is displayed above the content and the actions are displayed below the content.
|
||||
|
||||
Read [[Documentation](https://docs.flutter.io/flutter/material/AlertDialog-class.html)]
|
||||
|
||||
<img src="demo_img.gif" 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_alert_dialog/demo_img.gif
Normal file
After Width: | Height: | Size: 277 KiB |
@ -1,8 +1,10 @@
|
||||
# using_edittext
|
||||
# Using Edit Text
|
||||
|
||||
Example app that shows how to use a Edit Text in an app.
|
||||
|
||||
<img src="demo_img.gif" 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_edittext/demo_img.gif
Normal file
After Width: | Height: | Size: 942 KiB |
@ -1,8 +1,10 @@
|
||||
# using_http_get
|
||||
# Using Http GET
|
||||
|
||||
Example app showing implementation which loads up an information via making an HTTP GET call to a server and then displays the results in a list form.
|
||||
|
||||
<img src="demo_img.gif" 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_http_get/demo_img.gif
Normal file
After Width: | Height: | Size: 456 KiB |
@ -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
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),
|
||||
));
|
||||
}
|
||||
|