assertFeedModel static method
Implementation
static Future<FeedModel> assertFeedModel(FeedModel? feed,
String? feedIdentifier, String appId, String uniqueId) async {
if (feed == null) {
if (feedIdentifier == null) {
throw Exception('If feed is null, feedIdentifier needs to be supplied');
} else {
var newFeed = FeedModel(
documentID: constructDocumentId(
uniqueId: uniqueId, documentId: feedIdentifier),
appId: appId,
description: 'New feed',
thumbImage: ThumbStyle.thumbs,
photoPost: true,
videoPost: true,
messagePost: true,
audioPost: false,
albumPost: true,
articlePost: true);
await feedRepository(appId: appId)!.add(newFeed);
return newFeed;
}
} else {
return feed;
}
}