From 740ac0dc9c1c32a6660e25ff217ee95a6a32adbc Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 19 Jul 2019 19:09:34 +0200 Subject: [PATCH] [Classes] Non nullable id and mxcurl --- lib/src/User.dart | 4 ++-- lib/src/utils/MxContent.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/User.dart b/lib/src/User.dart index 907bdeaf..a45d101f 100644 --- a/lib/src/User.dart +++ b/lib/src/User.dart @@ -66,13 +66,13 @@ class User { MxContent get avatar_url => avatarUrl; User( - this.id, { + String id, { this.membership, this.displayName, this.avatarUrl, this.powerLevel, this.room, - }); + }) : this.id = id ?? ""; /// Returns the displayname or the local part of the Matrix ID if the user /// has no displayname. diff --git a/lib/src/utils/MxContent.dart b/lib/src/utils/MxContent.dart index d7a0c237..05f9bc7e 100644 --- a/lib/src/utils/MxContent.dart +++ b/lib/src/utils/MxContent.dart @@ -29,7 +29,7 @@ class MxContent { final String _mxc; /// Insert a mxc:// uri here. - MxContent(this._mxc); + MxContent(String mxcUrl) : this._mxc = mxcUrl ?? ""; /// Returns the mxc uri. get mxc => _mxc;