fix: Make defaults catch if constructor is null

This commit is contained in:
Sorunome 2021-02-11 12:09:44 +01:00
parent ff04b1cce5
commit f08dabaf03
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 11 additions and 6 deletions

View File

@ -318,19 +318,24 @@ class Room {
Room({
this.id,
this.membership = Membership.join,
this.notificationCount = 0,
this.highlightCount = 0,
this.prev_batch = '',
int notificationCount,
int highlightCount,
String prev_batch,
this.client,
this.notificationSettings,
this.mHeroes = const [],
this.mInvitedMemberCount = 0,
this.mJoinedMemberCount = 0,
int mInvitedMemberCount,
int mJoinedMemberCount,
this.roomAccountData = const {},
double newestSortOrder = 0.0,
double oldestSortOrder = 0.0,
}) : _newestSortOrder = newestSortOrder,
_oldestSortOrder = oldestSortOrder;
_oldestSortOrder = oldestSortOrder,
notificationCount = notificationCount ?? 0,
highlightCount = highlightCount ?? 0,
prev_batch = prev_batch ?? '',
mInvitedMemberCount = mInvitedMemberCount ?? 0,
mJoinedMemberCount = mJoinedMemberCount ?? 0;
/// The default count of how much events should be requested when requesting the
/// history of this room.