Created
July 22, 2022 08:14
-
-
Save MaxGraey/df0be72a941f4d515a5ecfec6a8ee7d9 to your computer and use it in GitHub Desktop.
unsolvable null-safety in Dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Holder { | |
List<String>? positions; | |
Holder(this.positions); | |
} | |
class Position { | |
String id = ""; | |
} | |
void updateHolder(Holder holder, Position position) { | |
if (holder.positions == null) { | |
holder.positions = []; | |
} | |
holder.positions.push(position.id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment