mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-07-15 02:46:03 +08:00
🚧 remove new keyword to get inline with dart 2 code standard.
This commit is contained in:
@ -3,34 +3,34 @@ import 'package:flutter/material.dart';
|
||||
class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
return Scaffold(
|
||||
// AppBar
|
||||
appBar: new AppBar(
|
||||
appBar: AppBar(
|
||||
// Title
|
||||
title: new Text("Home Page"),
|
||||
title: Text("Home Page"),
|
||||
// App Bar background color
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
// Body
|
||||
body: new Container(
|
||||
body: Container(
|
||||
// Center the content
|
||||
child: new Center(
|
||||
child: new Column(
|
||||
child: Center(
|
||||
child: Column(
|
||||
// Center content in the column
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// add children to the column
|
||||
children: <Widget>[
|
||||
// Text
|
||||
new Text(
|
||||
Text(
|
||||
"Home Page\nClick on below icon to goto About Page",
|
||||
// Setting the style for the Text
|
||||
style: new TextStyle(fontSize: 20.0,),
|
||||
style: TextStyle(fontSize: 20.0,),
|
||||
// Set text alignment to center
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// Icon Button
|
||||
new IconButton(
|
||||
icon: new Icon(
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.info,
|
||||
color: Colors.blue,
|
||||
),
|
||||
|
Reference in New Issue
Block a user