Sitelet https://github.com/flutter/flutter/issues/61527
Skip to content

CupertinoTextSelectionToolbar doesn't vertically centre align text in Chinese language #61527

Description

@WangYyyyy
  1. Setup localizations settings
    pubspec.yaml
  flutter_localizations:
    sdk: flutter

MyApp

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      localizationsDelegates: [
        GlobalCupertinoLocalizations.delegate,
        DefaultCupertinoLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: [
        const Locale('zh', 'CH'),
        const Locale('en', 'US'),
      ],
      locale: Locale('zh', 'CH'),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}
  1. Put a TextField to page.
Padding(
              padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
              child: TextField(),
            ),
  1. Double tap TextField will show CupertinoTextSelectionToolbar in Chinese, it will not display center.

WX20200715-172840@2x

when I change the language to en, it will display correct.

      locale: Locale('en', 'US'),
      // locale: Locale('zh', 'CH'),

WX20200715-173057@2x

flutter doctor -v

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en)
    • Flutter version 1.17.5 at /Users/wangyu/Yu/flutter
    • Framework revision 8af6b2f038 (2 weeks ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/wangyu/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit visit
      https://flutter.dev/docs/get-started/install/macos#android-setup for
      detailed instructions.

 
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 31.3.3
    • Dart plugin version 182.5124

[✓] VS Code (version 1.47.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • B3A87334-6C79-4ADD-A38E-BF76EC71D171 • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)

! Doctor found issues in 2 categories.

Activity

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

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions