-
Notifications
You must be signed in to change notification settings - Fork 164
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
must_be_immutable and Mock #200
Labels
P2
A bug or feature request we're likely to work on
S2
type-enhancement
A request for a change that isn't a bug
Comments
I agree the Mock class should more-or-less be immutable. This will fit with some planned upcoming work. For now, you should be able to ignore the Hint in your tests: // ignore: must_be_immutable
class MockWrongTypeChatWidgetModel extends Mock implements ChatWidgetModel {} |
@srawlins Great. Thanks! |
11 tasks
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this issue
Jul 14, 2023
Marks all Dart-wrapped Android native classes as `@immutable`. They are all immutable anyway because they extend `JavaObject` which is immutable, but marking them as immutable explicitly avoids lint warnings caused by [`must_be_immutable`](https://dart.dev/tools/diagnostic-messages#must_be_immutable) when generated mocks of these classes are used (see dart-lang/mockito#200). Also, updates `CONTRIBUTING.md` to include marking wrapped classes as immutable and extending `JavaObject` as requirements for adding new wrapped classes. cc @ChristianEdwardPadilla: this should fix the internal lint errors caused by `JavaObject` being immutable.
Will it be fixed? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P2
A bug or feature request we're likely to work on
S2
type-enhancement
A request for a change that isn't a bug
Hi,
With the latest flutter version from master I'm seeing this lint errors:
These are the classes involved here. Equatable is also marked with immutable macro.
class MockWrongTypeChatWidgetModel extends Mock implements ChatWidgetModel {}
The text was updated successfully, but these errors were encountered: