Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Dynamic theming for emoji keyboard #555

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions lib/pages/chat/chat_emoji_picker.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
Expand All @@ -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,
);
Expand Down
Loading