nc-photos/lib/or_null.dart

11 lines
305 B
Dart
Raw Normal View History

2021-04-28 21:22:33 +02:00
/// To hold optional arguments that themselves could be null
class OrNull<T> {
OrNull(this.obj);
2021-07-23 22:05:57 +02:00
/// Return iff the value of [x] is set to null, which means if [x] itself is
/// null, false will still be returned
static bool isSetNull(OrNull? x) => x != null && x.obj == null;
2021-05-28 19:15:09 +02:00
2021-07-23 22:05:57 +02:00
final T? obj;
2021-04-28 21:22:33 +02:00
}