mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-09-22 09:18:06 +08:00
🚧 remove new keyword to get inline with dart 2 code standard.
This commit is contained in:
@ -1,34 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
runApp(new MaterialApp(
|
||||
home: new MyHome(),
|
||||
runApp(MaterialApp(
|
||||
home: MyHome(),
|
||||
));
|
||||
}
|
||||
|
||||
class MyHome extends StatefulWidget {
|
||||
@override
|
||||
MyHomeState createState() => new MyHomeState();
|
||||
MyHomeState createState() => MyHomeState();
|
||||
}
|
||||
|
||||
class MyHomeState extends State<MyHome> {
|
||||
// Generate dialog
|
||||
AlertDialog dialog = new AlertDialog(
|
||||
content: new Text(
|
||||
AlertDialog dialog = AlertDialog(
|
||||
content: Text(
|
||||
"Hello World!",
|
||||
style: new TextStyle(fontSize: 30.0),
|
||||
style: TextStyle(fontSize: 30.0),
|
||||
));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
title: new Text("Using Alert Dialog"),
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Using Alert Dialog"),
|
||||
),
|
||||
body: new Container(
|
||||
child: new Center(
|
||||
child: new RaisedButton(
|
||||
child: new Text("Hit to alert!"),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: RaisedButton(
|
||||
child: Text("Hit to alert!"),
|
||||
// On press of the button
|
||||
onPressed: () {
|
||||
// Show dialog
|
||||
|
Reference in New Issue
Block a user