You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
703 B
Dart
25 lines
703 B
Dart
|
1 year ago
|
import 'package:matrix/matrix.dart';
|
||
|
|
|
||
|
9 months ago
|
import 'package:fluffychat/pangea/analytics_misc/constructs_model.dart';
|
||
|
|
import '../events/constants/pangea_event_types.dart';
|
||
|
1 year ago
|
|
||
|
1 year ago
|
class ConstructAnalyticsEvent {
|
||
|
|
late Event _event;
|
||
|
|
ConstructAnalyticsModel? contentCache;
|
||
|
|
ConstructAnalyticsEvent({required Event event}) {
|
||
|
|
_event = event;
|
||
|
1 year ago
|
if (event.type != PangeaEventTypes.construct) {
|
||
|
|
throw Exception(
|
||
|
|
"${event.type} should not be used to make a ConstructAnalyticsEvent",
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
1 year ago
|
Event get event => _event;
|
||
|
|
|
||
|
1 year ago
|
ConstructAnalyticsModel get content {
|
||
|
|
contentCache ??= ConstructAnalyticsModel.fromJson(event.content);
|
||
|
|
return contentCache as ConstructAnalyticsModel;
|
||
|
|
}
|
||
|
|
}
|