Skip to content

Remove 'new' keyword #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ The praram default value is `false`.
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart'; // 1. import library

void main() => runApp(new MyApp());
void main() => runApp( MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return OKToast(
//2. wrap your app with OKToast
child: new MaterialApp(
child: MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
),
);
}
Expand All @@ -176,7 +176,7 @@ class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);

@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -241,19 +241,19 @@ class _MyHomePageState extends State<MyHomePage> {

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("ktoast demo"),
return Scaffold(
appBar: AppBar(
title: Text("ktoast demo"),
),
body: Stack(
children: <Widget>[
new Center(
Center(
child: ListView(
children: <Widget>[
new Text(
Text(
'You have pushed the button this many times:',
),
new Text(
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
Expand Down
22 changes: 11 additions & 11 deletions example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart'; // 1. import library

void main() => runApp(new MyApp());
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Expand All @@ -13,12 +13,12 @@ class MyApp extends StatelessWidget {
textStyle: TextStyle(fontSize: 19.0, color: Colors.white),
backgroundColor: Colors.grey,
radius: 10.0,
child: new MaterialApp(
child: MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
home: MyHomePage(),
),
);
}
Expand All @@ -28,7 +28,7 @@ class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);

@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -91,19 +91,19 @@ class _MyHomePageState extends State<MyHomePage> {

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("ktoast demo"),
return Scaffold(
appBar: AppBar(
title: Text("ktoast demo"),
),
body: Stack(
children: <Widget>[
new Center(
Center(
child: ListView(
children: <Widget>[
new Text(
Text(
'You have pushed the button this many times:',
),
new Text(
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
Expand Down
20 changes: 10 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.3.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "1.0.5"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -52,28 +52,28 @@ packages:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.1.7"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.2"
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
version: "1.8.0+1"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -106,7 +106,7 @@ packages:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
version: "1.0.5"
term_glyph:
dependency: transitive
description:
Expand All @@ -120,7 +120,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.2.5"
typed_data:
dependency: transitive
description:
Expand All @@ -136,5 +136,5 @@ packages:
source: hosted
version: "2.0.8"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.2.2 <3.0.0"
flutter: ">=0.3.0 <2.0.0"