1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2025-11-08 12:39:17 +00:00

🚧 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

@@ -2,17 +2,17 @@ import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
runApp(new MaterialApp(
runApp(MaterialApp(
// Disable the debug flag
debugShowCheckedModeBanner: false,
// Home
home: new MyHome()));
home: MyHome()));
}
class MyHome extends StatefulWidget {
@override
MyHomeState createState() {
return new MyHomeState();
return MyHomeState();
}
}
@@ -67,31 +67,31 @@ class MyHomeState extends State<MyHome> {
@override
Widget build(BuildContext context) {
return new Scaffold(
return Scaffold(
// Appbar
appBar: new AppBar(
appBar: AppBar(
// Title
title: new Text(nameOfApp),
title: Text(nameOfApp),
),
// Body
body: new Container(
body: Container(
// Center the content
child: new Center(
child: new Column(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
Text(
'$counter',
textScaleFactor: 10.0,
),
new Padding(padding: new EdgeInsets.all(10.0)),
new RaisedButton(
Padding(padding: EdgeInsets.all(10.0)),
RaisedButton(
onPressed: _onIncrementHit,
child: new Text('Increment Counter')),
new Padding(padding: new EdgeInsets.all(10.0)),
new RaisedButton(
child: Text('Increment Counter')),
Padding(padding: EdgeInsets.all(10.0)),
RaisedButton(
onPressed: _onDecrementHit,
child: new Text('Decrement Counter')),
child: Text('Decrement Counter')),
],
),
),