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({ Room({
this.id, this.id,
this.membership = Membership.join, this.membership = Membership.join,
this.notificationCount = 0, int notificationCount,
this.highlightCount = 0, int highlightCount,
this.prev_batch = '', String prev_batch,
this.client, this.client,
this.notificationSettings, this.notificationSettings,
this.mHeroes = const [], this.mHeroes = const [],
this.mInvitedMemberCount = 0, int mInvitedMemberCount,
this.mJoinedMemberCount = 0, int mJoinedMemberCount,
this.roomAccountData = const {}, this.roomAccountData = const {},
double newestSortOrder = 0.0, double newestSortOrder = 0.0,
double oldestSortOrder = 0.0, double oldestSortOrder = 0.0,
}) : _newestSortOrder = newestSortOrder, }) : _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 /// The default count of how much events should be requested when requesting the
/// history of this room. /// history of this room.