forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support browser contexts in package:file (flutter#18)
This change uses conditional imports to support browser-based Dart usage of this package. For non-VM users, this will export the subset of the dart:io interface that is required by this package, whereas VM users will simply get dart:io itself.
- Loading branch information
Showing
17 changed files
with
370 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
analyzer: | ||
strong-mode: true | ||
enableConditionalDirectives: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
export 'src/interface/directory.dart'; | ||
export 'src/interface/file_system_entity.dart'; | ||
export 'src/interface/file_system.dart'; | ||
export 'src/interface/file.dart'; | ||
export 'src/interface/link.dart'; | ||
export 'src/interface.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
library file.src.interface; | ||
|
||
import 'dart:async'; | ||
|
||
import 'io.dart' as io; | ||
|
||
export 'io.dart'; | ||
|
||
part 'interface/directory.dart'; | ||
part 'interface/file.dart'; | ||
part 'interface/file_system.dart'; | ||
part 'interface/file_system_entity.dart'; | ||
part 'interface/link.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import 'dart:io' as io; | ||
|
||
import 'file_system_entity.dart'; | ||
part of file.src.interface; | ||
|
||
/// A reference to a directory on the file system. | ||
abstract class Directory implements FileSystemEntity, io.Directory {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import 'dart:io' as io; | ||
|
||
import 'file_system_entity.dart'; | ||
part of file.src.interface; | ||
|
||
/// A reference to a file on the file system. | ||
abstract class File implements FileSystemEntity, io.File {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import 'dart:io' as io; | ||
|
||
import 'file_system_entity.dart'; | ||
part of file.src.interface; | ||
|
||
/// A reference to a symbolic link on the file system. | ||
abstract class Link implements FileSystemEntity, io.Link {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// For internal use only! | ||
/// | ||
/// This exposes the subset of the `dart:io` interfaces that are required by | ||
/// the `file` package. The `file` package re-exports these interfaces (or in | ||
/// some cases, implementations of these interfaces by the same name), so this | ||
/// file need not be exposes publicly and exists for internal use only. | ||
/// | ||
/// For VM users, this exports the actual `dart:io` interfaces; for browser | ||
/// contexts, this exports locally-defined versions of those same interfaces. | ||
export 'io/interface.dart' if (dart.library.io) 'dart:io' | ||
show | ||
Directory, | ||
File, | ||
FileLock, | ||
FileMode, | ||
FileStat, | ||
FileSystemEntity, | ||
FileSystemEntityType, | ||
FileSystemEvent, | ||
FileSystemException, | ||
IOException, | ||
IOSink, | ||
Link, | ||
OSError, | ||
RandomAccessFile; |
Oops, something went wrong.