fix(player): 键盘收起后保持评论输入弹窗位置
This commit is contained in:
1 parent
bc971c17d5
commit
bac42bc653
2 files changed
+16
-4
No files matched your search
@@ -39,6 +39,7 @@ class _CommentComposerSheetState extends State<CommentComposerSheet> {
|
||||
final _input = TextEditingController();
|
||||
final _inputFocus = FocusNode();
|
||||
final _keyboardInset = KeyboardInsetNotifier.instance;
|
||||
double _pinnedKeyboardInset = 0;
|
||||
bool _closing = false;
|
||||
|
||||
@override
|
||||
@@ -114,7 +115,8 @@ class _CommentComposerSheetState extends State<CommentComposerSheet> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final keyboardHeight = _keyboardHeight(context);
|
||||
final currentKeyboardInset = _keyboardHeight(context);
|
||||
_pinnedKeyboardInset = math.max(_pinnedKeyboardInset, currentKeyboardInset);
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final signedIn = context.watch<AuthController>().isSignedIn;
|
||||
final hasContent = _input.text.trim().isNotEmpty;
|
||||
@@ -139,7 +141,7 @@ class _CommentComposerSheetState extends State<CommentComposerSheet> {
|
||||
child: AnimatedPadding(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeOut,
|
||||
padding: EdgeInsets.only(bottom: keyboardHeight),
|
||||
padding: EdgeInsets.only(bottom: _pinnedKeyboardInset),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {},
|
||||
|
||||
Reference in new issue
Block a user