Skip to content

Commit bde7e64

Browse files
committed
Remove new key word
1 parent 35f1a3d commit bde7e64

File tree

8 files changed

+103
-103
lines changed

8 files changed

+103
-103
lines changed

lib/main.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class _MyAppState extends State<MyApp> {
4646

4747
@override
4848
Widget build(BuildContext context) {
49-
return new MaterialApp(
50-
home: new Scaffold(
51-
appBar: new AppBar(
52-
title: new Text('Flutter-WebRTC example'),
49+
return MaterialApp(
50+
home: Scaffold(
51+
appBar: AppBar(
52+
title: Text('Flutter-WebRTC example'),
5353
),
54-
body: new ListView.builder(
54+
body: ListView.builder(
5555
shrinkWrap: true,
5656
padding: const EdgeInsets.all(0.0),
5757
itemCount: items.length,
@@ -91,7 +91,7 @@ class _MyAppState extends State<MyApp> {
9191
_showAddressDialog(context) {
9292
showDemoDialog<DialogDemoAction>(
9393
context: context,
94-
child: new AlertDialog(
94+
child: AlertDialog(
9595
title: const Text('Enter server address:'),
9696
content: TextField(
9797
onChanged: (String text) {
@@ -105,12 +105,12 @@ class _MyAppState extends State<MyApp> {
105105
textAlign: TextAlign.center,
106106
),
107107
actions: <Widget>[
108-
new FlatButton(
108+
FlatButton(
109109
child: const Text('CANCEL'),
110110
onPressed: () {
111111
Navigator.pop(context, DialogDemoAction.cancel);
112112
}),
113-
new FlatButton(
113+
FlatButton(
114114
child: const Text('CONNECT'),
115115
onPressed: () {
116116
Navigator.pop(context, DialogDemoAction.connect);
@@ -126,8 +126,8 @@ class _MyAppState extends State<MyApp> {
126126
push: (BuildContext context) {
127127
Navigator.push(
128128
context,
129-
new MaterialPageRoute(
130-
builder: (BuildContext context) => new BasicSample()));
129+
MaterialPageRoute(
130+
builder: (BuildContext context) => BasicSample()));
131131
}),
132132
RouteItem(
133133
title: 'P2P Call Sample',

lib/src/basic_sample/basic_sample.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,35 @@ final List<RouteItem> items = <RouteItem>[
1313
push: (BuildContext context) {
1414
Navigator.push(
1515
context,
16-
new MaterialPageRoute(
17-
builder: (BuildContext context) => new GetUserMediaSample()));
16+
MaterialPageRoute(
17+
builder: (BuildContext context) => GetUserMediaSample()));
1818
}),
1919
RouteItem(
2020
title: 'LoopBack Sample',
2121
push: (BuildContext context) {
2222
Navigator.push(
2323
context,
24-
new MaterialPageRoute(
25-
builder: (BuildContext context) => new LoopBackSample()));
24+
MaterialPageRoute(
25+
builder: (BuildContext context) => LoopBackSample()));
2626
}),
2727
RouteItem(
2828
title: 'DataChannel Test',
2929
push: (BuildContext context) {
3030
Navigator.push(
3131
context,
32-
new MaterialPageRoute(
33-
builder: (BuildContext context) => new DataChannelSample()));
32+
MaterialPageRoute(
33+
builder: (BuildContext context) => DataChannelSample()));
3434
}),
3535
];
3636

3737
class BasicSample extends StatefulWidget {
3838
static String tag = 'basic_sample';
3939
@override
40-
_BasicSampleState createState() => new _BasicSampleState();
40+
_BasicSampleState createState() => _BasicSampleState();
4141
}
4242

4343
class _BasicSampleState extends State<BasicSample> {
44-
GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
44+
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
4545
@override
4646
initState() {
4747
super.initState();
@@ -65,11 +65,11 @@ class _BasicSampleState extends State<BasicSample> {
6565

6666
@override
6767
Widget build(BuildContext context) {
68-
return new Scaffold(
69-
appBar: new AppBar(
70-
title: new Text('Basic API Tests'),
68+
return Scaffold(
69+
appBar: AppBar(
70+
title: Text('Basic API Tests'),
7171
),
72-
body: new ListView.builder(
72+
body: ListView.builder(
7373
shrinkWrap: true,
7474
padding: const EdgeInsets.all(0.0),
7575
itemCount: items.length,

lib/src/basic_sample/data_channel_sample.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class DataChannelSample extends StatefulWidget {
77
static String tag = 'data_channel_sample';
88

99
@override
10-
_DataChannelSampleState createState() => new _DataChannelSampleState();
10+
_DataChannelSampleState createState() => _DataChannelSampleState();
1111
}
1212

1313
class _DataChannelSampleState extends State<DataChannelSample> {
@@ -135,23 +135,23 @@ class _DataChannelSampleState extends State<DataChannelSample> {
135135
@override
136136
Widget build(BuildContext context) {
137137
return
138-
new Scaffold(
139-
appBar: new AppBar(
140-
title: new Text('Data Channel Test'),
138+
Scaffold(
139+
appBar: AppBar(
140+
title: Text('Data Channel Test'),
141141
),
142-
body: new OrientationBuilder(
142+
body: OrientationBuilder(
143143
builder: (context, orientation) {
144-
return new Center(
145-
child: new Container(
144+
return Center(
145+
child: Container(
146146
child: _inCalling? Text(_sdp) : Text('data channel test'),
147147
),
148148
);
149149
},
150150
),
151-
floatingActionButton: new FloatingActionButton(
151+
floatingActionButton: FloatingActionButton(
152152
onPressed: _inCalling ? _hangUp : _makeCall,
153153
tooltip: _inCalling ? 'Hangup' : 'Call',
154-
child: new Icon(_inCalling ? Icons.call_end : Icons.phone),
154+
child: Icon(_inCalling ? Icons.call_end : Icons.phone),
155155
),
156156
);
157157

lib/src/basic_sample/get_user_media_sample.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ class GetUserMediaSample extends StatefulWidget {
99
static String tag = 'get_usermedia_sample';
1010

1111
@override
12-
_GetUserMediaSampleState createState() => new _GetUserMediaSampleState();
12+
_GetUserMediaSampleState createState() => _GetUserMediaSampleState();
1313
}
1414

1515
class _GetUserMediaSampleState extends State<GetUserMediaSample> {
1616
MediaStream _localStream;
17-
final _localRenderer = new RTCVideoRenderer();
17+
final _localRenderer = RTCVideoRenderer();
1818
bool _inCalling = false;
1919

2020
@override
@@ -80,27 +80,27 @@ class _GetUserMediaSampleState extends State<GetUserMediaSample> {
8080

8181
@override
8282
Widget build(BuildContext context) {
83-
return new Scaffold(
84-
appBar: new AppBar(
85-
title: new Text('GetUserMedia API Test'),
83+
return Scaffold(
84+
appBar: AppBar(
85+
title: Text('GetUserMedia API Test'),
8686
),
87-
body: new OrientationBuilder(
87+
body: OrientationBuilder(
8888
builder: (context, orientation) {
89-
return new Center(
90-
child: new Container(
91-
margin: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
89+
return Center(
90+
child: Container(
91+
margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
9292
width: MediaQuery.of(context).size.width,
9393
height: MediaQuery.of(context).size.height,
9494
child: RTCVideoView(_localRenderer),
95-
decoration: new BoxDecoration(color: Colors.black54),
95+
decoration: BoxDecoration(color: Colors.black54),
9696
),
9797
);
9898
},
9999
),
100-
floatingActionButton: new FloatingActionButton(
100+
floatingActionButton: FloatingActionButton(
101101
onPressed: _inCalling ? _hangUp : _makeCall,
102102
tooltip: _inCalling ? 'Hangup' : 'Call',
103-
child: new Icon(_inCalling ? Icons.call_end : Icons.phone),
103+
child: Icon(_inCalling ? Icons.call_end : Icons.phone),
104104
),
105105
);
106106
}

lib/src/basic_sample/loopback_sample.dart

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class LoopBackSample extends StatefulWidget {
99
static String tag = 'loopback_sample';
1010

1111
@override
12-
_MyAppState createState() => new _MyAppState();
12+
_MyAppState createState() => _MyAppState();
1313
}
1414

1515
class _MyAppState extends State<LoopBackSample> {
1616
MediaStream _localStream;
1717
RTCPeerConnection _peerConnection;
18-
final _localRenderer = new RTCVideoRenderer();
19-
final _remoteRenderer = new RTCVideoRenderer();
18+
final _localRenderer = RTCVideoRenderer();
19+
final _remoteRenderer = RTCVideoRenderer();
2020
bool _inCalling = false;
2121
Timer _timer;
2222

@@ -184,38 +184,38 @@ class _MyAppState extends State<LoopBackSample> {
184184
Widget build(BuildContext context) {
185185
return
186186
new Scaffold(
187-
appBar: new AppBar(
188-
title: new Text('LoopBack example'),
187+
appBar: AppBar(
188+
title: Text('LoopBack example'),
189189
),
190-
body: new OrientationBuilder(
190+
body: OrientationBuilder(
191191
builder: (context, orientation) {
192-
return new Center(
193-
child: new Container(
194-
decoration: new BoxDecoration(color: Colors.white),
195-
child: new Stack(
192+
return Center(
193+
child: Container(
194+
decoration: BoxDecoration(color: Colors.white),
195+
child: Stack(
196196
children: <Widget>[
197-
new Align(
197+
Align(
198198
alignment: orientation == Orientation.portrait
199199
? const FractionalOffset(0.5, 0.1)
200200
: const FractionalOffset(0.0, 0.5),
201-
child: new Container(
201+
child: Container(
202202
margin: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
203203
width: 320.0,
204204
height: 240.0,
205-
child: new RTCVideoView(_localRenderer),
206-
decoration: new BoxDecoration(color: Colors.black54),
205+
child: RTCVideoView(_localRenderer),
206+
decoration: BoxDecoration(color: Colors.black54),
207207
),
208208
),
209-
new Align(
209+
Align(
210210
alignment: orientation == Orientation.portrait
211211
? const FractionalOffset(0.5, 0.9)
212212
: const FractionalOffset(1.0, 0.5),
213-
child: new Container(
214-
margin: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
213+
child: Container(
214+
margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
215215
width: 320.0,
216216
height: 240.0,
217-
child: new RTCVideoView(_remoteRenderer),
218-
decoration: new BoxDecoration(color: Colors.black54),
217+
child: RTCVideoView(_remoteRenderer),
218+
decoration: BoxDecoration(color: Colors.black54),
219219
),
220220
),
221221
],
@@ -224,10 +224,10 @@ class _MyAppState extends State<LoopBackSample> {
224224
);
225225
},
226226
),
227-
floatingActionButton: new FloatingActionButton(
227+
floatingActionButton: FloatingActionButton(
228228
onPressed: _inCalling ? _hangUp : _makeCall,
229229
tooltip: _inCalling ? 'Hangup' : 'Call',
230-
child: new Icon(_inCalling ? Icons.call_end : Icons.phone),
230+
child: Icon(_inCalling ? Icons.call_end : Icons.phone),
231231
),
232232
);
233233

0 commit comments

Comments
 (0)