Skip to content

Commit

Permalink
Disable DCM prefer-correct-callback-field-name rule
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-jilek-deploy committed Jan 12, 2024
1 parent e156ac1 commit c39ac47
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions glade_forms/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ include: package:netglade_analysis/lints.yaml
dart_code_metrics:
extends:
- package:netglade_analysis/dcm.yaml
pubspec-rules:
prefer-publish-to-none: false
rules:
- prefer-correct-callback-field-name: false
12 changes: 6 additions & 6 deletions glade_forms/lib/src/core/glade_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,10 @@ class GladeInput<T> extends ChangeNotifier {
final convertedError = _validator(convertedValue);

return !convertedError.isValid ? _translate(delimiter: delimiter, customError: convertedError) : null;
} on ConvertError<T> catch (formatError) {
return formatError.error != null
? _translate(delimiter: delimiter, customError: formatError)
: formatError.devError(value, extra: validatorResult);
} on ConvertError<T> catch (e) {
return e.error != null
? _translate(delimiter: delimiter, customError: e)
: e.devError(value, extra: validatorResult);
}
}

Expand Down Expand Up @@ -471,8 +471,8 @@ class GladeInput<T> extends ChangeNotifier {

try {
this.value = converter.convert(strValue);
} on ConvertError<T> catch (conversionError) {
_conversionError = conversionError;
} on ConvertError<T> catch (e) {
_conversionError = e;
}
}

Expand Down
6 changes: 3 additions & 3 deletions glade_forms/lib/src/widgets/glade_form_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GladeFormListener<M extends GladeModel> extends StatefulWidget {
}

class _GladeFormListenerState<M extends GladeModel> extends State<GladeFormListener<M>> {
M? model;
M? _model;

@override
void initState() {
Expand All @@ -33,13 +33,13 @@ class _GladeFormListenerState<M extends GladeModel> extends State<GladeFormListe

@override
void dispose() {
model?.removeListener(_onModelUpdate);
_model?.removeListener(_onModelUpdate);
super.dispose();
}

@override
void didChangeDependencies() {
model = context.read<M>();
_model = context.read<M>();
super.didChangeDependencies();
}

Expand Down
2 changes: 2 additions & 0 deletions storybook/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ analyzer:
dart_code_metrics:
extends:
- package:netglade_analysis/dcm.yaml
rules:
- prefer-correct-callback-field-name: false

0 comments on commit c39ac47

Please sign in to comment.