refactor: Switch to Hive Collections DB
This commit is contained in:
parent
db8c8dda22
commit
c249ebb97c
29 changed files with 347 additions and 216 deletions
|
|
@ -262,32 +262,47 @@ class ChatListItem extends StatelessWidget {
|
|||
),
|
||||
softWrap: false,
|
||||
)
|
||||
: Text(
|
||||
room.membership == Membership.invite
|
||||
? L10n.of(context)!.youAreInvitedToThisChat
|
||||
: room.lastEvent?.getLocalizedBody(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
hideReply: true,
|
||||
hideEdit: true,
|
||||
plaintextBody: true,
|
||||
removeMarkdown: true,
|
||||
withSenderNamePrefix: !room.isDirectChat ||
|
||||
room.directChatMatrixID !=
|
||||
room.lastEvent?.senderId,
|
||||
) ??
|
||||
L10n.of(context)!.emptyChat,
|
||||
softWrap: false,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: unread
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Theme.of(context).textTheme.bodyText2!.color,
|
||||
decoration: room.lastEvent?.redacted == true
|
||||
? TextDecoration.lineThrough
|
||||
: null,
|
||||
),
|
||||
),
|
||||
: FutureBuilder<String>(
|
||||
future: room.lastEvent?.calcLocalizedBody(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
hideReply: true,
|
||||
hideEdit: true,
|
||||
plaintextBody: true,
|
||||
removeMarkdown: true,
|
||||
withSenderNamePrefix: !room.isDirectChat ||
|
||||
room.directChatMatrixID !=
|
||||
room.lastEvent?.senderId,
|
||||
) ??
|
||||
Future.value(L10n.of(context)!.emptyChat),
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
room.membership == Membership.invite
|
||||
? L10n.of(context)!.youAreInvitedToThisChat
|
||||
: snapshot.data ??
|
||||
room.lastEvent?.calcLocalizedBodyFallback(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
hideReply: true,
|
||||
hideEdit: true,
|
||||
plaintextBody: true,
|
||||
removeMarkdown: true,
|
||||
withSenderNamePrefix: !room.isDirectChat ||
|
||||
room.directChatMatrixID !=
|
||||
room.lastEvent?.senderId,
|
||||
) ??
|
||||
L10n.of(context)!.emptyChat,
|
||||
softWrap: false,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: unread
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Theme.of(context).textTheme.bodyText2!.color,
|
||||
decoration: room.lastEvent?.redacted == true
|
||||
? TextDecoration.lineThrough
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
AnimatedContainer(
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
(client) => PopupMenuItem(
|
||||
value: client,
|
||||
child: FutureBuilder<Profile>(
|
||||
future: client!.ownProfile,
|
||||
future: client!.fetchOwnProfile(),
|
||||
builder: (context, snapshot) => Row(
|
||||
children: [
|
||||
Avatar(
|
||||
|
|
@ -90,7 +90,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
matrix.accountBundles.forEach((key, value) => clientCount += value.length);
|
||||
return Center(
|
||||
child: FutureBuilder<Profile>(
|
||||
future: matrix.client.ownProfile,
|
||||
future: matrix.client.fetchOwnProfile(),
|
||||
builder: (context, snapshot) => Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue