Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[Rule change] avoid-late-keyword to allow late for AnimationControllers #1007

Closed
@illia-romanenko

Description

@illia-romanenko

What rule do you want to change?
avoid-late-keyword

How will the change be implemented? (New option, new default behavior, etc.)?
new behavior
Please provide some example code that this change will affect:

It looks like using late is pretty idiomatic for AnimationController: https://api.flutter.dev/flutter/animation/AnimationController-class.html

class _FooState extends State<Foo> with SingleTickerProviderStateMixin {
  late AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(
      vsync: this, // the SingleTickerProviderStateMixin
      duration: widget.duration,
    );
  }

What does the rule currently do for this code?
Flags
What will the rule do after it's changed?
Don't flag late with AnimationControllers

Are you willing to submit a pull request to implement this change?
I'm not sure yet.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions