Skip to content

Instantly share code, notes, and snippets.

@MaxGraey
Created July 22, 2022 08:14
Show Gist options
  • Save MaxGraey/df0be72a941f4d515a5ecfec6a8ee7d9 to your computer and use it in GitHub Desktop.
Save MaxGraey/df0be72a941f4d515a5ecfec6a8ee7d9 to your computer and use it in GitHub Desktop.
unsolvable null-safety in Dart
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