Repository: flutter
Issue: dispose is called twice when navigating forth and back quickly between two widgets
Labels: framework,f: routes,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.27

### Steps to reproduce

1. Press the 'Go to Second Screen' button.
2. Then tap Back to return to the HomeScreen (Android).
3. Repeat the two actions above at a fast pace.

### Expected results

initState and dispose follow the correct lifecycle when switching quickly between screens.

### Actual results

initState and dispose don't behave as expected when quickly switching between screens

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Navigation Example',
      // Khai báo route cho Navigator.pushNamed
      initialRoute: '/',
      routes: {
        '/': (context) => const HomeScreen(),
        '/second': (context) => const SecondScreen(),
      },
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Home Screen'),
      ),
      body: PopScope (
        canPop: false,
        child: Center(
          child: ElevatedButton(
            onPressed: () {
              // Navigate to the second screen using pushNamed.
              Navigator.pushNamed(context, '/second');
            },
            child: const Text('Go to Second Screen'),
          ),
        ),
      ),
    );
  }
}

class SecondScreen extends StatefulWidget {
  const SecondScreen({super.key});

  @override
  State<SecondScreen> createState() => _SecondScreenState();
}

int _ii = 0;

class _SecondScreenState extends State<SecondScreen> {

  @override
  void initState() {
    super.initState();
    _ii = _ii + 1;
    print("initState call: $_ii" );
  }

  @override
  void dispose() {
    print("dispose call: $_ii" );
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Second Screen'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            // "Go back to the first screen."
            Navigator.pop(context);
          },
          child: const Text('Back to Home Screen'),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![image](https://github.com/user-attachments/assets/eaaa5ec3-7bf0-455f-bb89-9e82abbed73e)

</details>


### Logs

<details open><summary>Logs</summary>

```console
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 1
W/OnBackInvokedCallback( 5848): OnBackInvokedCallback is not enabled for the application.
W/OnBackInvokedCallback( 5848): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
D/ProfileInstaller( 5848): Installing profile for com.example.testt
I/flutter ( 5848): dispose call: 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 2
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 2
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 3
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 3
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 4
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 4
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 5
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 5
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 6
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 6
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 7
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 7
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 8
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 8
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 9
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 9
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 10
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 10
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 11
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 11
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 12
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 12
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 13
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 13
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 14
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 14
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 15
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 15
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 16
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 16
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 17
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 17
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 18
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 18
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 19
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 19
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 20
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 20
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 21
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 21
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 22
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 22
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/flutter ( 5848): initState call: 23
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 23
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 24
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 24
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/flutter ( 5848): initState call: 25
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 25
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 26
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 26
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 27
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 27
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 28
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 28
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 29
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 29
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 30
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 31
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/flutter ( 5848): dispose call: 31
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 0
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme pointer 1
I/flutter ( 5848): initState call: 32
I/flutter ( 5848): dispose call: 32
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 0
D/Activity( 5848): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@195aef6[MainActivity]( 5848): ViewPostIme key 1
D/Activity( 5848): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/flutter ( 5848): dispose call: 32
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.24.4, on Microsoft Windows [Version 10.0.22631.4391], locale en-US)
    • Flutter version 3.24.4 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (13 days ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\HUY\AppData\Local\Android\Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = C:\Users\HUY\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studi\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.10.35027.167
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studi
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] VS Code (version 1.95.1)
    • VS Code at C:\Users\HUY\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.100.0

[√] Connected device (4 available)
    • SM A325F (mobile) • RF8R31HCL7K • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22631.4391]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 130.0.6723.92
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 130.0.2849.68

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>