diff --git a/packages/mix/lib/src/specs/box/box_spec.dart b/packages/mix/lib/src/specs/box/box_spec.dart index 6962cd4d0..93817edc3 100644 --- a/packages/mix/lib/src/specs/box/box_spec.dart +++ b/packages/mix/lib/src/specs/box/box_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'box_spec.g.dart'; const _constraints = MixableUtility( diff --git a/packages/mix/lib/src/specs/box/box_spec.g.dart b/packages/mix/lib/src/specs/box/box_spec.g.dart index 783151ea3..54d051a55 100644 --- a/packages/mix/lib/src/specs/box/box_spec.g.dart +++ b/packages/mix/lib/src/specs/box/box_spec.g.dart @@ -255,19 +255,29 @@ final class BoxSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('alignment', alignment); - properties.addUsingDefault('padding', padding); - properties.addUsingDefault('margin', margin); - properties.addUsingDefault('constraints', constraints); - properties.addUsingDefault('decoration', decoration, expandableValue: true); - properties.addUsingDefault('foregroundDecoration', foregroundDecoration); - properties.addUsingDefault('transform', transform); - properties.addUsingDefault('transformAlignment', transformAlignment); - properties.addUsingDefault('clipBehavior', clipBehavior); - properties.addUsingDefault('width', width); - properties.addUsingDefault('height', height); - properties.addUsingDefault('modifiers', modifiers); - properties.addUsingDefault('animated', animated); + properties + .add(DiagnosticsProperty('alignment', alignment, defaultValue: null)); + properties.add(DiagnosticsProperty('padding', padding, defaultValue: null)); + properties.add(DiagnosticsProperty('margin', margin, defaultValue: null)); + properties.add( + DiagnosticsProperty('constraints', constraints, defaultValue: null)); + properties.add(DiagnosticsProperty('decoration', decoration, + expandableValue: true, defaultValue: null)); + properties.add(DiagnosticsProperty( + 'foregroundDecoration', foregroundDecoration, + defaultValue: null)); + properties + .add(DiagnosticsProperty('transform', transform, defaultValue: null)); + properties.add(DiagnosticsProperty('transformAlignment', transformAlignment, + defaultValue: null)); + properties.add( + DiagnosticsProperty('clipBehavior', clipBehavior, defaultValue: null)); + properties.add(DiagnosticsProperty('width', width, defaultValue: null)); + properties.add(DiagnosticsProperty('height', height, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); } } diff --git a/packages/mix/lib/src/specs/flex/flex_spec.dart b/packages/mix/lib/src/specs/flex/flex_spec.dart index 4f44eb68d..15e9cf53d 100644 --- a/packages/mix/lib/src/specs/flex/flex_spec.dart +++ b/packages/mix/lib/src/specs/flex/flex_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'flex_spec.g.dart'; @MixableSpec() diff --git a/packages/mix/lib/src/specs/flex/flex_spec.g.dart b/packages/mix/lib/src/specs/flex/flex_spec.g.dart index f6976492c..288ced1b5 100644 --- a/packages/mix/lib/src/specs/flex/flex_spec.g.dart +++ b/packages/mix/lib/src/specs/flex/flex_spec.g.dart @@ -232,17 +232,27 @@ final class FlexSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('crossAxisAlignment', crossAxisAlignment); - properties.addUsingDefault('mainAxisAlignment', mainAxisAlignment); - properties.addUsingDefault('mainAxisSize', mainAxisSize); - properties.addUsingDefault('verticalDirection', verticalDirection); - properties.addUsingDefault('direction', direction); - properties.addUsingDefault('textDirection', textDirection); - properties.addUsingDefault('textBaseline', textBaseline); - properties.addUsingDefault('clipBehavior', clipBehavior); - properties.addUsingDefault('gap', gap); - properties.addUsingDefault('animated', animated); - properties.addUsingDefault('modifiers', modifiers); + properties.add(DiagnosticsProperty('crossAxisAlignment', crossAxisAlignment, + defaultValue: null)); + properties.add(DiagnosticsProperty('mainAxisAlignment', mainAxisAlignment, + defaultValue: null)); + properties.add( + DiagnosticsProperty('mainAxisSize', mainAxisSize, defaultValue: null)); + properties.add(DiagnosticsProperty('verticalDirection', verticalDirection, + defaultValue: null)); + properties + .add(DiagnosticsProperty('direction', direction, defaultValue: null)); + properties.add(DiagnosticsProperty('textDirection', textDirection, + defaultValue: null)); + properties.add( + DiagnosticsProperty('textBaseline', textBaseline, defaultValue: null)); + properties.add( + DiagnosticsProperty('clipBehavior', clipBehavior, defaultValue: null)); + properties.add(DiagnosticsProperty('gap', gap, defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); } } diff --git a/packages/mix/lib/src/specs/icon/icon_spec.dart b/packages/mix/lib/src/specs/icon/icon_spec.dart index b4b910e2d..d32862464 100644 --- a/packages/mix/lib/src/specs/icon/icon_spec.dart +++ b/packages/mix/lib/src/specs/icon/icon_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'icon_spec.g.dart'; @MixableSpec() diff --git a/packages/mix/lib/src/specs/icon/icon_spec.g.dart b/packages/mix/lib/src/specs/icon/icon_spec.g.dart index 4300ed7d4..a981da5a3 100644 --- a/packages/mix/lib/src/specs/icon/icon_spec.g.dart +++ b/packages/mix/lib/src/specs/icon/icon_spec.g.dart @@ -232,17 +232,22 @@ final class IconSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('color', color); - properties.addUsingDefault('size', size); - properties.addUsingDefault('weight', weight); - properties.addUsingDefault('grade', grade); - properties.addUsingDefault('opticalSize', opticalSize); - properties.addUsingDefault('shadows', shadows); - properties.addUsingDefault('textDirection', textDirection); - properties.addUsingDefault('applyTextScaling', applyTextScaling); - properties.addUsingDefault('fill', fill); - properties.addUsingDefault('animated', animated); - properties.addUsingDefault('modifiers', modifiers); + properties.add(DiagnosticsProperty('color', color, defaultValue: null)); + properties.add(DiagnosticsProperty('size', size, defaultValue: null)); + properties.add(DiagnosticsProperty('weight', weight, defaultValue: null)); + properties.add(DiagnosticsProperty('grade', grade, defaultValue: null)); + properties.add( + DiagnosticsProperty('opticalSize', opticalSize, defaultValue: null)); + properties.add(DiagnosticsProperty('shadows', shadows, defaultValue: null)); + properties.add(DiagnosticsProperty('textDirection', textDirection, + defaultValue: null)); + properties.add(DiagnosticsProperty('applyTextScaling', applyTextScaling, + defaultValue: null)); + properties.add(DiagnosticsProperty('fill', fill, defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); } } diff --git a/packages/mix/lib/src/specs/image/image_spec.dart b/packages/mix/lib/src/specs/image/image_spec.dart index fc466e8ba..895992dba 100644 --- a/packages/mix/lib/src/specs/image/image_spec.dart +++ b/packages/mix/lib/src/specs/image/image_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'image_spec.g.dart'; @MixableSpec() diff --git a/packages/mix/lib/src/specs/image/image_spec.g.dart b/packages/mix/lib/src/specs/image/image_spec.g.dart index e3a0d4bfe..81a5e8f42 100644 --- a/packages/mix/lib/src/specs/image/image_spec.g.dart +++ b/packages/mix/lib/src/specs/image/image_spec.g.dart @@ -232,17 +232,23 @@ final class ImageSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('width', width); - properties.addUsingDefault('height', height); - properties.addUsingDefault('color', color); - properties.addUsingDefault('repeat', repeat); - properties.addUsingDefault('fit', fit); - properties.addUsingDefault('alignment', alignment); - properties.addUsingDefault('centerSlice', centerSlice); - properties.addUsingDefault('filterQuality', filterQuality); - properties.addUsingDefault('colorBlendMode', colorBlendMode); - properties.addUsingDefault('animated', animated); - properties.addUsingDefault('modifiers', modifiers); + properties.add(DiagnosticsProperty('width', width, defaultValue: null)); + properties.add(DiagnosticsProperty('height', height, defaultValue: null)); + properties.add(DiagnosticsProperty('color', color, defaultValue: null)); + properties.add(DiagnosticsProperty('repeat', repeat, defaultValue: null)); + properties.add(DiagnosticsProperty('fit', fit, defaultValue: null)); + properties + .add(DiagnosticsProperty('alignment', alignment, defaultValue: null)); + properties.add( + DiagnosticsProperty('centerSlice', centerSlice, defaultValue: null)); + properties.add(DiagnosticsProperty('filterQuality', filterQuality, + defaultValue: null)); + properties.add(DiagnosticsProperty('colorBlendMode', colorBlendMode, + defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); } } diff --git a/packages/mix/lib/src/specs/stack/stack_spec.dart b/packages/mix/lib/src/specs/stack/stack_spec.dart index 9c7161a89..bc5702335 100644 --- a/packages/mix/lib/src/specs/stack/stack_spec.dart +++ b/packages/mix/lib/src/specs/stack/stack_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'stack_spec.g.dart'; @MixableSpec() diff --git a/packages/mix/lib/src/specs/stack/stack_spec.g.dart b/packages/mix/lib/src/specs/stack/stack_spec.g.dart index 37d5a7bb8..1e9b01846 100644 --- a/packages/mix/lib/src/specs/stack/stack_spec.g.dart +++ b/packages/mix/lib/src/specs/stack/stack_spec.g.dart @@ -184,12 +184,17 @@ final class StackSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('alignment', alignment); - properties.addUsingDefault('fit', fit); - properties.addUsingDefault('textDirection', textDirection); - properties.addUsingDefault('clipBehavior', clipBehavior); - properties.addUsingDefault('animated', animated); - properties.addUsingDefault('modifiers', modifiers); + properties + .add(DiagnosticsProperty('alignment', alignment, defaultValue: null)); + properties.add(DiagnosticsProperty('fit', fit, defaultValue: null)); + properties.add(DiagnosticsProperty('textDirection', textDirection, + defaultValue: null)); + properties.add( + DiagnosticsProperty('clipBehavior', clipBehavior, defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); } } diff --git a/packages/mix/lib/src/specs/text/text_spec.dart b/packages/mix/lib/src/specs/text/text_spec.dart index 11435a581..eccc63c9b 100644 --- a/packages/mix/lib/src/specs/text/text_spec.dart +++ b/packages/mix/lib/src/specs/text/text_spec.dart @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; -import '../../internal/diagnostic_properties_builder_ext.dart'; - part 'text_spec.g.dart'; @MixableSpec() diff --git a/packages/mix/lib/src/specs/text/text_spec.g.dart b/packages/mix/lib/src/specs/text/text_spec.g.dart index 740e65862..00c23ca82 100644 --- a/packages/mix/lib/src/specs/text/text_spec.g.dart +++ b/packages/mix/lib/src/specs/text/text_spec.g.dart @@ -261,20 +261,34 @@ final class TextSpecAttribute extends SpecAttribute @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.addUsingDefault('overflow', overflow); - properties.addUsingDefault('strutStyle', strutStyle); - properties.addUsingDefault('textAlign', textAlign); - properties.addUsingDefault('textScaleFactor', textScaleFactor); - properties.addUsingDefault('textScaler', textScaler); - properties.addUsingDefault('maxLines', maxLines); - properties.addUsingDefault('style', style, expandableValue: true); - properties.addUsingDefault('textWidthBasis', textWidthBasis); - properties.addUsingDefault('textHeightBehavior', textHeightBehavior); - properties.addUsingDefault('textDirection', textDirection); - properties.addUsingDefault('softWrap', softWrap); - properties.addUsingDefault('directive', directive); - properties.addUsingDefault('animated', animated); - properties.addUsingDefault('modifiers', modifiers); + properties + .add(DiagnosticsProperty('overflow', overflow, defaultValue: null)); + properties + .add(DiagnosticsProperty('strutStyle', strutStyle, defaultValue: null)); + properties + .add(DiagnosticsProperty('textAlign', textAlign, defaultValue: null)); + properties.add(DiagnosticsProperty('textScaleFactor', textScaleFactor, + defaultValue: null)); + properties + .add(DiagnosticsProperty('textScaler', textScaler, defaultValue: null)); + properties + .add(DiagnosticsProperty('maxLines', maxLines, defaultValue: null)); + properties.add(DiagnosticsProperty('style', style, + expandableValue: true, defaultValue: null)); + properties.add(DiagnosticsProperty('textWidthBasis', textWidthBasis, + defaultValue: null)); + properties.add(DiagnosticsProperty('textHeightBehavior', textHeightBehavior, + defaultValue: null)); + properties.add(DiagnosticsProperty('textDirection', textDirection, + defaultValue: null)); + properties + .add(DiagnosticsProperty('softWrap', softWrap, defaultValue: null)); + properties + .add(DiagnosticsProperty('directive', directive, defaultValue: null)); + properties + .add(DiagnosticsProperty('animated', animated, defaultValue: null)); + properties + .add(DiagnosticsProperty('modifiers', modifiers, defaultValue: null)); } } diff --git a/packages/mix/pubspec.yaml b/packages/mix/pubspec.yaml index bcc0635c5..fe6aebe53 100644 --- a/packages/mix/pubspec.yaml +++ b/packages/mix/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: sdk: flutter dev_dependencies: - flutter_lints: ^3.0.1 + flutter_lints: ^4.0.0 flutter_test: sdk: flutter dart_code_metrics_presets: ^2.13.0 diff --git a/packages/mix_generator/lib/src/builders/method_debug_fill_properties.dart b/packages/mix_generator/lib/src/builders/method_debug_fill_properties.dart index 20e6aab74..11565a1ad 100644 --- a/packages/mix_generator/lib/src/builders/method_debug_fill_properties.dart +++ b/packages/mix_generator/lib/src/builders/method_debug_fill_properties.dart @@ -10,9 +10,9 @@ String methodDebugFillProperties({ final fieldStatements = fields.map((field) { final fieldName = isInternalRef ? field.asInternalRef : field.name; if (_expandableFields.contains(fieldName)) { - return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, expandableValue: true));'; + return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, expandableValue: true, defaultValue: null));'; } - return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName));'; + return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, defaultValue: null));'; }).join('\n'); return ''' diff --git a/packages/mix_generator/lib/src/builders/method_merge.dart b/packages/mix_generator/lib/src/builders/method_merge.dart index b624b7760..ac79fff44 100644 --- a/packages/mix_generator/lib/src/builders/method_merge.dart +++ b/packages/mix_generator/lib/src/builders/method_merge.dart @@ -50,7 +50,7 @@ String mergeMethodBuilder({ return '$propAssignment $thisName$nullable.merge(other.$propName) ?? other.$propName'; } else { - return '$propAssignment other$nullable.$propName ?? $thisName'; + return '$propAssignment other.$propName ?? $thisName'; } }).join(',\n ');