platform/packages/model/lib/angel3_model.dart
2021-12-10 13:18:29 +08:00

18 lines
487 B
Dart

//library angel3_model;
/// 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 ? int.tryParse(id!) ?? -1 : -1;
}