diff --git a/lints_with_dcm.yaml b/lints_with_dcm.yaml index 05262ac5b..8b12ede68 100644 --- a/lints_with_dcm.yaml +++ b/lints_with_dcm.yaml @@ -24,6 +24,7 @@ dart_code_metrics: avoid-unsafe-collection-methods: false prefer-prefixed-global-constants: false avoid-returning-widgets: false + avoid-unnecessary-overrides: false arguments-ordering: first: - key diff --git a/packages/mix/lib/src/attributes/border/border_radius_dto.dart b/packages/mix/lib/src/attributes/border/border_radius_dto.dart index 137c55435..424a576db 100644 --- a/packages/mix/lib/src/attributes/border/border_radius_dto.dart +++ b/packages/mix/lib/src/attributes/border/border_radius_dto.dart @@ -56,9 +56,6 @@ sealed class BorderRadiusGeometryDto properties.addUsingDefault('bottomStart', bottomStart); properties.addUsingDefault('bottomEnd', bottomEnd); } - - @override - T resolve(MixData mix); } @MixableDto(generateUtility: false) diff --git a/packages/mix/lib/src/attributes/border/shape_border_dto.dart b/packages/mix/lib/src/attributes/border/shape_border_dto.dart index 31e69e7b3..0f3cbac0f 100644 --- a/packages/mix/lib/src/attributes/border/shape_border_dto.dart +++ b/packages/mix/lib/src/attributes/border/shape_border_dto.dart @@ -38,9 +38,6 @@ sealed class ShapeBorderDto extends Dto { @override ShapeBorderDto merge(covariant ShapeBorderDto? other); - - @override - T resolve(MixData mix); } @immutable @@ -86,9 +83,6 @@ abstract class OutlinedBorderDto @override OutlinedBorderDto merge(covariant OutlinedBorderDto? other); - - @override - T resolve(MixData mix); } @MixableDto() diff --git a/packages/mix/lib/src/core/attribute.dart b/packages/mix/lib/src/core/attribute.dart index 5f7af9e69..8680ea442 100644 --- a/packages/mix/lib/src/core/attribute.dart +++ b/packages/mix/lib/src/core/attribute.dart @@ -3,14 +3,12 @@ import 'package:flutter/widgets.dart'; import '../internal/compare_mixin.dart'; import 'dto.dart'; -abstract class Attribute with MergeableMixin, EqualityMixin { +abstract class Attribute with MergeableMixin, EqualityMixin { const Attribute(); // Used as the key to determine how // attributes get merged Object get mergeKey => runtimeType; - @override - Attribute merge(covariant Attribute? other); } /// Provides the ability to merge this object with another of the same type. diff --git a/packages/mix/lib/src/core/dto.dart b/packages/mix/lib/src/core/dto.dart index 2245a60fc..1ff8621cb 100644 --- a/packages/mix/lib/src/core/dto.dart +++ b/packages/mix/lib/src/core/dto.dart @@ -6,15 +6,12 @@ import 'factory/mix_data.dart'; import 'utility.dart'; @immutable -abstract class Dto with EqualityMixin, MergeableMixin { +abstract class Dto with EqualityMixin, MergeableMixin { const Dto(); Value get defaultValue; Value resolve(MixData mix); - // /// Merges this object with [other], returning a new object of type [T]. - @override - Dto merge(covariant Dto? other); } abstract class DtoUtility, Value> diff --git a/packages/mix/lib/src/core/modifier.dart b/packages/mix/lib/src/core/modifier.dart index de2e1a40b..c4e1180e0 100644 --- a/packages/mix/lib/src/core/modifier.dart +++ b/packages/mix/lib/src/core/modifier.dart @@ -2,7 +2,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'attribute.dart'; -import 'factory/mix_data.dart'; import 'spec.dart'; import 'utility.dart'; @@ -34,9 +33,6 @@ abstract class WidgetModifierSpecAttribute< Value extends WidgetModifierSpec> extends SpecAttribute with Diagnosticable { const WidgetModifierSpecAttribute(); - - @override - Value resolve(MixData mix); } abstract class WidgetModifierUtility< diff --git a/packages/mix/lib/src/core/styled_widget.dart b/packages/mix/lib/src/core/styled_widget.dart index a3626566e..29f156ca5 100644 --- a/packages/mix/lib/src/core/styled_widget.dart +++ b/packages/mix/lib/src/core/styled_widget.dart @@ -58,9 +58,6 @@ abstract class StyledWidget extends StatelessWidget { builder: builder, ); } - - @override - Widget build(BuildContext context); } /// A styled widget that builds its child using a [MixData] object. diff --git a/packages/mix/lib/src/specs/icon/icon_widget.dart b/packages/mix/lib/src/specs/icon/icon_widget.dart index 195a29f11..c9c7b42ed 100644 --- a/packages/mix/lib/src/specs/icon/icon_widget.dart +++ b/packages/mix/lib/src/specs/icon/icon_widget.dart @@ -14,13 +14,8 @@ class StyledIcon extends StyledWidget { this.textDirection, @Deprecated('Use orderOfModifiers parameter instead') List modifierOrder = const [], - List orderOfModifiers = const [], - }) : assert(modifierOrder == const [] || - orderOfModifiers == const []), - super( - orderOfModifiers: - orderOfModifiers == const [] ? modifierOrder : orderOfModifiers, - ); + super.orderOfModifiers = const [], + }); final IconData? icon; final String? semanticLabel; @@ -60,11 +55,8 @@ class IconSpecWidget extends StatelessWidget { this.textDirection, @Deprecated('Use orderOfModifiers parameter instead') List modifierOrder = const [], - List orderOfModifiers = const [], - }) : assert(modifierOrder == const [] || - orderOfModifiers == const []), - orderOfModifiers = - orderOfModifiers == const [] ? modifierOrder : orderOfModifiers; + this.orderOfModifiers = const [], + }); final IconData? icon; final IconSpec? spec; @@ -104,14 +96,8 @@ class AnimatedStyledIcon extends StyledWidget { this.textDirection, @Deprecated('Use orderOfModifiers parameter instead') List modifierOrder = const [], - List orderOfModifiers = const [], - }) : assert(modifierOrder == const [] || - orderOfModifiers == const []), - super( - orderOfModifiers: orderOfModifiers == const [] - ? modifierOrder - : orderOfModifiers, - ); + super.orderOfModifiers = const [], + }); final AnimatedIconData icon; final String? semanticLabel; @@ -147,12 +133,8 @@ class AnimatedIconSpecWidget extends ImplicitlyAnimatedWidget { super.onEnd, @Deprecated('Use orderOfModifiers parameter instead') List modifierOrder = const [], - List orderOfModifiers = const [], - }) : assert(modifierOrder == const [] || - orderOfModifiers == const []), - orderOfModifiers = orderOfModifiers == const [] - ? modifierOrder - : orderOfModifiers; + this.orderOfModifiers = const [], + }); final IconData? icon; final IconSpec spec; diff --git a/packages/mix/lib/src/theme/mix/mix_theme.dart b/packages/mix/lib/src/theme/mix/mix_theme.dart index db019d343..d67b4a97c 100644 --- a/packages/mix/lib/src/theme/mix/mix_theme.dart +++ b/packages/mix/lib/src/theme/mix/mix_theme.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../internal/iterable_ext.dart'; @@ -152,7 +153,7 @@ class MixThemeData { other.breakpoints == breakpoints && other.radii == radii && other.spaces == spaces && - other.defaultOrderOfModifiers == defaultOrderOfModifiers; + listEquals(other.defaultOrderOfModifiers, defaultOrderOfModifiers); } @override diff --git a/packages/mix/lib/src/theme/tokens/text_style_token.dart b/packages/mix/lib/src/theme/tokens/text_style_token.dart index 743fa045e..61ab9aacd 100644 --- a/packages/mix/lib/src/theme/tokens/text_style_token.dart +++ b/packages/mix/lib/src/theme/tokens/text_style_token.dart @@ -1,3 +1,4 @@ +//ignore_for_file: avoid-suspicious-super-overrides import 'package:flutter/widgets.dart'; import '../../internal/mix_error.dart'; diff --git a/packages/mix/lib/src/variants/context_variant.dart b/packages/mix/lib/src/variants/context_variant.dart index 22d037eeb..3619553d5 100644 --- a/packages/mix/lib/src/variants/context_variant.dart +++ b/packages/mix/lib/src/variants/context_variant.dart @@ -39,9 +39,6 @@ abstract class ContextVariant extends IVariant { return VariantAttribute(this, Style.create(params)); } - @override - bool when(BuildContext context); - @override VariantPriority get priority => VariantPriority.normal; diff --git a/packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart b/packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart index dd629ab5f..6cc555902 100644 --- a/packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart +++ b/packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart @@ -102,7 +102,6 @@ void main() { ), ).animate( onEnd: () { - print('onEnd'); countOnEnd++; }, ), @@ -142,7 +141,6 @@ void main() { ), ).animate( onEnd: () { - print('onEnd'); countOnEnd++; }, ),