Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Nov 14, 2024
1 parent 753f8a8 commit 2de2a79
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 42 deletions.
3 changes: 0 additions & 3 deletions packages/mix/lib/src/attributes/border/border_radius_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ sealed class BorderRadiusGeometryDto<T extends BorderRadiusGeometry>
properties.addUsingDefault('bottomStart', bottomStart);
properties.addUsingDefault('bottomEnd', bottomEnd);
}

@override
T resolve(MixData mix);
}

@MixableDto(generateUtility: false)
Expand Down
6 changes: 0 additions & 6 deletions packages/mix/lib/src/attributes/border/shape_border_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ sealed class ShapeBorderDto<T extends ShapeBorder> extends Dto<T> {

@override
ShapeBorderDto<T> merge(covariant ShapeBorderDto<T>? other);

@override
T resolve(MixData mix);
}

@immutable
Expand Down Expand Up @@ -86,9 +83,6 @@ abstract class OutlinedBorderDto<T extends OutlinedBorder>

@override
OutlinedBorderDto<T> merge(covariant OutlinedBorderDto<T>? other);

@override
T resolve(MixData mix);
}

@MixableDto()
Expand Down
4 changes: 1 addition & 3 deletions packages/mix/lib/src/core/attribute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Attribute>, 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.
Expand Down
5 changes: 1 addition & 4 deletions packages/mix/lib/src/core/dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ import 'factory/mix_data.dart';
import 'utility.dart';

@immutable
abstract class Dto<Value> with EqualityMixin, MergeableMixin {
abstract class Dto<Value> with EqualityMixin, MergeableMixin<Dto> {
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<Attr extends Attribute, D extends Dto<Value>, Value>
Expand Down
4 changes: 0 additions & 4 deletions packages/mix/lib/src/core/modifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -34,9 +33,6 @@ abstract class WidgetModifierSpecAttribute<
Value extends WidgetModifierSpec<Value>> extends SpecAttribute<Value>
with Diagnosticable {
const WidgetModifierSpecAttribute();

@override
Value resolve(MixData mix);
}

abstract class WidgetModifierUtility<
Expand Down
3 changes: 0 additions & 3 deletions packages/mix/lib/src/core/styled_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 9 additions & 15 deletions packages/mix/lib/src/specs/icon/icon_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class StyledIcon extends StyledWidget {
@Deprecated('Use orderOfModifiers parameter instead')
List<Type> modifierOrder = const <Type>[],
List<Type> orderOfModifiers = const <Type>[],
}) : assert(modifierOrder == const <Type>[] ||
orderOfModifiers == const <Type>[]),
}) : assert(modifierOrder.length == 0 || orderOfModifiers.length == 0),
super(
orderOfModifiers:
orderOfModifiers == const [] ? modifierOrder : orderOfModifiers,
Expand Down Expand Up @@ -61,10 +60,9 @@ class IconSpecWidget extends StatelessWidget {
@Deprecated('Use orderOfModifiers parameter instead')
List<Type> modifierOrder = const <Type>[],
List<Type> orderOfModifiers = const <Type>[],
}) : assert(modifierOrder == const <Type>[] ||
orderOfModifiers == const <Type>[]),
}) : assert(modifierOrder.length == 0 || orderOfModifiers.length == 0),
orderOfModifiers =
orderOfModifiers == const [] ? modifierOrder : orderOfModifiers;
orderOfModifiers.length == 0 ? modifierOrder : orderOfModifiers;

final IconData? icon;
final IconSpec? spec;
Expand Down Expand Up @@ -105,12 +103,10 @@ class AnimatedStyledIcon extends StyledWidget {
@Deprecated('Use orderOfModifiers parameter instead')
List<Type> modifierOrder = const <Type>[],
List<Type> orderOfModifiers = const <Type>[],
}) : assert(modifierOrder == const <Type>[] ||
orderOfModifiers == const <Type>[]),
}) : assert(modifierOrder.length == 0 || orderOfModifiers.length == 0),
super(
orderOfModifiers: orderOfModifiers == const <Type>[]
? modifierOrder
: orderOfModifiers,
orderOfModifiers:
orderOfModifiers.length == 0 ? modifierOrder : orderOfModifiers,
);

final AnimatedIconData icon;
Expand Down Expand Up @@ -148,11 +144,9 @@ class AnimatedIconSpecWidget extends ImplicitlyAnimatedWidget {
@Deprecated('Use orderOfModifiers parameter instead')
List<Type> modifierOrder = const <Type>[],
List<Type> orderOfModifiers = const <Type>[],
}) : assert(modifierOrder == const <Type>[] ||
orderOfModifiers == const <Type>[]),
orderOfModifiers = orderOfModifiers == const <Type>[]
? modifierOrder
: orderOfModifiers;
}) : assert(modifierOrder.length == 0 || orderOfModifiers.length == 0),
orderOfModifiers =
orderOfModifiers.length == 0 ? modifierOrder : orderOfModifiers;

final IconData? icon;
final IconSpec spec;
Expand Down
3 changes: 2 additions & 1 deletion packages/mix/lib/src/theme/mix/mix_theme.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import '../../internal/iterable_ext.dart';
Expand Down Expand Up @@ -152,7 +153,7 @@ class MixThemeData {
other.breakpoints == breakpoints &&
other.radii == radii &&
other.spaces == spaces &&
other.defaultOrderOfModifiers == defaultOrderOfModifiers;
listEquals(other.defaultOrderOfModifiers, defaultOrderOfModifiers);
}

@override
Expand Down
3 changes: 0 additions & 3 deletions packages/mix/lib/src/variants/context_variant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2de2a79

Please sign in to comment.