fix(android): 键盘弹出不再压缩整页

This commit is contained in:
Zhou Weidong committed 2026-10-21 12:14:09 +08:00
1 parent 5160ab437d
commit dbeb9883a5
3 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustNothing">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
+1 -1
View File
@@ -184,7 +184,7 @@ class _AuthPageState extends State<AuthPage> {
return Theme( return Theme(
data: AppTheme.light(), data: AppTheme.light(),
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: false,
backgroundColor: AppColors.ink, backgroundColor: AppColors.ink,
body: Stack( body: Stack(
children: [ children: [
@@ -389,6 +389,7 @@ void main() {
final first = find.byKey(const Key('comment-item-10')); final first = find.byKey(const Key('comment-item-10'));
final sheetTop = tester.getTopLeft(sheet).dy; final sheetTop = tester.getTopLeft(sheet).dy;
final inputTop = tester.getTopLeft(input).dy; final inputTop = tester.getTopLeft(input).dy;
final inputBottom = tester.getBottomLeft(input).dy;
final firstTop = tester.getTopLeft(first).dy; final firstTop = tester.getTopLeft(first).dy;
tester.view.viewInsets = const FakeViewPadding(bottom: 180); tester.view.viewInsets = const FakeViewPadding(bottom: 180);
@@ -398,6 +399,7 @@ void main() {
expect(tester.getTopLeft(sheet).dy, closeTo(sheetTop, 0.1)); expect(tester.getTopLeft(sheet).dy, closeTo(sheetTop, 0.1));
expect(tester.getTopLeft(first).dy, closeTo(firstTop, 0.1)); expect(tester.getTopLeft(first).dy, closeTo(firstTop, 0.1));
expect(tester.getTopLeft(input).dy, lessThan(inputTop - 100)); expect(tester.getTopLeft(input).dy, lessThan(inputTop - 100));
expect(tester.getBottomLeft(input).dy, closeTo(inputBottom - 180, 0.1));
}); });
testWidgets('should_hide_comment_like_controls', (tester) async { testWidgets('should_hide_comment_like_controls', (tester) async {