linter icon indicating copy to clipboard operation
linter copied to clipboard

https://dart-lang.github.io/linter/lints/no_logic_in_create_state.html page lacks of advices

Open Nashev opened this issue 3 years ago • 2 comments

Describe the issue When a newbie falls on linter check no_logic_in_create_state (#1875) and goes to that page, he can't realise how to write a workaround instead of bad code.

To Reproduce Write code like https://github.com/aliyigitbireroglu/flutter-image-sequence-animator/blob/877234de33f6a6dea42ff762e8610360927b92db/image_sequence_animator/lib/image_sequence_animator.dart#L122, obtain linter warning and go to the documentation on page https://dart-lang.github.io/linter/lints/no_logic_in_create_state.html

Try to find a workaround. Miss them...

Expected behaviour A clear and concise description of what you can do instead of using State's constructor arguments. Mentions of https://api.flutter.dev/flutter/widgets/State-class.html with links to initState and didChangeDependencies would be helpful there.

Nashev avatar Feb 02 '22 10:02 Nashev

I also can't read the very long sentence at https://dart-lang.github.io/linter/lints/no_logic_in_create_state.html.

And I agree, the GOOD example does not how/where to set field to 42.

srawlins avatar Oct 25 '22 23:10 srawlins

I'm going to take a stab at this.

stereotype441 avatar Feb 07 '24 18:02 stereotype441