This project uses strict linting rules to maintain high code quality. The linting configuration is defined in analysis_options.yaml.
If you encounter lint warnings that you want to suppress, you have several options:
Add rules to the analysis_options.yaml file to disable them project-wide:
linter:
rules:
# Disable specific rules
avoid_print: false
public_member_api_docs: false
lines_longer_than_80_chars: falseAdd comments at the top of specific files:
// ignore_for_file: unused_import, prefer_const_constructorsAdd comments above specific lines:
// ignore: avoid_print
print('Debug message');# Run analysis with warnings as errors (default)
dart analyze --fatal-infos
# Run analysis but don't treat warnings as fatal
dart analyze --no-fatal-warnings
# Check specific files
dart analyze lib/src/effects/stagger_effect.dart- prefer_const_constructors: Enforces const constructors where possible
- avoid_unnecessary_containers: Prevents unnecessary Container widgets
- prefer_const_literals_to_create_immutables: Use const for immutable collections
- sized_box_for_whitespace: Use SizedBox instead of Container for spacing
- use_key_in_widget_constructors: Require keys in widget constructors
Some strict rules are disabled for better developer experience:
- avoid_print: Allows print statements (useful for examples)
- public_member_api_docs: Doesn't require docs on all public members
- lines_longer_than_80_chars: Allows longer lines for readability
- file_names: Flexible file naming conventions
- constant_identifier_names: Allows ALL_CAPS constants
The stagger effect has been enhanced with robust widget tree traversal using Element.visitChildren(). This allows the effect to find and animate nested widgets reliably, even when they're wrapped in containers or other layout widgets.
- Deep Traversal: Uses
Element.visitChildren()for comprehensive widget discovery - Element Selector: Advanced filtering based on Element properties (size, position, etc.)
- Fallback Support: Falls back to widget-based traversal when element traversal fails
- Performance Optimized: Configurable limits to prevent performance issues
// Basic stagger with automatic widget detection
RouteShifterBuilder()
.stagger(interval: Duration(milliseconds: 100))
.fade()
.toRoute(page: NextPage())
// Advanced stagger with element-based filtering
RouteShifterBuilder()
.stagger(
interval: Duration(milliseconds: 80),
elementSelector: (element) {
final widget = element.widget;
final size = element.size;
return (widget is Card || widget is Material) &&
size != null &&
size.height > 50;
},
baseEffect: ScaleEffect(start: 0.8),
)
.toRoute(page: NextPage())The enhanced stagger effect can be tested using the demo file:
// Run the example
flutter run example/lib/stagger_demo.dartThis provides interactive demonstrations of:
- Basic stagger animations
- Advanced element-based selection
- Reverse stagger ordering
- Nested widget detection