platform/lib/angel_model.dart

17 lines
434 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.
2017-07-11 20:46:12 +00:00
String id;
2018-12-31 00:30:23 +00:00
/// The time at which this item was created.
2017-07-11 20:46:12 +00:00
DateTime createdAt;
2018-12-31 00:30:23 +00:00
/// The last time at which this item was updated.
2017-07-11 20:46:12 +00:00
DateTime updatedAt;
Model({this.id, this.createdAt, this.updatedAt});
2018-12-31 00:30:23 +00:00
/// Returns the [id], parsed as an [int].
2019-03-29 00:51:02 +00:00
int get idAsInt => int.tryParse(id);
2018-12-31 00:30:23 +00:00
}