Merge branch 'fix'

This commit is contained in:
guozhigq
2024-03-01 00:15:14 +08:00
3 changed files with 62 additions and 55 deletions

View File

@ -88,9 +88,7 @@ class _UpPanelState extends State<UpPanel> {
Container(
height: 90,
color: Theme.of(context).colorScheme.background,
child: Row(
children: [
Expanded(
child: Expanded(
child: ListView(
scrollDirection: Axis.horizontal,
controller: scrollController,
@ -117,8 +115,6 @@ class _UpPanelState extends State<UpPanel> {
],
),
),
],
),
),
Container(
height: 6,

View File

@ -109,6 +109,8 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
@override
void didChangeMetrics() {
super.didChangeMetrics();
final String routePath = Get.currentRoute;
if (mounted && routePath.startsWith('/video')) {
WidgetsBinding.instance.addPostFrameCallback((_) {
// 键盘高度
final viewInsets = EdgeInsets.fromViewPadding(
@ -125,17 +127,22 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
});
});
}
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
_replyContentController.dispose();
replyContentFocusNode.removeListener(() {});
replyContentFocusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
double keyboardHeight = EdgeInsets.fromViewPadding(
View.of(context).viewInsets, View.of(context).devicePixelRatio)
.bottom;
return Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(

View File

@ -51,6 +51,8 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
@override
void didChangeMetrics() {
super.didChangeMetrics();
final String routePath = Get.currentRoute;
if (mounted && routePath.startsWith('/whisper_detail')) {
WidgetsBinding.instance.addPostFrameCallback((_) {
// 键盘高度
final viewInsets = EdgeInsets.fromViewPadding(
@ -67,11 +69,13 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
});
});
}
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
replyContentFocusNode.removeListener(() {});
replyContentFocusNode.dispose();
super.dispose();
}