Revert "chore: Follow up new chat design"

This reverts commit 4ec70bd25c.
pull/1425/head
Krille 4 months ago
parent 4ec70bd25c
commit 728854569c
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -34,7 +34,6 @@ 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;
@ -143,9 +142,8 @@ 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: hasWallpaper avatarPresenceBackgroundColor:
? Colors.transparent hasWallpaper ? Colors.transparent : null,
: theme.colorScheme.surfaceContainer,
), ),
); );
}, },

@ -258,130 +258,125 @@ class ChatView extends StatelessWidget {
onDragDone: controller.onDragDone, onDragDone: controller.onDragDone,
onDragEntered: controller.onDragEntered, onDragEntered: controller.onDragEntered,
onDragExited: controller.onDragExited, onDragExited: controller.onDragExited,
child: DecoratedBox( child: Stack(
decoration: BoxDecoration( children: <Widget>[
color: theme.colorScheme.surfaceContainer, if (accountConfig.wallpaperUrl != null)
), Opacity(
child: Stack( opacity: accountConfig.wallpaperOpacity ?? 1,
children: <Widget>[ child: MxcImage(
if (accountConfig.wallpaperUrl != null) uri: accountConfig.wallpaperUrl,
Opacity( fit: BoxFit.cover,
opacity: accountConfig.wallpaperOpacity ?? 1, isThumbnail: true,
child: MxcImage( width: FluffyThemes.columnWidth * 4,
uri: accountConfig.wallpaperUrl, height: FluffyThemes.columnWidth * 4,
fit: BoxFit.cover, placeholder: (_) => Container(),
isThumbnail: true,
width: FluffyThemes.columnWidth * 4,
height: FluffyThemes.columnWidth * 4,
placeholder: (_) => Container(),
),
), ),
SafeArea( ),
child: Column( SafeArea(
children: <Widget>[ child: Column(
Expanded( children: <Widget>[
child: GestureDetector( Expanded(
onTap: controller.clearSingleSelectedEvent, child: GestureDetector(
child: Builder( onTap: controller.clearSingleSelectedEvent,
builder: (context) { child: Builder(
if (controller.timeline == null) { builder: (context) {
return const Center( if (controller.timeline == null) {
child: return const Center(
CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
strokeWidth: 2, strokeWidth: 2,
), ),
);
}
return ChatEventList(
controller: controller,
); );
}, }
), return ChatEventList(
controller: controller,
);
},
), ),
), ),
if (controller.room.canSendDefaultMessages && ),
controller.room.membership == Membership.join) if (controller.room.canSendDefaultMessages &&
Container( controller.room.membership == Membership.join)
margin: EdgeInsets.only( Container(
bottom: bottomSheetPadding, margin: EdgeInsets.only(
left: bottomSheetPadding, bottom: bottomSheetPadding,
right: bottomSheetPadding, left: bottomSheetPadding,
), right: bottomSheetPadding,
constraints: const BoxConstraints( ),
maxWidth: FluffyThemes.columnWidth * 2.5, constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 2.5,
),
alignment: Alignment.center,
child: Material(
clipBehavior: Clip.hardEdge,
color: theme
.colorScheme
// ignore: deprecated_member_use
.surfaceVariant,
borderRadius: const BorderRadius.all(
Radius.circular(24),
), ),
alignment: Alignment.center, child: controller.room.isAbandonedDMRoom == true
child: Material( ? Row(
clipBehavior: Clip.hardEdge, mainAxisAlignment:
color: theme.colorScheme.surfaceBright, MainAxisAlignment.spaceEvenly,
borderRadius: const BorderRadius.all( children: [
Radius.circular(24), TextButton.icon(
), style: TextButton.styleFrom(
child: controller.room.isAbandonedDMRoom == padding: const EdgeInsets.all(
true 16,
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
TextButton.icon(
style: TextButton.styleFrom(
padding: const EdgeInsets.all(
16,
),
foregroundColor:
theme.colorScheme.error,
),
icon: const Icon(
Icons.archive_outlined,
),
onPressed: controller.leaveChat,
label: Text(
L10n.of(context).leave,
), ),
foregroundColor:
theme.colorScheme.error,
), ),
TextButton.icon( icon: const Icon(
style: TextButton.styleFrom( Icons.archive_outlined,
padding: const EdgeInsets.all( ),
16, onPressed: controller.leaveChat,
), label: Text(
), L10n.of(context).leave,
icon: const Icon( ),
Icons.forum_outlined, ),
), TextButton.icon(
onPressed: style: TextButton.styleFrom(
controller.recreateChat, padding: const EdgeInsets.all(
label: Text( 16,
L10n.of(context).reopenChat,
), ),
), ),
], icon: const Icon(
) Icons.forum_outlined,
: Column( ),
mainAxisSize: MainAxisSize.min, onPressed: controller.recreateChat,
children: [ label: Text(
const ConnectionStatusHeader(), L10n.of(context).reopenChat,
ReactionsPicker(controller), ),
ReplyDisplay(controller), ),
ChatInputRow(controller), ],
ChatEmojiPicker(controller), )
], : Column(
), mainAxisSize: MainAxisSize.min,
), children: [
const ConnectionStatusHeader(),
ReactionsPicker(controller),
ReplyDisplay(controller),
ChatInputRow(controller),
ChatEmojiPicker(controller),
],
),
), ),
], ),
), ],
), ),
if (controller.dragging) ),
Container( if (controller.dragging)
color: theme.scaffoldBackgroundColor.withOpacity(0.9), Container(
alignment: Alignment.center, color: theme.scaffoldBackgroundColor.withOpacity(0.9),
child: const Icon( alignment: Alignment.center,
Icons.upload_outlined, child: const Icon(
size: 100, Icons.upload_outlined,
), size: 100,
), ),
], ),
), ],
), ),
), ),
); );

@ -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.surfaceBright; var color = theme.colorScheme.surfaceVariant;
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,7 +81,9 @@ class TypingIndicators extends StatelessWidget {
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Material( Material(
color: theme.colorScheme.surfaceBright, color:
// ignore: deprecated_member_use
theme.colorScheme.surfaceVariant,
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(AppConfig.borderRadius), Radius.circular(AppConfig.borderRadius),
), ),

Loading…
Cancel
Save