material-foundation / material-color-utilities

Color libraries for Material You
Apache License 2.0
1.57k stars 134 forks source link

Application depends on flutter from sdk which depends on material_color_utilities 0.2.0, material_color_utilities 0.2.0 is required. #110

Open CordMemescape opened 11 months ago

CordMemescape commented 11 months ago

I'm following one of the Flutter team's videos "Material 3 from design to deployment" linked from here: https://m3.material.io/develop/flutter

The example uses material_color_utilities to manage the application's theming techniques, and specifically, the example uses Scheme.toColorScheme() to generate a new ColorScheme based on the application's theme customization.

However, when I depend on material_color_utilities ^0.8.0 - which provides this functionality - I get the following error:

[app_client] flutter pub get
Resolving dependencies...
Because app_client depends on flutter from sdk which depends on material_color_utilities 0.2.0, material_color_utilities 0.2.0 is required.
So, because app_client depends on material_color_utilities 0.8.0, version solving failed.
exit code 1

Any thoughts on how to resolve this dependency issue and make use of the updated Material 3 functionality?

I'm developing production apps with the following development environment:

Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f468f3366c (2 weeks ago) • 2023-07-12 15:19:05 -0700
Engine • revision cdbeda788a
Tools • Dart 3.0.6 • DevTools 2.23.1
TriMontana commented 11 months ago

Thanks for posting this issue. I have the same problem and have not found a work-around without porting over and refactoring the source code. Not recommended.

Hopefully someone will provide a way to resolve this dependency.

CordMemescape commented 11 months ago

You're welcome @TriMontana. I suspect that the answer will be to switch to one of the development channels - but that makes me somewhat nervous when publishing production apps. Hopefully we get an answer either way.

totosugito commented 9 months ago

I have same problems and solved by upgrading the flutter using command flutter upgrade. I can use the material_color_utilities 0.5.0 after updating the flutter.

This is my latest flutter version.

Flutter 3.13.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 2524052335 (5 days ago) • 2023-09-06 14:32:31 -0700 Engine • revision b8d35810e9 Tools • Dart 3.1.1 • DevTools 2.25.0