Comments (1)
The errors seem to contradict, but in fact they don't. 😉
The first one states that anything carrying the same name as a counterpart in its super class should be annotated with @override
. That is typically the case if you define a static
method in an abstract
class that another class implements/extends. You could also do that here to resolve the first error. But then there is the second error stating that, no matter if @override
is added or not, you shouldn't do it in the first place because fields aren't meant to be overridden.
See, if IContent
had a field called name
and Content
had firstName
, you could access both through:
final content = Content();
final name = content.name;
final firstName = content.firstName;
because Content
extends IContent
with its inherited name
field. If you override a field with another, you loose that functionality, which, however, is the entire purpose of extending it. It is therefore bad practice to do so. 😔
If you really want to enforce the override, you can achieve that with an // ignore ...
, but maybe you want to reevaluate whether you want to do that in the first place. 🤔
from dart-lint.
Related Issues (20)
- avoid_redundant_argument_values ? HOT 5
- Enable avoid_dynamic_calls HOT 2
- Is it a superset of `package:flutter_lints/flutter.yaml`? HOT 1
- Shall we disable `use_decorated_box` since it seems to be wrong: Its fix is not equivalent and changes UI
- must_be_immutable
- `avoid_slow_async_io` is disabled, but the comments suggest it should exist HOT 2
- Broken linter around enum and import order HOT 2
- Version tag for `1.8.2` is missing on GitHub HOT 1
- flutter 3.0's lints HOT 3
- Updating this package to use dart-sdk 2.17 is possible ? HOT 1
- Create a casual lint HOT 1
- Documentation Rules HOT 1
- Remove `implicit-casts` for new Dart versions or use this workaround HOT 1
- False positive: unecessary_string_escapes HOT 2
- Remove `implicit-casts` HOT 2
- "implicit-casts" is not longer suppported Dart 3.10 HOT 1
- Add new rules of Dart 3.1 HOT 1
- Add new rules for Dart 3.2 HOT 12
- Uses of `dynamic` as generic type are not flagged because `always_specify_types` is disabled HOT 2
- Dart 3.1 - no recognized rules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-lint.