mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 评论回复State对象失效
This commit is contained in:
@@ -111,18 +111,20 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
super.didChangeMetrics();
|
super.didChangeMetrics();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
// 键盘高度
|
// 键盘高度
|
||||||
final viewInsets = EdgeInsets.fromViewPadding(
|
if (mounted) {
|
||||||
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
final viewInsets = EdgeInsets.fromViewPadding(
|
||||||
_debouncer.run(() {
|
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
||||||
if (mounted) {
|
_debouncer.run(() {
|
||||||
if (keyboardHeight == 0 && emoteHeight == 0) {
|
if (mounted) {
|
||||||
setState(() {
|
if (keyboardHeight == 0 && emoteHeight == 0) {
|
||||||
emoteHeight = keyboardHeight =
|
setState(() {
|
||||||
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
emoteHeight = keyboardHeight =
|
||||||
});
|
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +133,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
_replyContentController.dispose();
|
_replyContentController.dispose();
|
||||||
replyContentFocusNode.removeListener(() {});
|
replyContentFocusNode.removeListener(() {});
|
||||||
|
replyContentFocusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user