flutter / samples

A collection of Flutter examples and demos
https://flutter.github.io/samples/
Other
17.19k stars 7.51k forks source link

desktop_photo_search does not build on the latest beta #788

Closed pepijndevos closed 2 years ago

pepijndevos commented 3 years ago

I started looking into flutter today for a desktop/web app. Since desktop is still in beta, I installed the beta channel. Then, following https://flutter.dev/desktop#samples-and-codelabs , found this example of a desktop app in flutter.

The first thing I noticed while looking at the dependencies is that file_chooser has been moved to file_selector, so that's already showing it's outdated.

When I open the project in VS Code it asks met to get the missing/outdated packages, which outputs the following

[desktop_photo_search] flutter pub get
Running "flutter pub get" in desktop_photo_search...            
The current Dart SDK version is 2.13.0-211.13.beta.

Because test >=1.16.6 depends on webkit_inspection_protocol ^1.0.0 which depends on logging ^1.0.0, test >=1.16.6 requires logging ^1.0.0.

And because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.12.0 <1.16.0-nullsafety depends on http ^0.12.0, test >=1.12.0 <1.16.0-nullsafety or >=1.16.0-nullsafety.19 requires logging ^1.0.0 or test_api 0.2.19 or http ^0.12.0.
And because test >=1.16.0-nullsafety.18 <1.16.0-nullsafety.19 depends on test_api 0.2.19-nullsafety.7 and test >=1.16.0-nullsafety <1.16.0-nullsafety.8 requires SDK version >=2.10.0-0 <2.12.0, test >=1.12.0 <1.16.0-nullsafety.8 or >=1.16.0-nullsafety.18 requires logging ^1.0.0 or test_api 0.2.19-nullsafety.7 or 0.2.19 or http ^0.12.0.

And because test >=1.16.0-nullsafety.8 <1.16.0-nullsafety.18 depends on boolean_selector >=2.1.0-nullsafety <2.1.0 and test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0, test >=1.3.0 requires logging ^1.0.0 or test_api 0.2.19-nullsafety.7 or 0.2.19 or http ^0.12.0 or boolean_selector ^1.0.0 or >=2.1.0-nullsafety <2.1.0.

And because every version of flutter_test from sdk depends on test_api 0.3.0 which depends on boolean_selector ^2.1.0, if test >=1.3.0 and flutter_test any from sdk then logging ^1.0.0 or http ^0.12.0.

And because desktop_photo_search depends on both http ^0.13.0 and logging ^0.11.3+2, test >=1.3.0 is incompatible with flutter_test from sdk.
So, because desktop_photo_search depends on both flutter_test any from sdk and test ^1.9.4, version solving failed.
pub get failed (1; So, because desktop_photo_search depends on both flutter_test any from sdk and test ^1.9.4, version solving failed.)
exit code 1

I am on the following versions:

flutter --version
Flutter 2.2.0-10.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision b5017bf8de (3 days ago) • 2021-04-28 17:09:53 -0700
Engine • revision 91ed51e05c
Tools • Dart 2.13.0 (build 2.13.0-211.13.beta)
domesticmouse commented 2 years ago

I'm unsure when this got fixed, but desktop_photo_search builds.

$ flutter pub get
Running "flutter pub get" in desktop_photo_search...             1,331ms
$ flutter run
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                           2,185ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:82D30150-C815-5D3F-B82B-6E9FFFE56CC1 }
{ platform:macOS, name:Any Mac }
Building macOS application...                                           
Syncing files to device macOS...                                    96ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:56782/HXS7D-RrSA0=/
flutter: Unsplash INFO: 2021-11-30 09:47:33.683619: GET https://api.unsplash.com/search/photos?query=window&orientation=portrait
Activating Dart DevTools...                                         5.5s
The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:56782/HXS7D-RrSA0=/
Screen Shot 2021-11-30 at 9 48 37 am