@@ -24,12 +24,10 @@ class SolvroCustomLinterPlugin extends Plugin {
2424 AvoidIconWithoutSemanticLabelRule (),
2525 AvoidImageWithoutSemanticLabelRule (),
2626 AvoidSingleChildRule (),
27- AvoidSmallInteractiveElementsRule (),
2827 AssetImageRule (),
2928 CognitiveComplexityRule (),
3029 DisposeControllersRule (),
3130 FreezedMissingMixinRule (),
32- FreezedMissingPrivateEmptyConstructorRule (),
3331 HooksAvoidNestingRule (),
3432 HooksAvoidWithinClassRule (),
3533 HooksExtendsRule (),
@@ -298,48 +296,6 @@ class AvoidImageWithoutSemanticLabelRule extends _SolvroRule {
298296 }
299297}
300298
301- class AvoidSmallInteractiveElementsRule extends _SolvroRule {
302- AvoidSmallInteractiveElementsRule ()
303- : super (
304- const LintCode (
305- "avoid_small_interactive_elements" ,
306- "Interactive elements should be at least 48x48 logical pixels." ,
307- ),
308- "Ensures common interactive widgets are large enough to tap." ,
309- );
310-
311- static const _interactiveWidgets = {
312- "ElevatedButton" ,
313- "FilledButton" ,
314- "FloatingActionButton" ,
315- "IconButton" ,
316- "InkWell" ,
317- "OutlinedButton" ,
318- "TextButton" ,
319- };
320-
321- @override
322- void registerNodeProcessors (
323- RuleVisitorRegistry registry,
324- RuleContext context,
325- ) {
326- registry.addInstanceCreationExpression (
327- this ,
328- _InstanceVisitor (this , (node) {
329- if (! _interactiveWidgets.contains (
330- node.constructorName.type.name.lexeme,
331- )) {
332- return ;
333- }
334- final minimumSize = _namedArgument (node.argumentList, "minimumSize" );
335- if (minimumSize == null ) {
336- reportAtNode (node);
337- }
338- }),
339- );
340- }
341- }
342-
343299class AddHapticFeedbackOnUserInteractionRule extends _SolvroRule {
344300 AddHapticFeedbackOnUserInteractionRule ()
345301 : super (
@@ -455,38 +411,6 @@ class FreezedMissingMixinRule extends _SolvroRule {
455411 }
456412}
457413
458- class FreezedMissingPrivateEmptyConstructorRule extends _SolvroRule {
459- FreezedMissingPrivateEmptyConstructorRule ()
460- : super (
461- const LintCode (
462- "freezed_missing_private_empty_constructor" ,
463- "Freezed classes should declare a private empty constructor." ,
464- ),
465- "Ensures @freezed classes include ClassName._()." ,
466- );
467-
468- @override
469- void registerNodeProcessors (
470- RuleVisitorRegistry registry,
471- RuleContext context,
472- ) {
473- registry.addClassDeclaration (
474- this ,
475- _ClassVisitor (this , (node) {
476- if (! _hasFreezedAnnotation (node.metadata)) return ;
477- final hasPrivateEmptyCtor = node.body.members
478- .whereType <ConstructorDeclaration >()
479- .any (
480- (ctor) =>
481- ctor.name? .lexeme == "_" &&
482- ctor.parameters.parameters.isEmpty,
483- );
484- if (! hasPrivateEmptyCtor) reportAtToken (node.namePart.typeName);
485- }),
486- );
487- }
488- }
489-
490414bool _hasFreezedAnnotation (NodeList <Annotation > metadata) => metadata.any ((a) {
491415 final name = a.name.name;
492416 return name == "freezed" || name == "Freezed" ;
0 commit comments