Refactor: Reduce .of(context) calls theme

Signed commit
This commit is contained in:
Thomas Klein Langenhorst 2024-08-04 14:09:36 +02:00
commit 5d2aaef3ca
No known key found for this signature in database
GPG key ID: CA868C3CB279DA5B
69 changed files with 525 additions and 501 deletions

View file

@ -1307,49 +1307,52 @@ class ChatController extends State<ChatPageWithRoom>
}
@override
Widget build(BuildContext context) => Row(
children: [
Expanded(
child: ChatView(this),
),
AnimatedSize(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
child: ValueListenableBuilder(
valueListenable: _displayChatDetailsColumn,
builder: (context, displayChatDetailsColumn, _) {
if (!FluffyThemes.isThreeColumnMode(context) ||
room.membership != Membership.join ||
!displayChatDetailsColumn) {
return const SizedBox(
height: double.infinity,
width: 0,
);
}
return Container(
width: FluffyThemes.columnWidth,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
border: Border(
left: BorderSide(
width: 1,
color: Theme.of(context).dividerColor,
),
),
),
child: ChatDetails(
roomId: roomId,
embeddedCloseButton: IconButton(
icon: const Icon(Icons.close),
onPressed: toggleDisplayChatDetailsColumn,
),
),
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Row(
children: [
Expanded(
child: ChatView(this),
),
AnimatedSize(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
child: ValueListenableBuilder(
valueListenable: _displayChatDetailsColumn,
builder: (context, displayChatDetailsColumn, _) {
if (!FluffyThemes.isThreeColumnMode(context) ||
room.membership != Membership.join ||
!displayChatDetailsColumn) {
return const SizedBox(
height: double.infinity,
width: 0,
);
},
),
}
return Container(
width: FluffyThemes.columnWidth,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
border: Border(
left: BorderSide(
width: 1,
color: theme.dividerColor,
),
),
),
child: ChatDetails(
roomId: roomId,
embeddedCloseButton: IconButton(
icon: const Icon(Icons.close),
onPressed: toggleDisplayChatDetailsColumn,
),
),
);
},
),
],
);
),
],
);
}
}
enum EmojiPickerType { reaction, keyboard }

View file

@ -22,6 +22,7 @@ class ChatAppBarListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final leading = this.leading;
final trailing = this.trailing;
return SizedBox(
@ -40,16 +41,15 @@ class ChatAppBarListTile extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
color: theme.colorScheme.onSurfaceVariant,
overflow: TextOverflow.ellipsis,
fontSize: 14,
),
linkStyle: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
color: theme.colorScheme.onSurfaceVariant,
fontSize: 14,
decoration: TextDecoration.underline,
decorationColor:
Theme.of(context).colorScheme.onSurfaceVariant,
decorationColor: theme.colorScheme.onSurfaceVariant,
),
onOpen: (url) => UrlLauncher(context, url.url).launchUrl(),
),

View file

@ -43,9 +43,8 @@ class ChatEmojiPicker extends StatelessWidget {
config: Config(
emojiViewConfig: EmojiViewConfig(
noRecents: const NoRecent(),
backgroundColor: Theme.of(context)
.colorScheme
.onInverseSurface,
backgroundColor:
theme.colorScheme.onInverseSurface,
),
bottomActionBarConfig: const BottomActionBarConfig(
enabled: false,

View file

@ -21,6 +21,7 @@ class ChatInputRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
if (controller.showEmojiPicker &&
controller.emojiPickerType == EmojiPickerType.reaction) {
return const SizedBox.shrink();
@ -37,7 +38,7 @@ class ChatInputRow extends StatelessWidget {
height: height,
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.error,
foregroundColor: theme.colorScheme.error,
),
onPressed: controller.deleteErrorEventsAction,
child: Row(
@ -278,9 +279,8 @@ class ChatInputRow extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(height),
),
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor:
Theme.of(context).colorScheme.onPrimary,
backgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.onPrimary,
child: const Icon(Icons.mic_none_outlined),
)
: FloatingActionButton.small(
@ -291,10 +291,8 @@ class ChatInputRow extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(height),
),
backgroundColor:
Theme.of(context).colorScheme.onPrimaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onPrimary,
backgroundColor: theme.colorScheme.onPrimaryContainer,
foregroundColor: theme.colorScheme.onPrimary,
child: const Icon(Icons.send_outlined),
),
),

View file

@ -128,6 +128,7 @@ class ChatView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
if (controller.room.membership == Membership.invite) {
showFutureLoadingDialog(
context: context,
@ -173,14 +174,14 @@ class ChatView extends StatelessWidget {
actionsIconTheme: IconThemeData(
color: controller.selectedEvents.isEmpty
? null
: Theme.of(context).colorScheme.primary,
: theme.colorScheme.primary,
),
leading: controller.selectMode
? IconButton(
icon: const Icon(Icons.close),
onPressed: controller.clearSelectedEvents,
tooltip: L10n.of(context)!.close,
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
)
: StreamBuilder<Object>(
stream: Matrix.of(context)
@ -218,8 +219,7 @@ class ChatView extends StatelessWidget {
if (scrollUpBannerEventId != null)
ChatAppBarListTile(
leading: IconButton(
color:
Theme.of(context).colorScheme.onSurfaceVariant,
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.close),
tooltip: L10n.of(context)!.close,
onPressed: () {
@ -308,7 +308,7 @@ class ChatView extends StatelessWidget {
alignment: Alignment.center,
child: Material(
clipBehavior: Clip.hardEdge,
color: Theme.of(context)
color: theme
.colorScheme
// ignore: deprecated_member_use
.surfaceVariant,
@ -325,9 +325,8 @@ class ChatView extends StatelessWidget {
padding: const EdgeInsets.all(
16,
),
foregroundColor: Theme.of(context)
.colorScheme
.error,
foregroundColor:
theme.colorScheme.error,
),
icon: const Icon(
Icons.archive_outlined,
@ -370,9 +369,7 @@ class ChatView extends StatelessWidget {
),
if (controller.dragging)
Container(
color: Theme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.9),
color: theme.scaffoldBackgroundColor.withOpacity(0.9),
alignment: Alignment.center,
child: const Icon(
Icons.upload_outlined,

View file

@ -36,6 +36,7 @@ class EventInfoDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.messageInfo),
@ -72,14 +73,14 @@ class EventInfoDialog extends StatelessWidget {
padding: const EdgeInsets.all(12.0),
child: Material(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
color: Theme.of(context).colorScheme.inverseSurface,
color: theme.colorScheme.inverseSurface,
child: SingleChildScrollView(
padding: const EdgeInsets.all(8),
scrollDirection: Axis.horizontal,
child: SelectableText(
prettyJson,
style: TextStyle(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
),
),
),

View file

@ -206,6 +206,8 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final statusText = this.statusText ??= _durationString ?? '00:00';
final audioPlayer = this.audioPlayer;
return Padding(
@ -292,8 +294,8 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
: Text(
'${audioPlayer.speed.toString()}x',
),
backgroundColor: Theme.of(context).colorScheme.secondary,
textColor: Theme.of(context).colorScheme.onSecondary,
backgroundColor: theme.colorScheme.secondary,
textColor: theme.colorScheme.onSecondary,
child: InkWell(
splashColor: widget.color.withAlpha(128),
borderRadius: BorderRadius.circular(64),

View file

@ -67,6 +67,8 @@ class ImageBubble extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final borderRadius =
this.borderRadius ?? BorderRadius.circular(AppConfig.borderRadius);
return Material(
@ -77,7 +79,7 @@ class ImageBubble extends StatelessWidget {
side: BorderSide(
color: event.messageType == MessageTypes.Sticker
? Colors.transparent
: Theme.of(context).dividerColor,
: theme.dividerColor,
),
),
child: InkWell(

View file

@ -22,6 +22,8 @@ class MapBubble extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return ClipRRect(
borderRadius: BorderRadius.circular(radius),
child: Container(
@ -72,11 +74,10 @@ class MapBubble extends StatelessWidget {
child: Text(
' © OpenStreetMap contributors ',
style: TextStyle(
color: Theme.of(context).brightness == Brightness.dark
color: theme.brightness == Brightness.dark
? Colors.white
: Colors.black,
backgroundColor:
Theme.of(context).appBarTheme.backgroundColor,
backgroundColor: theme.appBarTheme.backgroundColor,
),
),
),

View file

@ -57,6 +57,8 @@ class Message extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
if (!{
EventTypes.Message,
EventTypes.Sticker,
@ -78,7 +80,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.of(context).colorScheme.surfaceVariant;
var color = theme.colorScheme.surfaceVariant;
final displayTime = event.type == EventTypes.RoomCreate ||
nextEvent == null ||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
@ -100,9 +102,8 @@ class Message extends StatelessWidget {
previousEvent!.senderId == event.senderId &&
previousEvent!.originServerTs.sameEnvironment(event.originServerTs);
final textColor = ownMessage
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onSurface;
final textColor =
ownMessage ? theme.colorScheme.onPrimary : theme.colorScheme.onSurface;
final rowMainAxisAlignment =
ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start;
@ -131,7 +132,7 @@ class Message extends StatelessWidget {
if (ownMessage) {
color = displayEvent.status.isError
? Colors.redAccent
: Theme.of(context).colorScheme.primary;
: theme.colorScheme.primary;
}
final resetAnimateIn = this.resetAnimateIn;
@ -168,14 +169,10 @@ class Message extends StatelessWidget {
borderRadius:
BorderRadius.circular(AppConfig.borderRadius / 2),
color: selected
? Theme.of(context)
.colorScheme
.secondaryContainer
? theme.colorScheme.secondaryContainer
.withAlpha(100)
: highlightMarker
? Theme.of(context)
.colorScheme
.tertiaryContainer
? theme.colorScheme.tertiaryContainer
.withAlpha(100)
: Colors.transparent,
),
@ -253,8 +250,7 @@ class Message extends StatelessWidget {
displayname,
style: TextStyle(
fontSize: 12,
color: (Theme.of(context)
.brightness ==
color: (theme.brightness ==
Brightness.light
? displayname.color
: displayname
@ -442,10 +438,10 @@ class Message extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12 * AppConfig.fontSizeFactor,
color: Theme.of(context).colorScheme.secondary,
color: theme.colorScheme.secondary,
shadows: [
Shadow(
color: Theme.of(context).colorScheme.surface,
color: theme.colorScheme.surface,
blurRadius: 3,
),
],
@ -473,14 +469,14 @@ class Message extends StatelessWidget {
Row(
children: [
Expanded(
child: Divider(color: Theme.of(context).colorScheme.primary),
child: Divider(color: theme.colorScheme.primary),
),
Container(
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
color: Theme.of(context).colorScheme.primaryContainer,
color: theme.colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(4),
),
margin: const EdgeInsets.all(8.0),
@ -489,12 +485,11 @@ class Message extends StatelessWidget {
),
child: Text(
L10n.of(context)!.readUpToHere,
style:
TextStyle(color: Theme.of(context).colorScheme.primary),
style: TextStyle(color: theme.colorScheme.primary),
),
),
Expanded(
child: Divider(color: Theme.of(context).colorScheme.primary),
child: Divider(color: theme.colorScheme.primary),
),
],
),

View file

@ -108,10 +108,10 @@ class _Reaction extends StatelessWidget {
@override
Widget build(BuildContext context) {
final textColor = Theme.of(context).brightness == Brightness.dark
? Colors.white
: Colors.black;
final color = Theme.of(context).colorScheme.surface;
final theme = Theme.of(context);
final textColor =
theme.brightness == Brightness.dark ? Colors.white : Colors.black;
final color = theme.colorScheme.surface;
Widget content;
if (reactionKey.startsWith('mxc://')) {
content = Row(
@ -158,8 +158,8 @@ class _Reaction extends StatelessWidget {
border: Border.all(
width: 1,
color: reacted!
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.primaryContainer,
? theme.colorScheme.primary
: theme.colorScheme.primaryContainer,
),
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
),

View file

@ -27,20 +27,19 @@ class ReplyContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final timeline = this.timeline;
final displayEvent =
timeline != null ? replyEvent.getDisplayEvent(timeline) : replyEvent;
final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;
final color = ownMessage
? Theme.of(context).colorScheme.primaryContainer
: Theme.of(context).colorScheme.primary;
? theme.colorScheme.primaryContainer
: theme.colorScheme.primary;
return Material(
color: backgroundColor ??
Theme.of(context)
.colorScheme
.surface
.withOpacity(ownMessage ? 0.2 : 0.33),
theme.colorScheme.surface.withOpacity(ownMessage ? 0.2 : 0.33),
borderRadius: borderRadius,
child: Row(
mainAxisSize: MainAxisSize.min,
@ -81,8 +80,8 @@ class ReplyContent extends StatelessWidget {
maxLines: 1,
style: TextStyle(
color: ownMessage
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onSurface,
? theme.colorScheme.onPrimary
: theme.colorScheme.onSurface,
fontSize: fontSize,
),
),

View file

@ -12,6 +12,8 @@ class StateMessage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Center(
@ -27,7 +29,7 @@ class StateMessage extends StatelessWidget {
decoration: event.redacted ? TextDecoration.lineThrough : null,
shadows: [
Shadow(
color: Theme.of(context).colorScheme.surface,
color: theme.colorScheme.surface,
blurRadius: 3,
),
],

View file

@ -17,6 +17,8 @@ class VerificationRequestContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final events = event.aggregatedEvents(timeline, 'm.reference');
final done = events.where((e) => e.type == EventTypes.KeyVerificationDone);
final start =
@ -36,10 +38,10 @@ class VerificationRequestContent extends StatelessWidget {
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context).dividerColor,
color: theme.dividerColor,
),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
color: Theme.of(context).colorScheme.surface,
color: theme.colorScheme.surface,
),
child: Row(
mainAxisSize: MainAxisSize.min,

View file

@ -96,6 +96,8 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final hasThumbnail = widget.event.hasThumbnail;
final blurHash = (widget.event.infoMap as Map<String, dynamic>)
.tryGet<String>('xyz.amorgan.blurhash') ??
@ -123,7 +125,7 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
Center(
child: IconButton(
style: IconButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surface,
backgroundColor: theme.colorScheme.surface,
),
icon: _isDownloading
? const SizedBox(

View file

@ -221,6 +221,7 @@ class InputBar extends StatelessWidget {
Map<String, String?> suggestion,
Client? client,
) {
final theme = Theme.of(context);
const size = 30.0;
const padding = EdgeInsets.all(4.0);
if (suggestion['type'] == 'command') {
@ -242,7 +243,7 @@ class InputBar extends StatelessWidget {
hint,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall,
style: theme.textTheme.bodySmall,
),
],
),

View file

@ -53,6 +53,8 @@ class PinnedEvents extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final pinnedEventIds = controller.room.pinnedEventIds;
if (pinnedEventIds.isEmpty) {
@ -73,7 +75,7 @@ class PinnedEvents extends StatelessWidget {
leading: IconButton(
splashRadius: 18,
iconSize: 18,
color: Theme.of(context).colorScheme.onSurfaceVariant,
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context)!.unpin,
onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)

View file

@ -15,6 +15,8 @@ class ReactionsPicker extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
if (controller.showEmojiPicker) return const SizedBox.shrink();
final display = controller.editEvent == null &&
controller.replyEvent == null &&
@ -60,7 +62,7 @@ class ReactionsPicker extends StatelessWidget {
Expanded(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(AppConfig.borderRadius),
),
@ -92,7 +94,7 @@ class ReactionsPicker extends StatelessWidget {
width: 36,
height: 56,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
shape: BoxShape.circle,
),
child: const Icon(Icons.add_outlined),

View file

@ -113,6 +113,8 @@ class RecordingDialogState extends State<RecordingDialog> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
const maxDecibalWidth = 64.0;
final time =
'${_duration.inMinutes.toString().padLeft(2, '0')}:${(_duration.inSeconds % 60).toString().padLeft(2, '0')}';
@ -141,7 +143,7 @@ class RecordingDialogState extends State<RecordingDialog> {
margin: const EdgeInsets.only(left: 2),
width: 4,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
),
@ -167,11 +169,7 @@ class RecordingDialogState extends State<RecordingDialog> {
child: Text(
L10n.of(context)!.cancel.toUpperCase(),
style: TextStyle(
color: Theme.of(context)
.textTheme
.bodyMedium
?.color
?.withAlpha(150),
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
),
),
),
@ -191,8 +189,7 @@ class RecordingDialogState extends State<RecordingDialog> {
child: Text(
L10n.of(context)!.cancel.toUpperCase(),
style: TextStyle(
color:
Theme.of(context).textTheme.bodyMedium?.color?.withAlpha(150),
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
),
),
),

View file

@ -14,6 +14,8 @@ class ReplyDisplay extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
@ -22,7 +24,7 @@ class ReplyDisplay extends StatelessWidget {
: 0,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
),
child: Row(
children: <Widget>[
@ -55,6 +57,7 @@ class _EditContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final event = this.event;
if (event == null) {
return const SizedBox.shrink();
@ -63,7 +66,7 @@ class _EditContent extends StatelessWidget {
children: <Widget>[
Icon(
Icons.edit,
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
Container(width: 15.0),
Text(
@ -75,7 +78,7 @@ class _EditContent extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).textTheme.bodyMedium!.color,
color: theme.textTheme.bodyMedium!.color,
),
),
],

View file

@ -12,6 +12,8 @@ class SeenByRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final seenByUsers = controller.room.getSeenByUsers(controller.timeline!);
const maxAvatars = 7;
return Container(
@ -49,7 +51,7 @@ class SeenByRow extends StatelessWidget {
width: 16,
height: 16,
child: Material(
color: Theme.of(context).colorScheme.surface,
color: theme.colorScheme.surface,
borderRadius: BorderRadius.circular(32),
child: Center(
child: Text(

View file

@ -66,6 +66,8 @@ class SendFileDialogState extends State<SendFileDialog> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
var sendStr = L10n.of(context)!.sendFile;
final allFilesAreImages =
widget.files.every((file) => file is MatrixImageFile);
@ -91,9 +93,8 @@ class SendFileDialogState extends State<SendFileDialog> {
Flexible(
child: Material(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
elevation:
Theme.of(context).appBarTheme.scrolledUnderElevation ?? 4,
shadowColor: Theme.of(context).appBarTheme.shadowColor,
elevation: theme.appBarTheme.scrolledUnderElevation ?? 4,
shadowColor: theme.appBarTheme.shadowColor,
clipBehavior: Clip.hardEdge,
child: Image.memory(
widget.files.first.bytes,

View file

@ -27,6 +27,8 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final stickerPacks = widget.room.getImagePacks(ImagePackUsage.sticker);
final packSlugs = stickerPacks.keys.toList();
@ -100,7 +102,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
};
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.onInverseSurface,
backgroundColor: theme.colorScheme.onInverseSurface,
body: SizedBox(
width: double.maxFinite,
child: CustomScrollView(

View file

@ -14,6 +14,8 @@ class TypingIndicators extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
const avatarSize = Avatar.defaultSize / 2;
return StreamBuilder<Object>(
@ -81,7 +83,7 @@ class TypingIndicators extends StatelessWidget {
Material(
color:
// ignore: deprecated_member_use
Theme.of(context).colorScheme.surfaceVariant,
theme.colorScheme.surfaceVariant,
borderRadius: const BorderRadius.all(
Radius.circular(AppConfig.borderRadius),
),
@ -137,6 +139,7 @@ class __TypingDotsState extends State<_TypingDots> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
const size = 8.0;
return Row(
@ -154,7 +157,7 @@ class __TypingDotsState extends State<_TypingDots> {
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(size * 2),
color: Theme.of(context).colorScheme.secondary,
color: theme.colorScheme.secondary,
),
),
],