Skip to content

did i use wrong with the TextEditingController? #36671

Closed

Description

@dumplings

before i explain my issues, please check out its ok about the offical example.
https://api.flutter.dev/flutter/widgets/TextEditingController-class.html
This example doesn't seem to work.
just like this:
Kapture 2019-07-22 at 17 45 41

Steps to Reproduce

i just copy the code from the example, and run it.

I also have another problem. In my own code, I instantiate a _controller. When I assign a value to the controller property of TextField, the following problem occurs:

  1. Open simulator;
  2. Open keyboard;
  3. Input values;
  4. Click done;
  5. The value in the TextField disappears;

I don't know why, but when I remove _controller, the problem disappears.

just a line code about the controller:

  TextEditingController _controller = TextEditingController();

Logs

[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F203, locale zh-Hans-CN)
• Flutter version 1.7.8+hotfix.3 at /Users/hejingguo/flutter
• Framework revision b712a17 (13 days ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at /Users/hejingguo/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• 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-1343-b01)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.7.3

[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4

[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 36.1.4
• Dart plugin version 191.7830

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

[✓] Connected device (1 available)
• iPhone 6s • 4AE27175-9674-443D-B05D-0B437F6A927C • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

• No issues found!

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    on Jul 23, 2019
  2. dumplings commented on Aug 6, 2019

    @dumplings
    Author

    why nobody respond to me... please...

  3. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 6, 2019
  4. dumplings commented on Sep 18, 2019

    @dumplings
    Author

    is this a real problem? could anybody respond me a massege?

  5. xlfdyzcs commented on Sep 24, 2019

    @xlfdyzcs

    你有看输出日志么?

  6. xlfdyzcs commented on Sep 24, 2019

    @xlfdyzcs

    is this a real problem? could anybody respond me a massege?

    建议用android studio 调试一下,看看日志,或者你贴出你的代码

  7. TahaTesser commented on Feb 26, 2020

    @TahaTesser
    Contributor

    Hi @dumplings
    Are you still experiencing this issue?
    Thank you

  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 26, 2020
  9. VladyslavBondarenko commented on Mar 20, 2020

    @VladyslavBondarenko

    @dumplings
    I can't reproduce it with flutter v1.16.1 and iOS simulator 13.3.
    I hope it's fixed, closing.
    Comment please if it's not so and I'll reopen the issue
    Thank you

  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 20, 2020
  11. lock commented on Apr 4, 2020

    @lock

    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.

  12. locked and limited conversation to collaborators on Apr 4, 2020
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: text inputEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions