diff --git a/glade_forms/analysis_options.yaml b/glade_forms/analysis_options.yaml index 14cbcba..8511f64 100644 --- a/glade_forms/analysis_options.yaml +++ b/glade_forms/analysis_options.yaml @@ -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 diff --git a/glade_forms/lib/src/core/glade_input.dart b/glade_forms/lib/src/core/glade_input.dart index b5fd99a..5c3dba3 100644 --- a/glade_forms/lib/src/core/glade_input.dart +++ b/glade_forms/lib/src/core/glade_input.dart @@ -440,10 +440,10 @@ class GladeInput extends ChangeNotifier { final convertedError = _validator(convertedValue); return !convertedError.isValid ? _translate(delimiter: delimiter, customError: convertedError) : null; - } on ConvertError catch (formatError) { - return formatError.error != null - ? _translate(delimiter: delimiter, customError: formatError) - : formatError.devError(value, extra: validatorResult); + } on ConvertError catch (e) { + return e.error != null + ? _translate(delimiter: delimiter, customError: e) + : e.devError(value, extra: validatorResult); } } @@ -471,8 +471,8 @@ class GladeInput extends ChangeNotifier { try { this.value = converter.convert(strValue); - } on ConvertError catch (conversionError) { - _conversionError = conversionError; + } on ConvertError catch (e) { + _conversionError = e; } } diff --git a/glade_forms/lib/src/widgets/glade_form_listener.dart b/glade_forms/lib/src/widgets/glade_form_listener.dart index dc37942..f16b981 100644 --- a/glade_forms/lib/src/widgets/glade_form_listener.dart +++ b/glade_forms/lib/src/widgets/glade_form_listener.dart @@ -23,7 +23,7 @@ class GladeFormListener extends StatefulWidget { } class _GladeFormListenerState extends State> { - M? model; + M? _model; @override void initState() { @@ -33,13 +33,13 @@ class _GladeFormListenerState extends State(); + _model = context.read(); super.didChangeDependencies(); } diff --git a/storybook/analysis_options.yaml b/storybook/analysis_options.yaml index 11650bc..32a2fc9 100644 --- a/storybook/analysis_options.yaml +++ b/storybook/analysis_options.yaml @@ -9,3 +9,5 @@ analyzer: dart_code_metrics: extends: - package:netglade_analysis/dcm.yaml + rules: + - prefer-correct-callback-field-name: false