Skip to content

Cutting and pasting issues in text fields on iOS #22624

Closed

Description

@alardizabal

On iOS, if you long press into a text field and try to copy/paste text, you'll see the errors below. This can be recreated by building the Flutter Gallery app on iOS (Material -> Text fields) (Android works fine).

img_0041

2018-10-03 13:04:28.150905-0400 Runner[7770:1877318] flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
2018-10-03 13:04:28.151145-0400 Runner[7770:1877318] flutter: The following NoSuchMethodError was thrown building _TextSelectionToolbar(dirty):
2018-10-03 13:04:28.151166-0400 Runner[7770:1877318] flutter: The getter 'pasteButtonLabel' was called on null.
2018-10-03 13:04:28.151179-0400 Runner[7770:1877318] flutter: Receiver: null
2018-10-03 13:04:28.151192-0400 Runner[7770:1877318] flutter: Tried calling: pasteButtonLabel
2018-10-03 13:04:28.154374-0400 Runner[7770:1877318] flutter:
2018-10-03 13:04:28.154417-0400 Runner[7770:1877318] flutter: When the exception was thrown, this was the stack:
2018-10-03 13:04:28.157838-0400 Runner[7770:1877318] flutter: #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50)
2018-10-03 13:04:28.157878-0400 Runner[7770:1877318] flutter: #1      _TextSelectionToolbar.build (package:flutter/src/cupertino/text_selection.dart:92)
2018-10-03 13:04:28.158747-0400 Runner[7770:1877091] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-10-03 13:04:28.159051-0400 Runner[7770:1877318] flutter: #2      StatelessElement.build (package:flutter/src/widgets/framework.dart:3731)
2018-10-03 13:04:28.159111-0400 Runner[7770:1877318] flutter: #3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3678)
2018-10-03 13:04:28.159131-0400 Runner[7770:1877318] flutter: #4      Element.rebuild (package:flutter/src/widgets/framework.dart:3531)
2018-10-03 13:04:28.159787-0400 Runner[7770:1877091] [MC] Reading from public effective user settings.
2018-10-03 13:04:28.159990-0400 Runner[7770:1877318] flutter: #5      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658)
2018-10-03 13:04:28.160040-0400 Runner[7770:1877318] flutter: #6      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653)
2018-10-03 13:04:28.160056-0400 Runner[7770:1877318] flutter: #7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.160125-0400 Runner[7770:1877318] flutter: #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.160749-0400 Runner[7770:1877318] flutter: #9      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796)
2018-10-03 13:04:28.160785-0400 Runner[7770:1877318] flutter: #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.162412-0400 Runner[7770:1877318] flutter: #11     Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.162461-0400 Runner[7770:1877318] flutter: #12     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796)
2018-10-03 13:04:28.162478-0400 Runner[7770:1877318] flutter: #13     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.162492-0400 Runner[7770:1877318] flutter: #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.162507-0400 Runner[7770:1877318] flutter: #15     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796)
2018-10-03 13:04:28.162521-0400 Runner[7770:1877318] flutter: #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.162547-0400 Runner[7770:1877318] flutter: #17     Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.163271-0400 Runner[7770:1877318] flutter: #18     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796)
2018-10-03 13:04:28.163297-0400 Runner[7770:1877318] flutter: #19     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.163311-0400 Runner[7770:1877318] flutter: #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.163383-0400 Runner[7770:1877318] flutter: #21     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689)
2018-10-03 13:04:28.164002-0400 Runner[7770:1877318] flutter: #22     Element.rebuild (package:flutter/src/widgets/framework.dart:3531)
2018-10-03 13:04:28.164020-0400 Runner[7770:1877318] flutter: #23     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658)
2018-10-03 13:04:28.164034-0400 Runner[7770:1877318] flutter: #24     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805)
2018-10-03 13:04:28.165476-0400 Runner[7770:1877318] flutter: #25     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653)
2018-10-03 13:04:28.165503-0400 Runner[7770:1877318] flutter: #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937)
2018-10-03 13:04:28.165519-0400 Runner[7770:1877318] flutter: #27     Element.updateChild (package:flutter/src/widgets/framework.dart:2740)
2018-10-03 13:04:28.165643-0400 Runner[7770:1877318] flutter: #28     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4579)
2018-10-03 13:04:28.165676-0400 Runner[7770:1877318] flutter: #29     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4911)
2018-10-03 13:04:28.165691-0400 Runner[7770:1877318] flutter: #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2729)
2018-10-03 13:04:28.165705-0400 Runner[7770:1877318] flutter: #31     _TheatreElement.update (package:flutter/src/widgets/overlay.dart:507)
2018-10-03 13:04:28.189496-0400 Runner[7770:1877318] flutter: #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2729)
2018-10-03 13:04:28.189532-0400 Runner[7770:1877318] flutter: #33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689)
2018-10-03 13:04:28.189548-0400 Runner[7770:1877318] flutter: #34     Element.rebuild (package:flutter/src/widgets/framework.dart:3531)
2018-10-03 13:04:28.189563-0400 Runner[7770:1877318] flutter: #35     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273)
2018-10-03 13:04:28.189603-0400 Runner[7770:1877318] flutter: #36     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:670)
2018-10-03 13:04:28.189637-0400 Runner[7770:1877318] flutter: #37     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208)
2018-10-03 13:04:28.189653-0400 Runner[7770:1877318] flutter: #38     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990)
2018-10-03 13:04:28.189669-0400 Runner[7770:1877318] flutter: #39     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930)
2018-10-03 13:04:28.189684-0400 Runner[7770:1877318] flutter: #40     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842)
2018-10-03 13:04:28.189724-0400 Runner[7770:1877318] flutter: #41     _invoke (dart:ui/hooks.dart:139)
2018-10-03 13:04:28.189745-0400 Runner[7770:1877318] flutter: #42     _drawFrame (dart:ui/hooks.dart:128)
2018-10-03 13:04:28.189780-0400 Runner[7770:1877318] flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
2018-10-03 13:04:28.270583-0400 Runner[7770:1877318] flutter: Another exception was thrown: NoSuchMethodError: The getter 'pasteButtonLabel' was called on null.

img_0042

2018-10-03 13:07:55.402215-0400 Runner[7783:1878817] flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
2018-10-03 13:07:55.410982-0400 Runner[7783:1878817] flutter: The following NoSuchMethodError was thrown building _TextSelectionToolbar(dirty):
2018-10-03 13:07:55.411179-0400 Runner[7783:1878817] flutter: The getter 'cutButtonLabel' was called on null.
2018-10-03 13:07:55.411213-0400 Runner[7783:1878817] flutter: Receiver: null
2018-10-03 13:07:55.411235-0400 Runner[7783:1878817] flutter: Tried calling: cutButtonLabel
2018-10-03 13:07:55.412871-0400 Runner[7783:1878817] flutter:
2018-10-03 13:07:55.412920-0400 Runner[7783:1878817] flutter: When the exception was thrown, this was the stack:
2018-10-03 13:07:55.416676-0400 Runner[7783:1878817] flutter: #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
2018-10-03 13:07:55.416776-0400 Runner[7783:1878817] flutter: #1      _TextSelectionToolbar.build (package:flutter/src/cupertino/text_selection.dart:81:51)
2018-10-03 13:07:55.417230-0400 Runner[7783:1878817] flutter: #2      StatelessElement.build (package:flutter/src/widgets/framework.dart:3731:28)
2018-10-03 13:07:55.417317-0400 Runner[7783:1878817] flutter: #3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3678:15)
2018-10-03 13:07:55.417423-0400 Runner[7783:1878817] flutter: #4      Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
2018-10-03 13:07:55.417511-0400 Runner[7783:1878817] flutter: #5      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
2018-10-03 13:07:55.417577-0400 Runner[7783:1878817] flutter: #6      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
2018-10-03 13:07:55.417639-0400 Runner[7783:1878817] flutter: #7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.417699-0400 Runner[7783:1878817] flutter: #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.417845-0400 Runner[7783:1878817] flutter: #9      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
2018-10-03 13:07:55.417926-0400 Runner[7783:1878817] flutter: #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.418011-0400 Runner[7783:1878817] flutter: #11     Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.418101-0400 Runner[7783:1878817] flutter: #12     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
2018-10-03 13:07:55.418162-0400 Runner[7783:1878817] flutter: #13     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.418288-0400 Runner[7783:1878817] flutter: #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.418388-0400 Runner[7783:1878817] flutter: #15     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
2018-10-03 13:07:55.418491-0400 Runner[7783:1878817] flutter: #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.418628-0400 Runner[7783:1878817] flutter: #17     Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.418712-0400 Runner[7783:1878817] flutter: #18     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4796:14)
2018-10-03 13:07:55.418774-0400 Runner[7783:1878817] flutter: #19     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.418833-0400 Runner[7783:1878817] flutter: #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.418953-0400 Runner[7783:1878817] flutter: #21     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
2018-10-03 13:07:55.419016-0400 Runner[7783:1878817] flutter: #22     Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
2018-10-03 13:07:55.419105-0400 Runner[7783:1878817] flutter: #23     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3658:5)
2018-10-03 13:07:55.419261-0400 Runner[7783:1878817] flutter: #24     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3805:11)
2018-10-03 13:07:55.419328-0400 Runner[7783:1878817] flutter: #25     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3653:5)
2018-10-03 13:07:55.419410-0400 Runner[7783:1878817] flutter: #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2937:14)
2018-10-03 13:07:55.419474-0400 Runner[7783:1878817] flutter: #27     Element.updateChild (package:flutter/src/widgets/framework.dart:2740:12)
2018-10-03 13:07:55.419532-0400 Runner[7783:1878817] flutter: #28     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4579:32)
2018-10-03 13:07:55.419655-0400 Runner[7783:1878817] flutter: #29     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4911:17)
2018-10-03 13:07:55.419736-0400 Runner[7783:1878817] flutter: #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
2018-10-03 13:07:55.419830-0400 Runner[7783:1878817] flutter: #31     _TheatreElement.update (package:flutter/src/widgets/overlay.dart:507:16)
2018-10-03 13:07:55.419947-0400 Runner[7783:1878817] flutter: #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
2018-10-03 13:07:55.420006-0400 Runner[7783:1878817] flutter: #33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
2018-10-03 13:07:55.420063-0400 Runner[7783:1878817] flutter: #34     Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
2018-10-03 13:07:55.420124-0400 Runner[7783:1878817] flutter: #35     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273:33)
2018-10-03 13:07:55.420725-0400 Runner[7783:1878817] flutter: #36     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:670:20)
2018-10-03 13:07:55.420893-0400 Runner[7783:1878817] flutter: #37     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
2018-10-03 13:07:55.421023-0400 Runner[7783:1878817] flutter: #38     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
2018-10-03 13:07:55.421121-0400 Runner[7783:1878817] flutter: #39     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
2018-10-03 13:07:55.421187-0400 Runner[7783:1878817] flutter: #40     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
2018-10-03 13:07:55.421312-0400 Runner[7783:1878817] flutter: #41     _invoke (dart:ui/hooks.dart:139:13)
2018-10-03 13:07:55.421494-0400 Runner[7783:1878817] flutter: #42     _drawFrame (dart:ui/hooks.dart:128:3)
2018-10-03 13:07:55.422130-0400 Runner[7783:1878817] flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
☆ flutter doctor -v
[✓] Flutter (Channel master, v0.9.6-pre.63, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.9.6-pre.63 at /Users/albertlardizabal/dev/flutter
    • Framework revision b08f36e3cc (10 hours ago), 2018-10-03 02:27:58 -0400
    • Engine revision 74662ab695
    • Dart version 2.1.0-dev.6.0.flutter-d2c5a24fd9

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.0-rc1)
    • Android SDK at /Users/albertlardizabal/Library/Android/sdk
    • Android NDK at /Users/albertlardizabal/Library/Android/sdk/ndk-bundle
    • Platform android-28, build-tools 28.0.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 29.0.4
    • Dart plugin version 182.4323.44

Activity

  1. jonahwilliams commented on Oct 4, 2018

    @jonahwilliams
    Contributor

    This is probably due to #22443, where we have started adding cupertino localizations. The problem should go away if you provide the defaultCupertinoLocalizations to the material app, though perhaps we need to include them by default>

    cc @xster

  2. added
    a: text inputEntering text in a text field or keyboard related problems
    c: crashStack traces logged to the console
    platform-iosiOS applications specifically
    a: internationalizationSupporting other languages or locales. (aka i18n)
    on Oct 4, 2018
  3. added this to the milestone on Oct 4, 2018
  4. yathit commented on Oct 5, 2018

    @yathit

    This is terrible. Hope the patch land soon.

  5. lucasjinreal commented on Oct 6, 2018

    @lucasjinreal

    @alardizabal Thanks for observe this bug, it's emergency for now, I can reproduce this both on Cupertino APP and Material APP on iOS. Waiting for Flutter team fix this, otherwise copy and paste the basic usage are limited and buggy.

  6. xster commented on Oct 6, 2018

    @xster
    Member

    The patch is on head

  7. CaiJingLong commented on Oct 15, 2018

    @CaiJingLong
    Contributor

    @xster @zoechi

    If I use themeData platform is TargetPlatform.ios in MaterialApp on android device, then the pasteButtonLabel warning is showing like the issue. Not warning on iOS device. but i18n not valid.


    like the code https://github.com/CaiJingLong/localization_error_example/blob/master/lib/main.dart
    github repo


    If I delete

    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    

    then i18n not valid, and language is english, not chinese.

    Everything was normal before the update in v0.9.1, and there was a problem after the 0.10.

    before upgrade flutter version 0.9.1 ,anything is true


    [✓] Flutter (Channel dev, v0.10.0, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
        • Flutter version 0.10.0 at /Users/cai/fluttersdk/flutter
        • Framework revision d954ae6850 (5 days ago), 2018-10-09 16:21:06 -0400
        • Engine revision bf377896ff
        • Dart version 2.1.0-dev.6.0.flutter-a50dfd6698
    
    [✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
        • Android SDK at /Users/cai/Library/Android/sdk
        • Android NDK at /Users/cai/Library/Android/sdk/ndk-bundle
        • Platform android-28, build-tools 28.0.2
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
        • All Android licenses accepted.
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 9.2, Build version 9C40b
        • ios-deploy 1.9.2
        • CocoaPods version 1.5.3
    
    [✓] Android Studio (version 3.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 27.1.1
        • Dart plugin version 173.4700
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2018.1.4)
        • IntelliJ at /Users/cai/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
        • Flutter plugin version 27.1.2
        • Dart plugin version 181.4892.1
    
    [✓] VS Code (version 1.28.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 2.19.0
    
    [✓] Connected device (2 available)
        • MI 8       • b6ec3684                                 • android-arm64 • Android 8.1.0 (API 27)
        • iPad mini2 • 58366e2a63aae6f85e6e806039316c27faa52868 • ios           • iOS 12.0
    
    
  8. BytesZero commented on Oct 23, 2018

    @BytesZero

    Was this problem fixed in flutter v0.10.1? I still have this problem in flutter v0.10.1.

  9. indiluk commented on Nov 14, 2018

    @indiluk

    Same issue on flutter v0.11.3

    [✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.13.6 17G3025, locale de-AT)
        • Flutter version 0.11.3 at /Users/indiluk/Desktop/otonmedia/development/flutter/flutter
        • Framework revision 72bf075e8d (5 days ago), 2018-11-09 20:36:17 -0800
        • Engine revision 5646e86a6f
        • Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)
    
    [✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
        • Android SDK at /Users/indiluk/Library/Android/sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-28, build-tools 28.0.2
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
        • All Android licenses accepted.
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 10.1, Build version 10B61
        • ios-deploy 1.9.2
        • CocoaPods version 1.5.0
    
    [✓] Android Studio (version 3.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 29.1.1
        • Dart plugin version 181.5656
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    
    [✓] VS Code (version 1.29.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 2.20.0
    
    [✓] Connected device (1 available)
        • Lukass iPhone • e2b5f969070bda8ec59ff5c8e9215cfcbead67d8 • ios • iOS 12.1
    
    • No issues found!
    
  10. 17 remaining items

  11. eseidelGoogle commented on Apr 8, 2019

    @eseidelGoogle
    Contributor

    @DJafari I don't understand what you're asking. Can you please file a new bug describing the issue you're seeing?
    https://github.com/flutter/flutter/issues/new

  12. DJafari commented on Apr 8, 2019

    @DJafari

    @eseidelGoogle bug described in this issue, please read this issue

    example :

    import 'package:flutter/material.dart';
    import 'package:flutter_localizations/flutter_localizations.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      // This widget is the root of your application.
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          localizationsDelegates: [
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
          ],
          supportedLocales: [
            Locale("fa", "IR")
          ],
          locale: Locale("fa", "IR"),
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: MyHomePage(title: 'Flutter Demo Home Page'),
        );
      }
    }
    
    class MyHomePage extends StatelessWidget {
      MyHomePage({Key key, this.title}) : super(key: key);
      final String title;
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(title),
          ),
          body: Container(
            child: Padding(
              padding: EdgeInsets.all(8),
              child: TextFormField(
    
              ),
            ),
          ),
        );
      }
    }

    note:
    run in iOS and hold on textfield to show Copy/Paste menu

  13. eseidelGoogle commented on Apr 8, 2019

    @eseidelGoogle
    Contributor

    @DJafari regardless, this issue is has been closed for 6 months. :) Even if this issue contains some of the right information, a new issue is likely still going to be needed to cause it to be resolved. Please file a new issue if you would like this resolved. Thank you!

    @xster is likely the person who would resolve issues in this code.

  14. DJafari commented on Apr 8, 2019

    @DJafari

    @eseidelGoogle ok thanks :-) #30722

  15. xster commented on Apr 8, 2019

    @xster
    Member

    This issue was regarding a crash that was happening on 0.9.6 with the default English implementation.

    #13452 is the issue tracking the flutter_localizations package providing bundled language translations for 52 other languages such as Farsi. The work is done but not all the PRs are merged into head yet.

  16. DJafari commented on Apr 8, 2019

    @DJafari

    ok @xster thanks
    can you give a ETA ? because of this bug caused app can't production ready

  17. MohamedSayed9392 commented on Apr 23, 2019

    @MohamedSayed9392

    I've found a solution to the problem, had to add fallback to localizationsDelegates, as follows:

    localizationsDelegates: [ ..... const FallbackCupertinoLocalisationsDelegate(), ]

    And the delegate:

    `class FallbackCupertinoLocalisationsDelegate
    extends LocalizationsDelegate {
    const FallbackCupertinoLocalisationsDelegate();

    @OverRide
    bool isSupported(Locale locale) => true;

    @OverRide
    Future load(Locale locale) =>
    DefaultCupertinoLocalizations.load(locale);

    @OverRide
    bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
    }`

  18. Mayaela commented on Apr 29, 2019

    @Mayaela

    @MohamedSayed9392 tried but didn't work, could you be more specific ? In the class Fallback(...) you import LocalizationsDelegate from material or cupertino ? And when you use it in
    localizationsDelegates: [ ..... const FallbackCupertinoLocalisationsDelegate(), ], what else is written before or after const FallbackCupertinoLocalisationsDelegate() ?
    My initial code :
    localizationsDelegates: [ const LocalizationDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate ],
    I tried replacing the const by yours it didn't work.

  19. m9sh commented on May 11, 2019

    @m9sh
    Contributor

    @Mayaela

    This solution worked for me:

    class FallbackCupertinoLocalisationsDelegate
        extends LocalizationsDelegate<CupertinoLocalizations> {
      const FallbackCupertinoLocalisationsDelegate();
    
      @override
      bool isSupported(Locale locale) => true;
    
      @override
      Future<CupertinoLocalizations> load(Locale locale) =>
          DefaultCupertinoLocalizations.load(locale);
    
      @override
      bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
    }
    

    Notice the that here CupertinoLocalizations was provided as type for generics.

  20. lucasmatoscc commented on May 30, 2019

    @lucasmatoscc

    Not sure about what exactly it does, but I fix this bug using platform at Android for my ThemeData above my form :

                              child: Theme(
                                data: new ThemeData(
                                  platform: TargetPlatform.android,
                                  hintColor: Style.circleGrey,
                                  primaryColor: Style.redDarkAccent,
                                  primaryColorDark: Style.redDarkAccent,
                                ),

    the navigation back in the drag is interrupted in iOS, when we force the platform: TargetPlatform.android

  21. ag84ark commented on Aug 27, 2019

    @ag84ark

    I've found a solution to the problem, had to add fallback to localizationsDelegates, as follows:

    localizationsDelegates: [ ..... const FallbackCupertinoLocalisationsDelegate(), ]

    And the delegate:

    `class FallbackCupertinoLocalisationsDelegate
    extends LocalizationsDelegate {
    const FallbackCupertinoLocalisationsDelegate();

    @OverRide
    bool isSupported(Locale locale) => true;

    @OverRide
    Future load(Locale locale) =>
    DefaultCupertinoLocalizations.load(locale);

    @OverRide
    bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
    }`

    Thank you, this worked for me as well.
    Created a new .dart file with:

    import 'package:flutter/cupertino.dart';
    
    class FallbackCupertinoLocalisationsDelegate
        extends LocalizationsDelegate<CupertinoLocalizations> {
      const FallbackCupertinoLocalisationsDelegate();
    
      @override
      bool isSupported(Locale locale) => true;
    
      @override
      Future<CupertinoLocalizations> load(Locale locale) =>
          DefaultCupertinoLocalizations.load(locale);
    
      @override
      bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
    }

    then added that class as the last in the main file:

    MaterialApp(
    ...
    localizationsDelegates: [
              ...
              GlobalMaterialLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
              const FallbackCupertinoLocalisationsDelegate(),
            ],

    and worked perfectly

  22. Ahmadre commented on Oct 10, 2019

    @Ahmadre

    Hi from Flutter 1.10.12:

    now you can use:

    localizationsDelegates: [
                  ...
                  GlobalMaterialLocalizations.delegate,
                  GlobalWidgetsLocalizations.delegate,
                  GlobalCupertinoLocalizations.delegate,
                  DefaultCupertinoLocalizations.delegate
    ],
  23. Cardo commented on Dec 6, 2019

    @Cardo
    GlobalCupertinoLocalizations.delegate,

    Yes, adding this line does the trick.

  24. github-actions commented on Aug 14, 2021

    @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.

  25. locked as resolved and limited conversation to collaborators on Aug 14, 2021
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

    a: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consoleplatform-iosiOS applications specificallywaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions