chore: Follow up new chat design
This commit is contained in:
parent
4857684655
commit
4ec70bd25c
4 changed files with 119 additions and 114 deletions
|
|
@ -34,6 +34,7 @@ class ChatEventList extends StatelessWidget {
|
||||||
for (var i = 0; i < events.length; i++) {
|
for (var i = 0; i < events.length; i++) {
|
||||||
thisEventsKeyMap[events[i].eventId] = i;
|
thisEventsKeyMap[events[i].eventId] = i;
|
||||||
}
|
}
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
final hasWallpaper =
|
final hasWallpaper =
|
||||||
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
|
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
|
||||||
|
|
@ -142,8 +143,9 @@ class ChatEventList extends StatelessWidget {
|
||||||
i > 0 && controller.readMarkerEventId == event.eventId,
|
i > 0 && controller.readMarkerEventId == event.eventId,
|
||||||
nextEvent: i + 1 < events.length ? events[i + 1] : null,
|
nextEvent: i + 1 < events.length ? events[i + 1] : null,
|
||||||
previousEvent: i > 0 ? events[i - 1] : null,
|
previousEvent: i > 0 ? events[i - 1] : null,
|
||||||
avatarPresenceBackgroundColor:
|
avatarPresenceBackgroundColor: hasWallpaper
|
||||||
hasWallpaper ? Colors.transparent : null,
|
? Colors.transparent
|
||||||
|
: theme.colorScheme.surfaceContainer,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,10 @@ class ChatView extends StatelessWidget {
|
||||||
onDragDone: controller.onDragDone,
|
onDragDone: controller.onDragDone,
|
||||||
onDragEntered: controller.onDragEntered,
|
onDragEntered: controller.onDragEntered,
|
||||||
onDragExited: controller.onDragExited,
|
onDragExited: controller.onDragExited,
|
||||||
|
child: DecoratedBox(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: theme.colorScheme.surfaceContainer,
|
||||||
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (accountConfig.wallpaperUrl != null)
|
if (accountConfig.wallpaperUrl != null)
|
||||||
|
|
@ -282,7 +286,8 @@ class ChatView extends StatelessWidget {
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (controller.timeline == null) {
|
if (controller.timeline == null) {
|
||||||
return const Center(
|
return const Center(
|
||||||
child: CircularProgressIndicator.adaptive(
|
child:
|
||||||
|
CircularProgressIndicator.adaptive(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -308,14 +313,12 @@ class ChatView extends StatelessWidget {
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Material(
|
child: Material(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
color: theme
|
color: theme.colorScheme.surfaceBright,
|
||||||
.colorScheme
|
|
||||||
// ignore: deprecated_member_use
|
|
||||||
.surfaceVariant,
|
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(24),
|
Radius.circular(24),
|
||||||
),
|
),
|
||||||
child: controller.room.isAbandonedDMRoom == true
|
child: controller.room.isAbandonedDMRoom ==
|
||||||
|
true
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceEvenly,
|
MainAxisAlignment.spaceEvenly,
|
||||||
|
|
@ -345,7 +348,8 @@ class ChatView extends StatelessWidget {
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.forum_outlined,
|
Icons.forum_outlined,
|
||||||
),
|
),
|
||||||
onPressed: controller.recreateChat,
|
onPressed:
|
||||||
|
controller.recreateChat,
|
||||||
label: Text(
|
label: Text(
|
||||||
L10n.of(context).reopenChat,
|
L10n.of(context).reopenChat,
|
||||||
),
|
),
|
||||||
|
|
@ -379,6 +383,7 @@ class ChatView extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ class Message extends StatelessWidget {
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
final ownMessage = event.senderId == client.userID;
|
final ownMessage = event.senderId == client.userID;
|
||||||
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
|
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
|
||||||
// ignore: deprecated_member_use
|
|
||||||
var color = theme.colorScheme.surfaceVariant;
|
var color = theme.colorScheme.surfaceBright;
|
||||||
final displayTime = event.type == EventTypes.RoomCreate ||
|
final displayTime = event.type == EventTypes.RoomCreate ||
|
||||||
nextEvent == null ||
|
nextEvent == null ||
|
||||||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,7 @@ class TypingIndicators extends StatelessWidget {
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Material(
|
Material(
|
||||||
color:
|
color: theme.colorScheme.surfaceBright,
|
||||||
// ignore: deprecated_member_use
|
|
||||||
theme.colorScheme.surfaceVariant,
|
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(AppConfig.borderRadius),
|
Radius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue