Merge pull request #555 from reinhart1010/keyboard-dynamic-theme
feat: Dynamic theming for emoji keyboard
This commit is contained in:
commit
7bd94d4c3b
2 changed files with 28 additions and 0 deletions
|
|
@ -776,6 +776,11 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"emoteKeyboardNoRecents": "Recently-used emotes will appear here...",
|
||||||
|
"@emoteKeyboardNoRecents": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"emotePacks": "Emote packs for room",
|
"emotePacks": "Emote packs for room",
|
||||||
"@emotePacks": {
|
"@emotePacks": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:emoji_picker_flutter/emoji_picker_flutter.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 'package:fluffychat/config/themes.dart';
|
||||||
import 'chat.dart';
|
import 'chat.dart';
|
||||||
|
|
@ -11,6 +12,7 @@ class ChatEmojiPicker extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final ThemeData theme = Theme.of(context);
|
||||||
return AnimatedContainer(
|
return AnimatedContainer(
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
curve: FluffyThemes.animationCurve,
|
curve: FluffyThemes.animationCurve,
|
||||||
|
|
@ -21,6 +23,27 @@ class ChatEmojiPicker extends StatelessWidget {
|
||||||
? EmojiPicker(
|
? EmojiPicker(
|
||||||
onEmojiSelected: controller.onEmojiSelected,
|
onEmojiSelected: controller.onEmojiSelected,
|
||||||
onBackspacePressed: controller.emojiPickerBackspace,
|
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,
|
: null,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue