final _set = [1, 1, 2, 3, 4].toSet(); besides effective dart suggesting prefer_collection_literals
it really looks like java or c# rather than dart (no offense)
does anybody knows
How to convert a
ListtoSetusing literals
(suggesting to add // ignore: prefer_collection_literals isn't an answer)
Set.fromisn't a literal, as a matter of fact my linter gives me the same warning, but you gave me an idea:Set.fromis actually aLinkedHashSetwhich is anexceptionmentioned here dart-lang.github.io/linter/lints/…