Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
362 commits
Select commit Hold shift + click to select a range
dd280a2
export extensions and add exception docs
bparrishMines Jan 21, 2026
0373d5e
half of file tests
bparrishMines Jan 21, 2026
38eb1d9
dart unit tests for file
bparrishMines Jan 21, 2026
51a74e2
directory tests
bparrishMines Jan 21, 2026
97f60a6
add stuff and stuff
bparrishMines Jan 23, 2026
bfb9e0a
cross file impl
bparrishMines Jan 26, 2026
ae1aaf3
add context for android example
bparrishMines Jan 26, 2026
aac47fe
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jan 26, 2026
e419342
update to new impl
bparrishMines Jan 28, 2026
295ea46
generally rewrite readme
bparrishMines Jan 28, 2026
39d4bbc
default implementations for cross file implementations
bparrishMines Jan 28, 2026
fa7f420
add tests for default impl
bparrishMines Jan 28, 2026
b88d137
update docs
bparrishMines Jan 28, 2026
e57c8bb
add base test files
bparrishMines Jan 28, 2026
cf7239e
fix platform implementations
bparrishMines Jan 28, 2026
4201466
directory tests
bparrishMines Jan 30, 2026
16c61f7
scoped storage tests
bparrishMines Jan 30, 2026
4ae04b7
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 5, 2026
da418ab
update replace
bparrishMines Feb 5, 2026
55c6078
remove unused path dep
bparrishMines Feb 5, 2026
410451f
flutter create init
bparrishMines Feb 5, 2026
d4bb9c8
add txt file
bparrishMines Feb 5, 2026
224ac8c
update pubspec but no work
bparrishMines Feb 5, 2026
f91cc32
update to github dependencies
bparrishMines Feb 6, 2026
3420f3d
example version solved
bparrishMines Feb 6, 2026
e825b1a
delet e cross_file_ios
bparrishMines Feb 6, 2026
5a773b1
compiling code
bparrishMines Feb 6, 2026
abb58f2
undo file_selector changes
bparrishMines Feb 6, 2026
1fe476d
fix failing unit tests
bparrishMines Feb 6, 2026
3179eae
some lints
bparrishMines Feb 7, 2026
d447ee9
update android fix maybe
bparrishMines Feb 7, 2026
81597b3
remove old imports
bparrishMines Feb 7, 2026
60edb0d
remove unsued classes
bparrishMines Feb 7, 2026
4ebe1ef
fix example app on android
bparrishMines Feb 7, 2026
a211972
update references to test files
bparrishMines Feb 8, 2026
63d018a
update example app on darwin
bparrishMines Feb 8, 2026
d226f93
update android example app
bparrishMines Feb 8, 2026
4a8e246
try fix tests
bparrishMines Feb 8, 2026
1aa3ec6
fix inputstream test
bparrishMines Feb 8, 2026
92cc9b3
open directory example
bparrishMines Feb 10, 2026
a0aeddb
also works on ios
bparrishMines Feb 10, 2026
1e47058
update example app for main plugin
bparrishMines Feb 10, 2026
e571580
update for macos
bparrishMines Feb 10, 2026
644279b
macos runs
bparrishMines Feb 10, 2026
94c3858
compiles on ios
bparrishMines Feb 10, 2026
4841e6b
export io impl
bparrishMines Feb 10, 2026
1aee6e3
update cross file to ask for start of scoped resource
bparrishMines Feb 10, 2026
bbbc10f
export new files
bparrishMines Feb 10, 2026
9029901
fix code gen
bparrishMines Feb 11, 2026
303c0c5
also sho length
bparrishMines Feb 11, 2026
7e48889
keep bookmarking uris
bparrishMines Feb 11, 2026
b1f38e8
update unit tests
bparrishMines Feb 11, 2026
c1ddce9
start of swift tests maybe
bparrishMines Feb 11, 2026
d974867
create some semblance of unit tests
bparrishMines Feb 12, 2026
88c1c8f
bookmark doesn't call access
bparrishMines Feb 12, 2026
712ae02
ios and macos tests
bparrishMines Feb 12, 2026
f7a242e
darwin usese uri and not file path
bparrishMines Feb 12, 2026
55aa297
update tests
bparrishMines Feb 12, 2026
aac1e0a
update io and platform interface for uri
bparrishMines Feb 12, 2026
4610e83
update web impl
bparrishMines Feb 12, 2026
9be385c
update cross file dep
bparrishMines Feb 12, 2026
1402e67
add filename
bparrishMines Feb 12, 2026
551f04b
update web with factories
bparrishMines Feb 12, 2026
e013d14
add convenient method for xfile
bparrishMines Feb 12, 2026
c935c98
update example docs
bparrishMines Feb 12, 2026
54177e3
update cross_file
bparrishMines Feb 12, 2026
d2b4422
ios and macos run
bparrishMines Feb 12, 2026
87d2fe4
remove print
bparrishMines Feb 12, 2026
3b52614
fix darwin unit tests
bparrishMines Feb 12, 2026
7df932b
fix test running code
bparrishMines Feb 12, 2026
7f90065
remove old cross file
bparrishMines Feb 12, 2026
569cf17
format swift code
bparrishMines Feb 12, 2026
d9095fb
fix docs
bparrishMines Feb 12, 2026
831561b
format linux code
bparrishMines Feb 12, 2026
74d5d04
remove runner tests for darwin in cross_file
bparrishMines Feb 12, 2026
4352bc6
fix licenses
bparrishMines Feb 12, 2026
9bf79ca
add self as topic
bparrishMines Feb 12, 2026
27fcc87
missing web import, supported platform table
bparrishMines Feb 12, 2026
6a2c35e
add self as codeowner
bparrishMines Feb 12, 2026
2d501a2
update dependabot
bparrishMines Feb 12, 2026
7f40e97
fix project validations
bparrishMines Feb 13, 2026
30b062a
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 13, 2026
e2d0f15
change to scoped storage for darwin
bparrishMines Feb 13, 2026
7b34f3d
formatting and fix excerpts
bparrishMines Feb 13, 2026
52fbbaa
fix readme and add convenience method to scopedstorage files
bparrishMines Feb 13, 2026
4c15493
add more info on scoped storage
bparrishMines Feb 13, 2026
3075896
add darwin tests
bparrishMines Feb 17, 2026
4b0b3e4
update gradle and change to publish_to
bparrishMines Feb 17, 2026
6b721eb
add integration test harness
bparrishMines Feb 17, 2026
789ef71
change web to publish to none
bparrishMines Feb 17, 2026
1b24e78
fix web for wasm
bparrishMines Feb 17, 2026
1d1e949
formatting
bparrishMines Feb 17, 2026
b623ad4
change settings file to groovy
bparrishMines Feb 17, 2026
f420e80
publish too
bparrishMines Feb 17, 2026
6415ea6
add new files
bparrishMines Feb 17, 2026
00a9f10
add example app
bparrishMines Feb 17, 2026
5fc9cd5
update project gradles
bparrishMines Feb 17, 2026
79a98cb
add dart integration test file
bparrishMines Feb 17, 2026
fe48304
improve pubspecs and add test drivers
bparrishMines Feb 17, 2026
8a5d3cc
fix darwin tests
bparrishMines Feb 17, 2026
a234ecd
update interface
bparrishMines Feb 17, 2026
9765b61
web update
bparrishMines Feb 17, 2026
54d0668
update darwin
bparrishMines Feb 17, 2026
b276f77
update android
bparrishMines Feb 17, 2026
9eeb9ed
update io
bparrishMines Feb 17, 2026
ac3dcf0
update cross_file
bparrishMines Feb 17, 2026
ae1f8e0
format and excerpts
bparrishMines Feb 17, 2026
409a17d
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 17, 2026
bae2e4d
fix darwin tests
bparrishMines Feb 17, 2026
6ec9c3f
update darwin and io to maybe run on windows
bparrishMines Feb 17, 2026
15f311e
add convenience method for cross_File
bparrishMines Feb 17, 2026
b4799e8
remove android integration endpoint
bparrishMines Feb 17, 2026
a04ebd4
update baseline
bparrishMines Feb 17, 2026
920bb31
delete old test
bparrishMines Feb 17, 2026
11efbdc
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 17, 2026
f19b74e
remove can read from xfile
bparrishMines Feb 17, 2026
f01d4bd
remove old pubspec and example
bparrishMines Feb 17, 2026
9ca64a7
remove runner tests
bparrishMines Feb 17, 2026
bd73776
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 18, 2026
b70935c
remove bookmark uri logic
bparrishMines Feb 18, 2026
a0c2fd4
add config
bparrishMines Feb 25, 2026
c37af83
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Feb 25, 2026
e4d1d26
try global
bparrishMines Feb 25, 2026
28b1679
missing apostrophe
bparrishMines Feb 27, 2026
d845bcb
update platform xdirectory
bparrishMines Mar 2, 2026
a6f8336
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Mar 2, 2026
c58f31b
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 1, 2026
7ecfd3a
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 21, 2026
574eb1a
update gradles to kotlins
bparrishMines Apr 21, 2026
a0169fb
add a test
bparrishMines Apr 21, 2026
340c462
remove generated files
bparrishMines Apr 21, 2026
a1a621c
remove generated files
bparrishMines Apr 21, 2026
7c2ad19
update project
bparrishMines Apr 21, 2026
b3ebbf5
remove ref
bparrishMines Apr 21, 2026
bb8b149
remove pods
bparrishMines Apr 21, 2026
48bd7e0
remove runnertests refernces
bparrishMines Apr 21, 2026
ef0b7fc
add a is current implementation
bparrishMines Apr 21, 2026
4104693
update exerpts
bparrishMines Apr 21, 2026
b4a47f4
change to use maybe get extension
bparrishMines Apr 21, 2026
58678a4
add comment
bparrishMines Apr 21, 2026
784192d
use internal to hide platform use
bparrishMines Apr 21, 2026
8ac420c
typo an extra can read test
bparrishMines Apr 21, 2026
170f6b0
todo and version setting
bparrishMines Apr 21, 2026
7fee973
change version of platform interface
bparrishMines Apr 21, 2026
7390bfc
Pr feedback
bparrishMines Apr 21, 2026
3cf62e9
authors
bparrishMines Apr 21, 2026
08707df
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 21, 2026
3f2f880
call stop automatically with finalizer
bparrishMines Apr 21, 2026
f9ba45a
change all to platformxentity and xentity
bparrishMines Apr 21, 2026
761fba6
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 21, 2026
4a49a21
formatting
bparrishMines Apr 21, 2026
30210f1
sort exports
bparrishMines Apr 21, 2026
0115b47
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 21, 2026
a388a69
add xcconfig back
bparrishMines Apr 22, 2026
a6af73c
add missing xcconfigs
bparrishMines Apr 22, 2026
c93bb93
add finalizer to ios directory
bparrishMines Apr 22, 2026
8fecd6a
fix test
bparrishMines Apr 22, 2026
15707ad
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 22, 2026
531dc5c
remove dupe canread test
bparrishMines Apr 22, 2026
194a323
add dart test yaml
bparrishMines Apr 22, 2026
1a54c91
add comment
bparrishMines Apr 22, 2026
5033f3f
add canread to scopedstoragecrossdirectory
bparrishMines Apr 23, 2026
fb21706
remove config file
bparrishMines Apr 23, 2026
ff2d369
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Apr 30, 2026
a3994c1
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines May 5, 2026
939a1c0
make classes base
bparrishMines May 5, 2026
c62eb16
fix class name refs
bparrishMines May 5, 2026
bc28494
add photokit scaffolding in dart
bparrishMines May 6, 2026
ef08bac
darwin api stuffc
bparrishMines May 7, 2026
4c34286
partial impl for darwin
bparrishMines May 7, 2026
afe1231
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines May 27, 2026
df66b02
update pubspec sdk versions
bparrishMines May 27, 2026
c1c066f
update darwin xfile docs
bparrishMines May 29, 2026
3d9f91e
update directory to be similar to file
bparrishMines May 29, 2026
a408ce9
add ffi to pubspec
bparrishMines May 29, 2026
71f72fe
update for ffigen
bparrishMines Jun 2, 2026
77a0132
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 2, 2026
01e5d97
fix compilation
bparrishMines Jun 2, 2026
4f9feb1
fix example
bparrishMines Jun 2, 2026
32c511a
remove api and use ffi
bparrishMines Jun 2, 2026
dbee630
add phasset
bparrishMines Jun 2, 2026
9eae34c
add most api
bparrishMines Jun 2, 2026
04621c3
finish adding bindingS
bparrishMines Jun 2, 2026
eab82fc
add dynamic library
bparrishMines Jun 2, 2026
d43a862
wire up most of it
bparrishMines Jun 2, 2026
dfe9ecc
move where the data is passed to main thread
bparrishMines Jun 2, 2026
77c9cf8
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 2, 2026
abb39e2
fix library name maybe
bparrishMines Jun 2, 2026
183844d
support objc
bparrishMines Jun 2, 2026
38b2753
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 3, 2026
b36b01a
formatting and maybe implement length
bparrishMines Jun 4, 2026
d088cae
try reading from address
bparrishMines Jun 4, 2026
f9edbcd
try unsigned long
bparrishMines Jun 4, 2026
eaed7c4
add prints
bparrishMines Jun 4, 2026
dfb7ee5
try long again
bparrishMines Jun 4, 2026
ba16dfc
try ot use nsnumber
bparrishMines Jun 4, 2026
83ae934
use nsnumber
bparrishMines Jun 4, 2026
148953a
i think working algo
bparrishMines Jun 5, 2026
c4e8634
prints
bparrishMines Jun 5, 2026
4a65aa9
add some prints
bparrishMines Jun 8, 2026
e6c3e59
look at other resources
bparrishMines Jun 8, 2026
f313769
better prints
bparrishMines Jun 8, 2026
99016fe
add contentType
bparrishMines Jun 8, 2026
eaede7b
print extractor
bparrishMines Jun 8, 2026
2ebe107
print length
bparrishMines Jun 8, 2026
c22d4bc
something something
bparrishMines Jun 8, 2026
4492f9c
something something
bparrishMines Jun 8, 2026
c1fddbb
something something
bparrishMines Jun 8, 2026
dc66e88
something something
bparrishMines Jun 9, 2026
10cdaa6
something something
bparrishMines Jun 9, 2026
7544671
something something
bparrishMines Jun 9, 2026
b38c571
something something
bparrishMines Jun 9, 2026
431cf87
start of chaning open read to proxyapi
bparrishMines Jun 12, 2026
eb28858
proxy api for byte reading
bparrishMines Jun 15, 2026
6ac49c5
return true actually
bparrishMines Jun 15, 2026
2c0293d
docs and names
bparrishMines Jun 15, 2026
712bcf3
todo
bparrishMines Jun 15, 2026
b72833a
start initial test creation
bparrishMines Jun 15, 2026
f99d7ed
start writing tests
bparrishMines Jun 15, 2026
b57339c
passing test
bparrishMines Jun 15, 2026
f52b220
initial stress test
bparrishMines Jun 15, 2026
ae5434c
add tests back
bparrishMines Jun 17, 2026
42e67e6
impl tests
bparrishMines Jun 17, 2026
55eeb13
add macos tests
bparrishMines Jun 17, 2026
89e5428
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 17, 2026
8e76180
formatting and no import
bparrishMines Jun 17, 2026
4dd921b
excerpts and analyze
bparrishMines Jun 17, 2026
b63030a
analyze errors
bparrishMines Jun 17, 2026
6613d68
license
bparrishMines Jun 17, 2026
6a68362
use --platform
bparrishMines Jun 17, 2026
aa6e666
dash
bparrishMines Jun 17, 2026
5c26447
add darwin dep
bparrishMines Jun 17, 2026
6c5f597
remove configs
bparrishMines Jun 17, 2026
eba22d5
fix license
bparrishMines Jun 17, 2026
77a6224
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 17, 2026
43b9fb0
fix web test requiring SIGKILL
bparrishMines Jun 18, 2026
0f3283c
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 22, 2026
49ae634
update to use ffigen
bparrishMines Jun 23, 2026
a2d34bd
use ffigen
bparrishMines Jun 23, 2026
a7de454
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 23, 2026
8517b1b
add flutter deps
bparrishMines Jun 23, 2026
44e0676
add dart test yaml
bparrishMines Jun 23, 2026
356487a
rename to actual file name
bparrishMines Jun 23, 2026
1b2f361
delete
bparrishMines Jun 23, 2026
50cffbe
fix integration test macos
bparrishMines Jun 23, 2026
ace90a2
remove chrome requirement
bparrishMines Jun 23, 2026
a0a4c85
move tests to integration tests
bparrishMines Jun 23, 2026
44d1df6
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 23, 2026
d37cb36
add test for range filter
bparrishMines Jun 24, 2026
1627c9f
Merge branch 'main' of github.com:flutter/packages into new_crossfile
bparrishMines Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .ci/scripts/prepare_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set -e
git fetch origin main
git branch main origin/main

# Enables long paths to work on Windows.
git config --global core.longpaths true

cd script/tool
dart pub get

Expand Down
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ updates:
- /packages/camera/camera_android/example/android/app
- /packages/camera/camera_android_camerax/example/android/app
- /packages/camera/camera/example/android/app
- /packages/cross_file/cross_file/example/android/app
- /packages/cross_file/cross_file_android/android

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be down in the section starting at line 85.

- /packages/cross_file/cross_file_android/example/android/app
- /packages/espresso/example/android/app
- /packages/extension_google_sign_in_as_googleapis_auth/example/android/app
- /packages/file_selector/file_selector/example/android/app
Expand Down
63 changes: 0 additions & 63 deletions packages/cross_file/README.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.4.0

* Updates `cross_file` to a package-separated federated plugin.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also need to cover the breaking API changes.

* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

## 0.3.5+2
Expand Down
File renamed without changes.
110 changes: 110 additions & 0 deletions packages/cross_file/cross_file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# cross_file

An abstraction to allow working with files across multiple platforms.

<?code-excerpt path-base="example/lib"?>

[![pub package](https://img.shields.io/pub/v/cross_file.svg)](https://pub.dartlang.org/packages/cross_file)

A Flutter plugin that manages files and interactions with file dialogs.

| | Android | iOS | Linux | macOS | Web | Windows |
|-------------|---------|---------|-------|--------|-----|-------------|
| **Support** | SDK 24+ | iOS 13+ | Any | 10.15+ | Any | Windows 10+ |

## Usage

Import `package:cross_file/cross_file.dart`, instantiate a `XFile`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been scrubbing "import" instructions out of READMEs since it's basic to all packages, and covered on pub.dev already.

using a path or byte array and use its methods and properties to
access the file and its metadata.

Example:

<?code-excerpt "readme_excerpts.dart (Instantiate)"?>
```dart
final file = XFile.fromUri(Uri.file('assets/hello.txt'));

debugPrint('File information:');
debugPrint('- URI: ${file.uri}');
debugPrint('- Name: ${await file.name()}');

if (await file.exists()) {
final String fileContent = await file.readAsString();
debugPrint('Content of the file: $fileContent');
}
```

You will find links to the API docs on the [pub page](https://pub.dev/packages/cross_file).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You can find


### Implementation-Specific Features

Classes in this package contain an underlying platform implementation that provides features that
are specific to an implementation.

To access implementation-specific features, start by adding the platform implementation packages to
your app or package:

* **dart:io** [cross_file_io](https://pub.dev/packages/cross_file_io/install)
* **Android Scoped Storage**: [cross_file_android](https://pub.dev/packages/cross_file_android/install)
* **iOS/macOS App Sandbox**: [cross_file_darwin](https://pub.dev/packages/cross_file_darwin/install)
* **Web**: [cross_file_web](https://pub.dev/packages/cross_file_web/install)

Next, add the imports of the implementation packages to your app or package:

<?code-excerpt "readme_excerpts.dart (platform_imports)"?>
```dart
// Import for Darwin App Sandbox features.
import 'package:cross_file_darwin/cross_file_darwin.dart';
// Import for Web features.
import 'package:cross_file_web/cross_file_web.dart';
```

Now, additional features can be accessed through the platform implementations. Classes
[XFile], [XDirectory], [ScopedStorageXFile], and [ScopedStorageXDirectory] pass their
functionality to a class provided by the current platform. Below are a couple of ways to access
additional functionality provided by the platform and is followed by an example.

1. Pass a creation params class provided by a platform implementation to a `fromCreationParams`
constructor (e.g. `XFile.fromCreationParams`, `XDirectory.fromCreationParams`, etc.).
2. Call methods on an implementation of a class by using `getExtension`/`maybeGetExtension` methods (e.g.
`XFile.getExtension`, `XDirectory.maybeGetExtension`, etc.).

Below is an example of using additional iOS/macOS and Web features for a `XFile`.

<?code-excerpt "readme_excerpts.dart (platform_features)"?>
```dart
late final XFile file;

if (CrossFileWeb.isCurrentImplementation()) {
final params = WebScopedStorageXFileCreationParams.fromObjectUrl(
objectUrl: 'blob:https://some/url:for/file',
);
file = XFile.fromCreationParams(params);
} else if (CrossFileDarwin.isCurrentImplementation()) {
file = ScopedStorageXFile.fromUri(Uri.file('/my/file.txt'));
} else {
file = XFile.fromUri(Uri.file('/my/file.txt'));
}

await file
.maybeGetExtension<SecurityScopedDarwinScopedStorageXFileExtension>()
?.startAccessingSecurityScopedResource();

debugPrint(await file.readAsString());

await file
.maybeGetExtension<SecurityScopedDarwinScopedStorageXFileExtension>()
?.stopAccessingSecurityScopedResource();
```

See https://pub.dev/documentation/cross_file_darwin/latest/cross_file_darwin/cross_file_darwin-library.html
for more details on iOS/macOS App Sandbox features.

See https://pub.dev/documentation/cross_file_android/latest/cross_file_android/cross_file_android-library.html
for more details on Android Scoped Storage features.

See https://pub.dev/documentation/cross_file_io/latest/cross_file_io/cross_file_io-library.html
for more details on `dart:io` features.

See https://pub.dev/documentation/cross_file_web/latest/cross_file_web/cross_file_web-library.html
for more details on Web features.
3 changes: 3 additions & 0 deletions packages/cross_file/cross_file/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cross_file_example

Demonstrates how to use the cross_file plugin.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin")
}

android {
namespace = "dev.flutter.packages.cross_file_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

defaultConfig {
applicationId = "dev.flutter.packages.cross_file_example"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
}
}
lint {
disable.add("InvalidPackage")
}
}

flutter {
source = "../.."
}

dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:runner:1.2.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
api("androidx.test:core:1.4.0")
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package dev.flutter.packages.cross_file_example

import androidx.test.rule.ActivityTestRule
import dev.flutter.plugins.integration_test.FlutterTestRunner
import io.flutter.plugins.DartIntegrationTest
import org.junit.Rule
import org.junit.runner.RunWith

@DartIntegrationTest
@RunWith(FlutterTestRunner::class)
class MainActivityTest {
@JvmField @Rule var rule = ActivityTestRule(MainActivity::class.java)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:usesCleartextTraffic="true">
<activity
android:name="dev.flutter.packages.cross_file_example.DriverExtensionActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.Entrypoint"
android:value="integrationTestMain" />
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="cross_file_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package dev.flutter.packages.cross_file_example

import io.flutter.embedding.android.FlutterActivity

/** Test Activity that sets the name of the Dart method entrypoint in the manifest. */
class DriverExtensionActivity : FlutterActivity()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package dev.flutter.packages.cross_file_example

import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins

/*
* Annotation to aid repository tooling in determining if a test is
* a native java unit test or a java class with a dart integration.
*
* See: https://github.com/flutter/flutter/blob/master/docs/ecosystem/testing/Plugin-Tests.md#enabling-android-ui-tests
* for more information.
*/
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
annotation class DartIntegrationTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Loading
Loading