-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[image_picker_macos] macOS native image picker #8079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
EchoEllet
wants to merge
18
commits into
flutter:main
from
EchoEllet:feat/phpicker-image-picker-macos
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1d8ec6c
chore(example): update outdated macOS example using Flutter build mac…
EchoEllet 6ba3c14
feat(image_picker_macos): add support for native macOS image picker
EchoEllet c98699f
chore: generate pigeons and mocks with the latest dev dependencies
EchoEllet f420c91
chore: format Swift generated file Messages.g.swift
EchoEllet 3f49936
chore: restore backticks of file_selector link
EchoEllet 31c4f55
chore: update supported macOS version from 10.11 to 10.14 for image_p…
EchoEllet abd926c
chore: use getVideo() instead of the soft-deprecated pickVideo() in u…
EchoEllet 75badd9
chore: update outdated TODOs as they moved to https://github.com/flut…
EchoEllet 200cb10
test: add minor test for pickVideo
EchoEllet d1bee0a
chore: run dart format for Dart generated files
EchoEllet 30fd055
chore: 'try' precede 'await' in ImagePickerImpl.swift
EchoEllet 5edff64
chore: hardcode the supportsPHPicker() name to fix CI warnings
EchoEllet 0aaf366
chore: remove @visibleForTesting from supportsPHPicker
EchoEllet 527ac48
chore: remove unnecessary assertions from NSImage.compressed
EchoEllet b10b41f
refactor: require quality as not nil in shouldCompressImage to avoid …
EchoEllet 0caa390
chore: remove unnecessary assertion from imageFileExt
EchoEllet b6582fe
chore: extract duplicated createTestImage from ImageCompressTests and…
EchoEllet c531757
feat: improve error handling, avoid hardcoding string error codes, us…
EchoEllet 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
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
46 changes: 46 additions & 0 deletions
46
packages/image_picker/image_picker_macos/example/integration_test/image_picker_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,46 @@ | ||
// 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:example/main.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:image_picker_macos/image_picker_macos.dart'; | ||
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
ImagePickerMacOS get requireMacOSImplementation { | ||
final ImagePickerPlatform imagePickerImplementation = | ||
ImagePickerPlatform.instance; | ||
if (imagePickerImplementation is! ImagePickerMacOS) { | ||
fail('Expected the implementation to be $ImagePickerMacOS'); | ||
} | ||
return imagePickerImplementation; | ||
} | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
group('example', () { | ||
testWidgets( | ||
'Pressing the PHPicker toggle button updates it correctly', | ||
(WidgetTester tester) async { | ||
final ImagePickerMacOS imagePickerImplementation = | ||
requireMacOSImplementation; | ||
expect(imagePickerImplementation.useMacOSPHPicker, false, | ||
reason: 'The default is to not using PHPicker'); | ||
|
||
await tester.pumpWidget(const MyApp()); | ||
final Finder togglePHPickerFinder = | ||
find.byTooltip('toggle macOS PHPPicker'); | ||
expect(togglePHPickerFinder, findsOneWidget); | ||
|
||
await tester.tap(togglePHPickerFinder); | ||
expect(imagePickerImplementation.useMacOSPHPicker, true, | ||
reason: 'Pressing the toggle button should update it correctly'); | ||
|
||
await tester.tap(togglePHPickerFinder); | ||
expect(imagePickerImplementation.useMacOSPHPicker, false, | ||
reason: 'Pressing the toggle button should update it correctly'); | ||
}, | ||
); | ||
}); | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.