feat: Add default chat wallpaper
This commit is contained in:
parent
32d868b5bd
commit
7d8369ab30
7 changed files with 47 additions and 29 deletions
BIN
assets/chat_wallpaper_dark.png
Normal file
BIN
assets/chat_wallpaper_dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
BIN
assets/chat_wallpaper_light.png
Normal file
BIN
assets/chat_wallpaper_light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
|
|
@ -9,7 +9,6 @@ import 'package:fluffychat/pages/chat/events/message.dart';
|
|||
import 'package:fluffychat/pages/chat/seen_by_row.dart';
|
||||
import 'package:fluffychat/pages/chat/typing_indicators.dart';
|
||||
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
|
||||
import 'package:fluffychat/utils/account_config.dart';
|
||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
|
|
@ -34,10 +33,6 @@ class ChatEventList extends StatelessWidget {
|
|||
for (var i = 0; i < events.length; i++) {
|
||||
thisEventsKeyMap[events[i].eventId] = i;
|
||||
}
|
||||
|
||||
final hasWallpaper =
|
||||
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
|
||||
|
||||
return SelectionArea(
|
||||
child: ListView.custom(
|
||||
padding: EdgeInsets.only(
|
||||
|
|
@ -142,8 +137,7 @@ class ChatEventList extends StatelessWidget {
|
|||
i > 0 && controller.readMarkerEventId == event.eventId,
|
||||
nextEvent: i + 1 < events.length ? events[i + 1] : null,
|
||||
previousEvent: i > 0 ? events[i - 1] : null,
|
||||
avatarPresenceBackgroundColor:
|
||||
hasWallpaper ? Colors.transparent : null,
|
||||
avatarPresenceBackgroundColor: Colors.transparent,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -260,18 +260,30 @@ class ChatView extends StatelessWidget {
|
|||
onDragExited: controller.onDragExited,
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
if (accountConfig.wallpaperUrl != null)
|
||||
Opacity(
|
||||
opacity: accountConfig.wallpaperOpacity ?? 1,
|
||||
child: MxcImage(
|
||||
uri: accountConfig.wallpaperUrl,
|
||||
fit: BoxFit.cover,
|
||||
isThumbnail: true,
|
||||
width: FluffyThemes.columnWidth * 4,
|
||||
height: FluffyThemes.columnWidth * 4,
|
||||
placeholder: (_) => Container(),
|
||||
),
|
||||
),
|
||||
accountConfig.wallpaperUrl != null
|
||||
? Opacity(
|
||||
opacity: accountConfig.wallpaperOpacity ?? 1,
|
||||
child: MxcImage(
|
||||
uri: accountConfig.wallpaperUrl,
|
||||
fit: BoxFit.cover,
|
||||
isThumbnail: true,
|
||||
width: FluffyThemes.columnWidth * 4,
|
||||
height: FluffyThemes.columnWidth * 4,
|
||||
placeholder: (_) => Container(),
|
||||
),
|
||||
)
|
||||
: ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
theme.colorScheme.surfaceContainerHighest,
|
||||
BlendMode.color,
|
||||
),
|
||||
child: Image.asset(
|
||||
'assets/chat_wallpaper_${theme.brightness.name}.png',
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
),
|
||||
),
|
||||
SafeArea(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
|
|
@ -308,10 +320,7 @@ class ChatView extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
child: Material(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
color: theme
|
||||
.colorScheme
|
||||
// ignore: deprecated_member_use
|
||||
.surfaceVariant,
|
||||
color: theme.colorScheme.surfaceBright,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(24),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Message extends StatelessWidget {
|
|||
final ownMessage = event.senderId == client.userID;
|
||||
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 ||
|
||||
nextEvent == null ||
|
||||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
|
|
@ -27,11 +28,27 @@ class RoomCreationStateEvent extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
roomName,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
style: TextStyle(
|
||||
fontSize: 24 * AppConfig.fontSizeFactor,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: theme.colorScheme.surface,
|
||||
blurRadius: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${event.originServerTs.localizedTime(context)} | ${l10n.countParticipants((event.room.summary.mJoinedMemberCount ?? 1) + (event.room.summary.mInvitedMemberCount ?? 0))}',
|
||||
style: theme.textTheme.labelSmall,
|
||||
style: TextStyle(
|
||||
fontSize: 12 * AppConfig.fontSizeFactor,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: theme.colorScheme.surface,
|
||||
blurRadius: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 48),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -81,9 +81,7 @@ class TypingIndicators extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(width: 8),
|
||||
Material(
|
||||
color:
|
||||
// ignore: deprecated_member_use
|
||||
theme.colorScheme.surfaceVariant,
|
||||
color: theme.colorScheme.surfaceBright,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue