🚧 remove new keyword to get inline with dart 2 code standard.

This commit is contained in:
Nishant Srivastava
2019-07-23 03:42:56 +02:00
parent e8b433c00d
commit 6d56bfc5d4
45 changed files with 438 additions and 438 deletions

View File

@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: new MyHome(),
home: MyHome(),
// Set the theme's primary color, accent color,
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.green,
accentColor: Colors.lightGreenAccent,
// Set background color
@ -17,20 +17,20 @@ void main() {
class MyHome extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
return Scaffold(
// AppBar
appBar: new AppBar(
appBar: AppBar(
// AppBar Title
title: new Text("Using Theme"),
title: Text("Using Theme"),
),
body: new Container(
body: Container(
// Another way to set the background color
decoration: new BoxDecoration(color: Colors.black87),
child: new Center(
child: new Container(
decoration: BoxDecoration(color: Colors.black87),
child: Center(
child: Container(
// use the theme accent color as background color for this widget
color: Theme.of(context).accentColor,
child: new Text(
child: Text(
'Hello World!',
// Set text style as per theme
style: Theme.of(context).textTheme.title,