Skip to content

[Dot Shorthands] no_logic_in_create_state #60976

Open
@RohitSaily

Description

@RohitSaily

Dart SDK version: 3.9.0-252.0.dev (dev) (Thu Jun 19 05:08:58 2025 -0700) on "macos_x64"

class W extends StatefulWidget
{	@override WState createState()=>
		.new(); // ERROR: no_logic_in_create_state
}
class WState extends State<W>
	{}

.new() should not be treated as logic in create state, it is equivalent to just creating the state ie WState.new

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagefeature-dot-shorthandsImplementation of the dot shorthands feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions