Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[iOS] The keyboard animation is not so smooth and has some junk and laggy on 120HZ promotion devices #109435

Closed
@luckysmg

Description

@luckysmg

It is tested on iPhone 13 Pro(120HZ) and iPhone12(60HZ), release mode:
When the keyboard showup, the textfield will pushup normally but not so smooth when device is under 120HZ refresh rate.

Also tested iPhone13Pro on low power mode(60HZ),or on iPhone12(60HZ), the animation is not that bad.

Here is the code example

Code
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const TextFieldPage(),
    );
  }
}

class TextFieldPage extends StatefulWidget {
  const TextFieldPage({Key? key}) : super(key: key);

  @override
  State<TextFieldPage> createState() => _TextFieldPageState();
}

class _TextFieldPageState extends State<TextFieldPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          const Spacer(),
          const Text('Keyboard animation', style: TextStyle(fontSize: 26)),
          const Spacer(),
          SizedBox(
              height: 60 + MediaQuery.of(context).padding.bottom,
              child: const CupertinoTextField(
                decoration: BoxDecoration(color: Colors.red),
              )),
        ],
      ),
    );
  }
}

Flutter doctor
[✓] Flutter (Channel master, 3.1.0-0.0.pre.2241, on macOS 12.5 21G72 darwin-arm
    (Rosetta), locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.70.1)
Scanning for devices is taking a long time...[✓] Connected device (2 available)
[✓] HTTP Host Availability

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: animationAnimation APIsa: text inputEntering text in a text field or keyboard related problemsc: performanceRelates to speed or footprint issues (see "perf:" labels)e: device-specificOnly manifests on certain devicesengineflutter/engine repository. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions