platform/packages/model/lib/angel_model.dart
Tobe O 106535751b Add 'packages/model/' from commit '308cd94c783dcf884d88c1e6660bc86510616387'
git-subtree-dir: packages/model
git-subtree-mainline: cf2ad35d2b
git-subtree-split: 308cd94c78
2020-02-15 18:28:32 -05:00

16 lines
454 B
Dart

/// Represents arbitrary data, with an associated ID and timestamps.
class Model {
/// A unique identifier corresponding to this item.
String id;
/// The time at which this item was created.
DateTime createdAt;
/// The last time at which this item was updated.
DateTime updatedAt;
Model({this.id, this.createdAt, this.updatedAt});
/// Returns the [id], parsed as an [int].
int get idAsInt => id == null ? null : int.tryParse(id);
}