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
Flutter Color as field failed generation #513
Comments
Unfortunately this is an issue with The problem is that it runs codegen against the plain Dart SDK, not the Flutter SDK, so the tool cannot see I suggest asking on that linked issue if there is a workaround. |
I used the int color.value as replacement. |
Closing this as a duplicate of #282 |
What version of |
This was the commit to I think it's in the latest version, |
Unfortunately I got the same error :( I pinned
Here is the code: import 'package:built_value/built_value.dart';
import 'package:flutter/widgets.dart' show Color;
part 'theme.g.dart';
abstract class Theme implements Built<Theme, ThemeBuilder> {
String get fontFamily;
Color get primaryColor;
Color get textColor;
Color get backgroundColor;
Theme._();
factory Theme([void Function(ThemeBuilder) updates]) = _$Theme;
} One of the errors:
|
Have filed an issue over at Thanks. |
Thank you so much! |
Copying comment from that issue, the fix is in build_resolvers not the build or build_runner, you will need version 1.2.1 of build_resolvers or greater. |
So that means i need to explicitly install |
You should be able to do a normal The output of that command should show you the versions that were selected and so as long as you get at least version |
Will try that. Thank you so much! |
Upgraded packages. Edit:
|
What is the build_resolvers version though? |
On 1.2.1 |
And are you running |
|
I just tried this for the That looks like it worked to me - so something else might be going on. If that doesn't look like what is expected please let me know. Can you try deleting your |
So I tried:
I am having issues in both projects, and the issue persists after the reboot :( |
@MrCreeper1008 what flutter version? Can you provide your entire |
Absolutely! I am on Flutter |
Ok - good news is I was able to reproduce the issue with that flutter version and pubspec.lock! Now to try and find the problem :). |
Thank you so much for the help! |
Fyi I re-opened the build issue that @davidmorgan filed based on this dart-lang/build#2528. I might do some followup there that I don't copy here but I will update this thread as well once the issue is resolved one way or the other. |
Thank you! Will subscribe to that issue as well. |
Using
Color get color;
error to`
Please make the following changes to use BuiltValue:
[`
I've try using dart:ui or flutter/material as import, Type is recognised by the IDE but not when using built_value. Not sure what I missed.
Thank you.
The text was updated successfully, but these errors were encountered: