exampleBad property
String?
get
exampleBad
Short code example that VIOLATES this rule (shown in CLI walkthrough).
Override to provide a concise terminal-friendly snippet (2-5 lines max).
Displayed during dart run saropa_lints:init interactive stylistic
walkthrough to help users understand what the rule catches.
Return null to fall back to LintCode.correctionMessage in the
walkthrough display.
Example:
@override
String? get exampleBad => "import 'package:my_app/src/utils.dart';";
Implementation
// Use a named const sentinel instead of the literal `null`. This keeps the
// default semantics (no example provided) while avoiding function_always_returns_null,
// which treats `=> null` getters as unnecessary even when they are an
// intentional extension point for subclasses.
String? get exampleBad => _noExample;