Skip to content
Open
Show file tree
Hide file tree
Changes from 194 commits
Commits
Show all changes
444 commits
Select commit Hold shift + click to select a range
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
3082768
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Jul 30, 2026
a639f71
TODO for cross_file example
bparrishMines Jul 30, 2026
dadac8b
update uri docs
bparrishMines Jul 30, 2026
b43a6f4
change to just getextension
bparrishMines Jul 30, 2026
d483557
change to entity as base
bparrishMines Jul 30, 2026
70c3058
dot comments encoding
bparrishMines Jul 30, 2026
faa0a1a
update name docs
bparrishMines Jul 30, 2026
063d776
name docs clarification path
bparrishMines Jul 30, 2026
4bea365
undo webview change
bparrishMines Jul 30, 2026
e8d9d37
fix dependabot location
bparrishMines Jul 30, 2026
568e468
update platform specific in platform interface
bparrishMines Jul 30, 2026
9bc0c65
fix platform specific in other packages
bparrishMines Jul 30, 2026
c398f3f
change to make extension sound optional
bparrishMines Jul 31, 2026
0db1cb4
update can read for directories
bparrishMines Jul 31, 2026
6dbe663
set to version 1.0
bparrishMines Jul 31, 2026
78ea879
extra newliine
bparrishMines Jul 31, 2026
d3ee6ef
you can find
bparrishMines Jul 31, 2026
0415b2e
update gradle for android to compile
bparrishMines Jul 31, 2026
e11124e
android compiles with new kotlin names
bparrishMines Jul 31, 2026
dcb56c5
unused imports
bparrishMines Jul 31, 2026
f5e8752
update ffigen
bparrishMines Jul 31, 2026
41f3a98
change android openRead to not use length and add argument errors
bparrishMines Aug 1, 2026
7e4cf13
change to exception for input stream
bparrishMines Aug 1, 2026
2cd672f
simplify darwing
bparrishMines Aug 1, 2026
1ebabfc
use reader for open read
bparrishMines Aug 2, 2026
5c95bc6
passing web integration tests
bparrishMines Aug 2, 2026
40dd018
move tests instructions to contributing
bparrishMines Aug 2, 2026
17aa449
cleanup android code a bit
bparrishMines Aug 2, 2026
a9326a7
typo
bparrishMines Aug 3, 2026
6a12a0f
remove file selector references
bparrishMines Aug 3, 2026
36822df
move test to cross_file_io
bparrishMines Aug 3, 2026
f12a724
add a breaking change
bparrishMines Aug 3, 2026
7dc7720
change to checking with a top level class with functions
bparrishMines Aug 3, 2026
50fc6f8
update changelog
bparrishMines Aug 3, 2026
9a41e2d
update gradle
bparrishMines Aug 3, 2026
2f0648b
remove android underscores
bparrishMines Aug 3, 2026
32cc69a
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Aug 3, 2026
3daca19
remove entity export
bparrishMines Aug 3, 2026
51c4657
change to app facing package wrapper
bparrishMines Aug 3, 2026
b388939
remove web limitations
bparrishMines Aug 5, 2026
bd3df2a
comment about size chosen
bparrishMines Aug 6, 2026
497ddba
update ffi
bparrishMines Aug 6, 2026
71ac4e0
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Aug 6, 2026
a05e328
formatting
bparrishMines Aug 6, 2026
0694a6c
add darwin contributing
bparrishMines Aug 6, 2026
74e629e
remove g
bparrishMines Aug 6, 2026
456ff27
add dispose method
bparrishMines Aug 7, 2026
5b93684
add file system impl and add test for stream errors
bparrishMines Aug 7, 2026
0e6f093
switch to range error and ensure error is sent to stream
bparrishMines Aug 7, 2026
c6ee25f
add file system to interface
bparrishMines Aug 7, 2026
f828a3b
app facing toString uses uri and change filesystem params to use path…
bparrishMines Aug 7, 2026
d33f093
update interface to handle paths
bparrishMines Aug 7, 2026
67b39aa
add path to directory as well
bparrishMines Aug 7, 2026
982e3f0
update io implementation to use file system implementation
bparrishMines Aug 7, 2026
c6c12dd
change android and ios to create an instance of io to create file system
bparrishMines Aug 7, 2026
1d884a5
add io test for android and ios
bparrishMines Aug 7, 2026
b6dee66
add file system to app facing
bparrishMines Aug 7, 2026
7e2f9a5
file system implementation in app facing
bparrishMines Aug 7, 2026
34dad20
set up file system implementation across everything
bparrishMines Aug 11, 2026
c3aeb68
accidental didn't merge
bparrishMines Aug 11, 2026
883514c
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Aug 11, 2026
f8a8204
formatting
bparrishMines Aug 11, 2026
ab90e7a
add pigeon impl to run on macos
bparrishMines Aug 11, 2026
31348b1
add tests back
bparrishMines Aug 12, 2026
cad1509
add readbytes test
bparrishMines Aug 12, 2026
247b770
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Aug 12, 2026
feff9f3
update excerpts
bparrishMines Aug 12, 2026
cf91564
update readme
bparrishMines Aug 12, 2026
8d7ff92
add breaking changes
bparrishMines Aug 13, 2026
87e5c74
unused import
bparrishMines Aug 13, 2026
71f7ab6
remove darwin tests that aren't used
bparrishMines Aug 13, 2026
1634e7d
formatting
bparrishMines Aug 13, 2026
cf58005
Merge branch 'main' of https://github.com/flutter/packages into new_c…
bparrishMines Aug 13, 2026
076e08e
unused import
bparrishMines Aug 13, 2026
3f6f303
add license to darwin ffi
bparrishMines Aug 13, 2026
ec62032
Revert "remove darwin tests that aren't used"
bparrishMines Aug 13, 2026
7966743
fix android tests
bparrishMines Aug 13, 2026
74a5fda
add cross_file_web because it uses chrome for flutter
bparrishMines Aug 13, 2026
42900f4
doc improvements
bparrishMines Aug 14, 2026
96c63ae
update readme with implementations explanation
bparrishMines Aug 14, 2026
5ed1a41
fix cross_file readme more
bparrishMines Aug 14, 2026
96784f5
add docs to platform implementation
bparrishMines Aug 14, 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 .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
Comment thread
bparrishMines marked this conversation as resolved.
Outdated
- /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
6 changes: 5 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

packages/animations/** @hannah-hyj
packages/camera/** @bparrishMines
packages/cross_file/** @stuartmorgan-g
packages/cross_file/** @bparrishMines
packages/cross_file/cross_file_io/** @bparrishMines
packages/extension_google_sign_in_as_googleapis_auth/** @stuartmorgan-g
packages/file_selector/** @stuartmorgan-g
packages/flutter_lints/** @chunhtai
Expand Down Expand Up @@ -54,6 +55,7 @@ third_party/packages/path_parsing/** @domesticmouse

# - Web
packages/camera/camera_web/** @mdebbar
packages/cross_file/cross_file_web/** @bparrishMines
packages/file_selector/file_selector_web/** @mdebbar
packages/google_maps_flutter/google_maps_flutter_web/** @mdebbar
packages/google_sign_in/google_sign_in_web/** @mdebbar
Expand All @@ -67,6 +69,7 @@ packages/webview_flutter/webview_flutter_web/** @mdebbar
# - Android
packages/camera/camera_android/** @camsim99
packages/camera/camera_android_camerax/** @camsim99
packages/cross_file/cross_file_android/** @bparrishMines
packages/espresso/** @jesswrd
packages/file_selector/file_selector_android/** @mboetger
packages/flutter_plugin_android_lifecycle/** @reidbaker
Expand All @@ -85,6 +88,7 @@ packages/webview_flutter/webview_flutter_android/** @bparrishMines

# - Darwin
packages/camera/camera_avfoundation/** @hellohuanlin @louisehsu
packages/cross_file/cross_file_darwin/** @bparrishMines
packages/file_selector/file_selector_ios/** @okorohelijah @vashworth
packages/file_selector/file_selector_macos/** @okorohelijah @vashworth
packages/google_maps_flutter/google_maps_flutter_ios/** @vashworth @LongCatIsLooong
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,3 +1,7 @@
## 0.4.0

* Updates `cross_file` to a package separated federated plugin.
Comment thread
bparrishMines marked this conversation as resolved.
Outdated

## 0.3.5+2

* Separates "Save As" implementation details from XFile web class.
Expand Down
File renamed without changes.
101 changes: 101 additions & 0 deletions packages/cross_file/cross_file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 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`
Comment thread
bparrishMines marked this conversation as resolved.
Outdated
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.canRead()) {
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).
Comment thread
bparrishMines marked this conversation as resolved.
Outdated

### 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 setting additional iOS/macOS and Android parameters on a `XFile`.

<?code-excerpt "readme_excerpts.dart (platform_features)"?>
```dart
var params = const PlatformXFileCreationParams(uri: 'my/file.txt');

if (CrossFilePlatform.instance is CrossFileWeb) {
params = WebXFileCreationParams.fromObjectUrl(
objectUrl: 'blob:https://some/url:for/file',
);
}

final file = XFile.fromCreationParams(params);

await file
.maybeGetExtension<DarwinXFileExtension>()
?.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.
9 changes: 9 additions & 0 deletions packages/cross_file/cross_file/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Platform Implementation Test App

This is a test app for manual testing and automated integration testing
of this platform implementation. It is not intended to demonstrate actual use of
this package, since the intent is that plugin clients use the app-facing
package.
Comment thread
bparrishMines marked this conversation as resolved.
Outdated

Unless you are making changes to this implementation package, this example is
very unlikely to be relevant.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
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 {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "dev.flutter.packages.cross_file_example"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
}
}
}

flutter {
source = "../.."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<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"/>
</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,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,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>
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:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Loading
Loading