mod: 表情体验优化,代码整理

This commit is contained in:
orz12
2024-02-26 09:38:11 +08:00
parent f2805553ec
commit 11988a4f8e
13 changed files with 318 additions and 144 deletions

View File

@@ -102,7 +102,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
_replyContentController.value = TextEditingValue(
text: newText,
selection:
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
);
}
@@ -118,7 +118,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
if (keyboardHeight == 0 && emoteHeight == 0) {
setState(() {
emoteHeight = keyboardHeight =
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
});
}
}
@@ -221,15 +221,11 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
],
),
),
AnimatedSize(
curve: Curves.easeInOut,
duration: const Duration(milliseconds: 300),
child: SizedBox(
width: double.infinity,
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
child: EmotePanel(
onChoose: (package, emote) => onChooseEmote(package, emote),
),
SizedBox(
width: double.infinity,
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
child: EmotePanel(
onChoose: (package, emote) => onChooseEmote(package, emote),
),
),
],
@@ -255,4 +251,4 @@ class Debouncer {
callback();
});
}
}
}