feat: Dynamic theming for emoji keyboard

This commit is contained in:
Reinhart Previano Koentjoro 2023-09-03 00:15:58 +07:00
parent 0f73745607
commit e741765e22
No known key found for this signature in database
GPG key ID: D85D5839A1560FFB
2 changed files with 28 additions and 0 deletions

View file

@ -776,6 +776,11 @@
"type": "text",
"placeholders": {}
},
"emoteKeyboardNoRecents": "Recently-used emotes will appear here...",
"@emoteKeyboardNoRecents": {
"type": "text",
"placeholders": {}
},
"emotePacks": "Emote packs for room",
"@emotePacks": {
"type": "text",

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/config/themes.dart';
import 'chat.dart';
@ -11,6 +12,7 @@ class ChatEmojiPicker extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
@ -21,6 +23,27 @@ class ChatEmojiPicker extends StatelessWidget {
? EmojiPicker(
onEmojiSelected: controller.onEmojiSelected,
onBackspacePressed: controller.emojiPickerBackspace,
config: Config(
backspaceColor: theme.colorScheme.primary,
bgColor: Color.lerp(
theme.colorScheme.background,
theme.colorScheme.primaryContainer,
0.25,
)!,
iconColor: theme.colorScheme.primary.withOpacity(0.5),
iconColorSelected: theme.colorScheme.primary,
indicatorColor: theme.colorScheme.primary,
noRecents: Text(
L10n.of(context)!.emoteKeyboardNoRecents,
style: theme.textTheme.bodyLarge,
),
skinToneDialogBgColor: Color.lerp(
theme.colorScheme.background,
theme.colorScheme.primaryContainer,
0.75,
)!,
skinToneIndicatorColor: theme.colorScheme.onBackground,
),
)
: null,
);