You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final list =<String>[];
final newList = list.cast<int>(); //Badfinal map = list asMap<String, dynamic>; //Bad
Good Examples
final list =<num>[];
final newList = list.cast<int>(); //Goodfinal iterable = list asIterable; //Good
Discussion
Inspired by #5052. I believe if this is ever implemented, it should be added to Effective Dart.
Discussion checklist
List any existing rules this proposal modifies, complements, overlaps or conflicts with.
List any relevant issues (reported here, the [SDK Tracker], or elsewhere).
If there's any prior art (e.g., in other linters), please add references here.
If this proposal corresponds to [Effective Dart] or [Flutter Style Guide] advice, please call it out. (If there isn't any corresponding advice, should there be?)
If this proposal is motivated by real-world examples, please provide as many details as you can. Demonstrating potential impact is especially valuable.
The text was updated successfully, but these errors were encountered:
unrelated_type_cast
Kind
Guard against errors.
Bad Examples
Good Examples
Discussion
Inspired by #5052. I believe if this is ever implemented, it should be added to Effective Dart.
Discussion checklist
The text was updated successfully, but these errors were encountered: