This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker_for_web] Migrate image_picker to package:cross_file #4083
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4b3c599
Migrate image picker platform interface to cross_file
BeMacized f4fbd0c
[image_picker_for_web] Migration to cross_file
BeMacized 2de19b4
Merge branch 'master' into issue/70886
BeMacized 86f604b
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized 68e2ef8
Re-added old methods and marked them as deprecated.
BeMacized d345b37
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized a0ab00e
Update to match platform interface changes
BeMacized a987170
Format & annotate deprecated classes.
BeMacized 6ab2bb0
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized 3fa10b9
Updated pubspec and changelog.
BeMacized c1ff8b2
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized addfe99
Updated platform interface dependency version
BeMacized aefff73
Updated changelog and pubspec version
BeMacized 2c4cd91
Fix analysis issues for deprecations
BeMacized 69969b2
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized 29e0c40
Remove Deprecation tags so we don't break consumers of this package o…
ditman c74cebb
Merge branch 'master' into issue/70886
ditman 0a082c8
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized 4615db1
Temporary platform interface reference dependency
BeMacized faa1a99
Implement PR feedback
BeMacized afa61ab
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized e297f3f
Merge branch 'master' into issue/70886-impl-web
ditman 60c2ffd
Depend on the published version of the platform interface
ditman 5e7abfd
Remove Deprecated methods, so consumers don't break immediately.
ditman de50d56
Port tests from --platform=chrome to integration_test
ditman b01daeb
dart format
ditman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
# Testing | ||
|
||
This package uses `package:integration_test` to run its tests in a web browser. | ||
|
||
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests) | ||
in the Flutter wiki for instructions to setup and run the tests in this package. | ||
|
||
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) | ||
for more info. |
This file contains hidden or 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
25 changes: 25 additions & 0 deletions
25
packages/image_picker/image_picker_for_web/example/lib/main.dart
This file contains hidden or 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 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
void main() { | ||
runApp(MyApp()); | ||
} | ||
|
||
/// App for testing | ||
class MyApp extends StatefulWidget { | ||
@override | ||
_MyAppState createState() => _MyAppState(); | ||
} | ||
|
||
class _MyAppState extends State<MyApp> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Directionality( | ||
textDirection: TextDirection.ltr, | ||
child: Text('Testing... Look at the console output for results!'), | ||
); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/image_picker/image_picker_for_web/example/pubspec.yaml
This file contains hidden or 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,21 @@ | ||
name: connectivity_for_web_integration_tests | ||
publish_to: none | ||
|
||
environment: | ||
sdk: ">=2.12.0 <3.0.0" | ||
flutter: ">=2.2.0" | ||
|
||
dependencies: | ||
image_picker_for_web: | ||
path: ../ | ||
flutter: | ||
sdk: flutter | ||
|
||
dev_dependencies: | ||
js: ^0.6.3 | ||
flutter_test: | ||
sdk: flutter | ||
flutter_driver: | ||
sdk: flutter | ||
integration_test: | ||
sdk: flutter |
22 changes: 22 additions & 0 deletions
22
packages/image_picker/image_picker_for_web/example/run_test.sh
This file contains hidden or 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,22 @@ | ||
#!/usr/bin/bash | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
if pgrep -lf chromedriver > /dev/null; then | ||
echo "chromedriver is running." | ||
|
||
if [ $# -eq 0 ]; then | ||
echo "No target specified, running all tests..." | ||
find integration_test/ -iname *_test.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --driver=test_driver/integration_test.dart --target='{}' | ||
else | ||
echo "Running test target: $1..." | ||
set -x | ||
flutter drive -d web-server --web-port=7357 --browser-name=chrome --driver=test_driver/integration_test.dart --target=$1 | ||
fi | ||
|
||
else | ||
echo "chromedriver is not running." | ||
echo "Please, check the README.md for instructions on how to use run_test.sh" | ||
fi | ||
|
7 changes: 7 additions & 0 deletions
7
packages/image_picker/image_picker_for_web/example/test_driver/integration_test.dart
This file contains hidden or 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,7 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:integration_test/integration_test_driver.dart'; | ||
|
||
Future<void> main() => integrationDriver(); |
13 changes: 13 additions & 0 deletions
13
packages/image_picker/image_picker_for_web/example/web/index.html
This file contains hidden or 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 @@ | ||
<!DOCTYPE html> | ||
<!-- Copyright 2013 The Flutter Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. --> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>example</title> | ||
</head> | ||
<body> | ||
<script src="main.dart.js" type="application/javascript"></script> | ||
</body> | ||
</html> |
This file contains hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
## test | ||
|
||
This package uses integration tests for testing. | ||
|
||
See `example/README.md` for more info. |
14 changes: 14 additions & 0 deletions
14
packages/image_picker/image_picker_for_web/test/tests_exist_elsewhere_test.dart
This file contains hidden or 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,14 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
test('Tell the user where to find the real tests', () { | ||
print('---'); | ||
print('This package uses integration_test for its tests.'); | ||
print('See `example/README.md` for more info.'); | ||
print('---'); | ||
}); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's extract the name on disk of the file from this
event
so we can initialize the XFile with it! (to fix flutter/flutter#58764)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an example of it here: https://github.com/flutter/plugins/blob/master/packages/file_selector/file_selector_web/lib/src/dom_helper.dart#L59-L66