@@ -91,7 +91,7 @@ class _File {
9191class _RandomAccessFileOps {
9292 @patch
9393 factory _RandomAccessFileOps (int pointer) =>
94- new _RandomAccessFileOpsImpl (pointer);
94+ _RandomAccessFileOpsImpl (pointer);
9595}
9696
9797@pragma ("vm:entry-point" )
@@ -100,7 +100,7 @@ base class _RandomAccessFileOpsImpl extends NativeFieldWrapperClass1
100100 _RandomAccessFileOpsImpl ._();
101101
102102 factory _RandomAccessFileOpsImpl (int pointer) =>
103- new _RandomAccessFileOpsImpl ._().._setPointer (pointer);
103+ _RandomAccessFileOpsImpl ._().._setPointer (pointer);
104104
105105 @pragma ("vm:external-name" , "File_SetPointer" )
106106 external void _setPointer (int pointer);
@@ -156,7 +156,7 @@ abstract class _FileSystemWatcher {
156156 _WatcherPath ? _watcherPath;
157157
158158 final StreamController <FileSystemEvent > _broadcastController =
159- new StreamController <FileSystemEvent >.broadcast ();
159+ StreamController <FileSystemEvent >.broadcast ();
160160
161161 /// Subscription on the stream returned by [_watchPath] .
162162 ///
@@ -171,26 +171,22 @@ abstract class _FileSystemWatcher {
171171 bool recursive,
172172 ) {
173173 if (Platform .isLinux || Platform .isAndroid) {
174- return new _InotifyFileSystemWatcher (path, events, recursive)._stream;
174+ return _InotifyFileSystemWatcher (path, events, recursive)._stream;
175175 }
176176 if (Platform .isWindows) {
177- return new _Win32FileSystemWatcher (path, events, recursive)._stream;
177+ return _Win32FileSystemWatcher (path, events, recursive)._stream;
178178 }
179179 if (Platform .isMacOS) {
180- return new _FSEventStreamFileSystemWatcher (
181- path,
182- events,
183- recursive,
184- )._stream;
180+ return _FSEventStreamFileSystemWatcher (path, events, recursive)._stream;
185181 }
186- throw new FileSystemException (
182+ throw FileSystemException (
187183 "File system watching is not supported on this platform" ,
188184 );
189185 }
190186
191187 _FileSystemWatcher ._(this ._path, this ._events, this ._recursive) {
192188 if (! isSupported) {
193- throw new FileSystemException (
189+ throw FileSystemException (
194190 "File system watching is not supported on this platform" ,
195191 _path,
196192 );
@@ -236,7 +232,7 @@ abstract class _FileSystemWatcher {
236232 return ;
237233 }
238234 if (! _idMap.containsKey (pathId)) {
239- _idMap[pathId] = new _WatcherPath (pathId, _path, _events);
235+ _idMap[pathId] = _WatcherPath (pathId, _path, _events);
240236 }
241237 _watcherPath = _idMap[pathId];
242238 _watcherPath! .count++ ;
@@ -324,9 +320,9 @@ abstract class _FileSystemWatcher {
324320
325321 void rewriteMove (event, isDir) {
326322 if (event[3 ]) {
327- add (event[4 ], new FileSystemCreateEvent (getPath (event), isDir));
323+ add (event[4 ], FileSystemCreateEvent (getPath (event), isDir));
328324 } else {
329- add (event[4 ], new FileSystemDeleteEvent (getPath (event), false ));
325+ add (event[4 ], FileSystemDeleteEvent (getPath (event), false ));
330326 }
331327 }
332328
@@ -344,13 +340,13 @@ abstract class _FileSystemWatcher {
344340 bool isDir = getIsDir (event);
345341 var path = getPath (event);
346342 if ((event[0 ] & FileSystemEvent .create) != 0 ) {
347- add (event[4 ], new FileSystemCreateEvent (path, isDir));
343+ add (event[4 ], FileSystemCreateEvent (path, isDir));
348344 }
349345 if ((event[0 ] & FileSystemEvent .modify) != 0 ) {
350- add (event[4 ], new FileSystemModifyEvent (path, isDir, true ));
346+ add (event[4 ], FileSystemModifyEvent (path, isDir, true ));
351347 }
352348 if ((event[0 ] & FileSystemEvent ._modifyAttributes) != 0 ) {
353- add (event[4 ], new FileSystemModifyEvent (path, isDir, false ));
349+ add (event[4 ], FileSystemModifyEvent (path, isDir, false ));
354350 }
355351 if ((event[0 ] & FileSystemEvent .move) != 0 ) {
356352 int link = event[1 ];
@@ -359,7 +355,7 @@ abstract class _FileSystemWatcher {
359355 if (pair[pathId].containsKey (link)) {
360356 add (
361357 event[4 ],
362- new FileSystemMoveEvent (
358+ FileSystemMoveEvent (
363359 getPath (pair[pathId][link]),
364360 isDir,
365361 path,
@@ -374,10 +370,10 @@ abstract class _FileSystemWatcher {
374370 }
375371 }
376372 if ((event[0 ] & FileSystemEvent .delete) != 0 ) {
377- add (event[4 ], new FileSystemDeleteEvent (path, false ));
373+ add (event[4 ], FileSystemDeleteEvent (path, false ));
378374 }
379375 if ((event[0 ] & FileSystemEvent ._deleteSelf) != 0 ) {
380- add (event[4 ], new FileSystemDeleteEvent (path, false ));
376+ add (event[4 ], FileSystemDeleteEvent (path, false ));
381377 // Signal done event.
382378 stops.add ([event[4 ], null ]);
383379 }
@@ -479,7 +475,7 @@ class _InotifyFileSystemWatcher extends _FileSystemWatcher {
479475 Stream <FileSystemEvent > _pathWatched () {
480476 var pathId = _watcherPath! .pathId;
481477 if (! _idMap.containsKey (pathId)) {
482- _idMap[pathId] = new StreamController <FileSystemEvent >.broadcast ();
478+ _idMap[pathId] = StreamController <FileSystemEvent >.broadcast ();
483479 }
484480 return _idMap[pathId]! .stream;
485481 }
@@ -501,7 +497,7 @@ class _Win32FileSystemWatcher extends _FileSystemWatcher {
501497
502498 Stream <FileSystemEvent > _pathWatched () {
503499 var pathId = _watcherPath! .pathId;
504- _controller = new StreamController <FileSystemEvent >();
500+ _controller = StreamController <FileSystemEvent >();
505501 _subscription = _FileSystemWatcher ._listenOnSocket (
506502 pathId,
507503 0 ,
@@ -533,7 +529,7 @@ class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
533529 Stream <FileSystemEvent > _pathWatched () {
534530 var pathId = _watcherPath! .pathId;
535531 var socketId = _FileSystemWatcher ._getSocketId (0 , pathId);
536- _controller = new StreamController <FileSystemEvent >();
532+ _controller = StreamController <FileSystemEvent >();
537533 _subscription = _FileSystemWatcher ._listenOnSocket (
538534 socketId,
539535 0 ,
@@ -556,5 +552,5 @@ class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
556552
557553@pragma ("vm:entry-point" , "call" )
558554Uint8List _makeUint8ListView (Uint8List source, int offsetInBytes, int length) {
559- return new Uint8List .view (source.buffer, offsetInBytes, length);
555+ return Uint8List .view (source.buffer, offsetInBytes, length);
560556}
0 commit comments