mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-07-18 01:14:07 +00:00
update lottie
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
59bdfa4eef
commit
fe673c9e23
3 changed files with 14 additions and 12 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 72d9bd6320bca1f1d29c6e61c3821fed326c0abe
|
Subproject commit d99dba6a5e0eb13d7dcb38a842e64c23a1779f1c
|
||||||
|
|
@ -16,12 +16,16 @@ class ChatReactionSelectionView extends StatefulWidget {
|
||||||
class _ChatReactionSelectionView extends State<ChatReactionSelectionView> {
|
class _ChatReactionSelectionView extends State<ChatReactionSelectionView> {
|
||||||
List<String> _selectedEmojis = [];
|
List<String> _selectedEmojis = [];
|
||||||
|
|
||||||
|
/// Cache the emoji keys list once to avoid repeated Map.keys.toList() calls.
|
||||||
|
static final List<String> _allEmojis = EmojiAnimationComp.animatedIcons.keys
|
||||||
|
.toList();
|
||||||
|
|
||||||
List<String> _emojisFromSession() {
|
List<String> _emojisFromSession() {
|
||||||
final user = userService.currentUser;
|
final user = userService.currentUser;
|
||||||
if (user.preSelectedEmojies != null) {
|
if (user.preSelectedEmojies != null) {
|
||||||
return user.preSelectedEmojies!;
|
return user.preSelectedEmojies!;
|
||||||
}
|
}
|
||||||
return EmojiAnimationComp.animatedIcons.keys.toList().sublist(0, 6);
|
return _allEmojis.sublist(0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -60,22 +64,20 @@ class _ChatReactionSelectionView extends State<ChatReactionSelectionView> {
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 4,
|
crossAxisCount: 4,
|
||||||
),
|
),
|
||||||
itemCount: EmojiAnimationComp.animatedIcons.keys.length,
|
itemCount: _allEmojis.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final emoji = EmojiAnimationComp.animatedIcons.keys.elementAt(
|
final emoji = _allEmojis[index];
|
||||||
index,
|
final isSelected = _selectedEmojis.contains(emoji);
|
||||||
);
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _onEmojiSelected(emoji),
|
onTap: () => _onEmojiSelected(emoji),
|
||||||
child: Card(
|
child: Card(
|
||||||
color: _selectedEmojis.contains(emoji)
|
color: isSelected
|
||||||
? context.color.primary.withAlpha(150)
|
? context.color.primary.withAlpha(150)
|
||||||
: context.color.surface,
|
: context.color.surface,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SizedBox(
|
child: Text(
|
||||||
width: 40,
|
emoji,
|
||||||
height: 40,
|
style: const TextStyle(fontSize: 32),
|
||||||
child: EmojiAnimationComp(emoji: emoji),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.4.0+154
|
version: 0.4.0+155
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.0
|
sdk: ^3.11.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue