platform/packages/model/lib/angel_model.dart

17 lines
459 B
Dart
Raw Normal View History

2017-07-11 20:46:12 +00:00
/// Represents arbitrary data, with an associated ID and timestamps.
class Model {
2018-12-31 00:30:23 +00:00
/// A unique identifier corresponding to this item.
2021-03-18 00:15:01 +00:00
String? id;
2018-12-31 00:30:23 +00:00
/// The time at which this item was created.
2021-03-18 00:15:01 +00:00
DateTime? createdAt;
2018-12-31 00:30:23 +00:00
/// The last time at which this item was updated.
2021-03-18 00:15:01 +00:00
DateTime? updatedAt;
2017-07-11 20:46:12 +00:00
Model({this.id, this.createdAt, this.updatedAt});
2018-12-31 00:30:23 +00:00
/// Returns the [id], parsed as an [int].
2021-03-18 00:15:01 +00:00
int? get idAsInt => id == null ? null : int.tryParse(id!);
2018-12-31 00:30:23 +00:00
}