mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-05-17 13:05:53 +08:00
🚧 remove new keyword to get inline with dart 2 code standard.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
runApp(new MaterialApp(
|
||||
home: new MyButton(),
|
||||
runApp(MaterialApp(
|
||||
home: MyButton(),
|
||||
));
|
||||
}
|
||||
|
||||
class MyButton extends StatefulWidget {
|
||||
@override
|
||||
MyButtonState createState() {
|
||||
return new MyButtonState();
|
||||
return MyButtonState();
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,22 +27,22 @@ class MyButtonState extends State<MyButton> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
title: new Text("Stateful Widget"),
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Stateful Widget"),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
body: new Container(
|
||||
child: new Center(
|
||||
child: new Column(
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text(displayedString, style: new TextStyle(fontSize: 40.0)),
|
||||
new Padding(padding: new EdgeInsets.all(10.0)),
|
||||
new RaisedButton(
|
||||
child: new Text(
|
||||
Text(displayedString, style: TextStyle(fontSize: 40.0)),
|
||||
Padding(padding: EdgeInsets.all(10.0)),
|
||||
RaisedButton(
|
||||
child: Text(
|
||||
"Press me",
|
||||
style: new TextStyle(color: Colors.white),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
color: Colors.red,
|
||||
onPressed: onPressOfButton,
|
||||
|
Reference in New Issue
Block a user