Skip to content

[Android] viewInsets.bottom jumps by the navigation bar height at the end of the IME open animation (edgeToEdge, API < 35) #190974

Closed as duplicate

Description

@gfx

Steps to reproduce

  1. Run the sample below on Android 14 (API 34).
  2. Tap edgeToEdge, then tap the text field to open the keyboard.
  3. Watch the logged viewInsets.bottom.

Expected results

The last value reported during the animation equals the settled value.

Actual results

The animation converges, and then viewInsets.bottom jumps in a single frame. Pixel 6
emulator, API 34, gesture navigation (viewPadding.bottom = 24.0):

insets=310.1 delta=2.3
insets=311.6 delta=1.5
insets=312.0 delta=0.4    <- converged
insets=336.4 delta=24.4   <- settled value, one frame later

The jump (24.4) matches viewPadding.bottom (24.0) modulo dp rounding. Anything laid out
from viewInsets.bottom stays 24dp low for the whole opening animation and then snaps.

What I measured

Same app and device, varying only the system UI mode and the OS version:

animation converges to settled value jump
API 34, edgeToEdge 312.0 336.4 +24.4
API 34, manual + overlays: [SystemUiOverlay.bottom] 312.4 312.4 none
API 35 emulator, both modes — — none
Android 17 (Pixel 8 Pro), both modes — — none

In manual mode on API 34, viewPadding.bottom is 0.0; in edgeToEdge it is 24.0.

Closing shows the mirror image: the first reported value after the settled one is
336.4 → 312.4 (−24.0), then the ramp down.

Code sample

main.dart
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  double? last;
  SchedulerBinding.instance.addPersistentFrameCallback((_) {
    final view = WidgetsBinding.instance.platformDispatcher.views.first;
    final i = view.viewInsets.bottom / view.devicePixelRatio;
    if (last == null || (i - last!).abs() > 0.01) {
      // ignore: avoid_print
      print('insets=${i.toStringAsFixed(1)} '
          'delta=${last == null ? 0 : (i - last!).toStringAsFixed(1)}');
      last = i;
    }
  });
  runApp(const MaterialApp(home: Home(), debugShowCheckedModeBanner: false));
}

class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    // The UI layer is lifted by viewInsets, so a mismatch between the animated
    // and the settled value is visible as a jump.
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Padding(
        padding: EdgeInsets.only(bottom: MediaQuery.viewInsetsOf(context).bottom),
        child: Column(
          children: [
            const SizedBox(height: 60),
            ElevatedButton(
              onPressed: () =>
                  SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge),
              child: const Text('edgeToEdge'),
            ),
            ElevatedButton(
              onPressed: () => SystemChrome.setEnabledSystemUIMode(
                  SystemUiMode.manual, overlays: const [SystemUiOverlay.bottom]),
              child: const Text('manual(bottom only)'),
            ),
            const Spacer(),
            Container(height: 8, color: Colors.red),
            const TextField(decoration: InputDecoration(hintText: 'tap me')),
          ],
        ),
      ),
    );
  }
}

Version

Flutter 3.44.5 - channel stable
Framework - revision f94f4fc76b (2026-07-06)
Engine - hash d3a3293399556a85388faf8c6f0723a7a5597aa8 (revision 83675ed276)
Tools - Dart 3.12.2

Related

#168768, #89914 — same user-visible symptom, both closed as fixed.

Activity

  1. changed the title [-][Android] IME animation insets are short by the navigation bar height for `SystemUiMode.edgeToEdge` apps on API < 35[/-] [+][Android] viewInsets.bottom jumps by the navigation bar height at the end of the IME open animation (edgeToEdge, API < 35)[/+] on Aug 12, 2026
  2. suryaKommana2662 commented on Aug 12, 2026

    @suryaKommana2662
    Contributor

    @gfx Thanks for report the issue. I was able to reproduce the issue locally on an Android API 34 emulator using the provided sample. I observed the following in the terminal:

    insets=307.8 delta=3.4
    insets=310.1 delta=2.3
    insets=311.6 delta=1.5
    insets=312.0 delta=0.4
    insets=336.4 delta=24.4

    The viewInsets.bottom value converges to 312.0, and then jumps to 336.4 in the following frame, a difference of 24.4dp. This matches the behavior described in the issue, where the jump is approximately equal to the navigation bar height. Routing ot the team-android for further investigation.

  3. added
    platform-androidAndroid applications specifically
    team-androidOwned by Android platform team
    a: text inputEntering text in a text field or keyboard related problems
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Aug 12, 2026
  4. added
    P1High-priority issues at the top of the work list
    triaged-androidTriaged by Android platform team
    on Aug 18, 2026
  5. camsim99 commented on Aug 18, 2026

    @camsim99
    Contributor

    Closing this as a duplicate of #191094!

  6. github-actions commented on Sep 1, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Sep 1, 2026
  8. added a commit that references this issue on Nov 10, 2026
    f60eef8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions