gtk-flutter / libadwaita

Libadwaita's widgets for Flutter. Following Gnome HIG and available on all platforms.
https://pub.dev/packages/libadwaita
Mozilla Public License 2.0
237 stars 17 forks source link

Example doesn't build on macOS Sonoma (Flutter 3.22) #91

Open nu11ptr opened 3 days ago

nu11ptr commented 3 days ago

What I did:

I clone the repo and execute the commands as listed in the example README.me. I tried both with main and first checking out 2.0.1. Both result in the same error. Please advise.

OS: macOS 14.5 Hw: MacBook Pro (M1 Max, 32 GB RAM) Environment:

flutter --version
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (4 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

When running flutter run -d macos:

flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006001-001229DE3EF8801E, name:My Mac }
{ platform:macOS, arch:x86_64, id:00006001-001229DE3EF8801E, name:My Mac }
../../../../.pub-cache/hosted/pub.dev/adwaita-1.0.0/lib/src/theme.dart:14:5: Error: No named parameter with the name 'primaryColorDark'.
    primaryColorDark: AdwaitaColors.darkBackgroundColor,
    ^^^^^^^^^^^^^^^^
../../../../apps/flutter/packages/flutter/lib/src/material/color_scheme.dart:960:11: Context: Found this candidate, but the arguments don't match.
  factory ColorScheme.fromSwatch({
          ^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/adwaita-1.0.0/lib/src/theme.dart:25:5: Error: No named parameter with the name 'primaryColorDark'.
    primaryColorDark: AdwaitaColors.darkBackgroundColor,
    ^^^^^^^^^^^^^^^^
../../../../apps/flutter/packages/flutter/lib/src/material/color_scheme.dart:960:11: Context: Found this candidate, but the arguments don't match.
  factory ColorScheme.fromSwatch({
          ^^^^^^^^^^
Target kernel_snapshot failed: Exception

Command PhaseScriptExecution failed with a nonzero exit code
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Building macOS application...
Error: Build process failed
nu11ptr commented 3 days ago

Upgrading adwaita to 1.1.0 fixed this. I'm new to Flutter, but wondering if 3.2.2 broke adwaita 1.0.0?

prateekmedia commented 3 days ago

Yeah, this was due to latest Flutter upgrade. Will update example if it occurs on it by default.