尽管我尚未对代码进行任何修改,但我无法在扑朔迷离的输入场内输入任何内容。键盘将出现并消失

发布于 2025-02-04 15:48:56 字数 4767 浏览 4 评论 0原文

我已经完成了所有事情,但这个非常简单的输入也无法正常工作。请帮助我。我不确定我是否必须在Android方面进行任何配置。请让我知道这是否是因为更新。

    class STORequestScreen extends StatefulWidget {
  final List<String> locationData;
  final List<String> structureCodes;

  STORequestScreen(
      {Key? key, required this.locationData, required this.structureCodes})
      : super(key: key);

  @override
  _STORequestScreenState createState() => _STORequestScreenState();
}

class _STORequestScreenState extends State<STORequestScreen> {
  List<String> locations = [];
  List<String> structureCodes = [];

  @override
  void initState() {
    super.initState();
    locations = widget.locationData;
    structureCodes = widget.structureCodes;
    EasyLoading.dismiss();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
        child: ListView(shrinkWrap: true, children: [
      CustomAppBar(),
      const SizedBox(
        height: 10,
      ),
      const Align(
        alignment: Alignment.center,
        child: Text("STO Request",
            style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500)),
      ),
      const SizedBox(
        height: 10,
      ),
      const Padding(
        padding: EdgeInsets.only(left: 10, bottom: 20),
        child: Align(
          alignment: Alignment.centerLeft,
          child: Text("Details",
              style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
        ),
      ),
      TextFormField(
        decoration: InputDecoration(labelText: 'Location'),
      )
    ]));
  }
}

单击TextFormField时,我已经复制了控制台日志,并且还添加了它。希望它会有所帮助。 这是我的控制台日志:

I/ViewRootImpl@219eef1[MainActivity](15081): ViewPostIme pointer 0
I/ViewRootImpl@219eef1[MainActivity](15081): ViewPostIme pointer 1
D/InputMethodManager(15081): prepareNavigationBarInfo() DecorView@c70c075[MainActivity]
D/InputMethodManager(15081): getNavigationBarColor() -855310
V/InputMethodManager(15081): Starting input: tba=com.example.mgc ic=io.flutter.plugin.editing.InputConnectionAdaptor@d1857f4 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(15081): startInputInner - Id : 0
I/InputMethodManager(15081): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(15081): Input channel constructed: 'ClientS', fd=105
D/InputTransport(15081): Input channel destroyed: 'ClientS', fd=108
D/InputMethodManager(15081): SSI - flag : 0 Pid : 15081 view : com.example.mgc
D/InputMethodManager(15081): view is not EditText
D/InputMethodManager(15081): prepareNavigationBarInfo() DecorView@c70c075[MainActivity]
D/InputMethodManager(15081): getNavigationBarColor() -855310
D/InputConnectionAdaptor(15081): The input method toggled cursor monitoring on
D/InputMethodManager(15081): HSIFW - flag : 0
D/InsetsSourceConsumer(15081): setRequestedVisible: visible=true, type=13, host=com.example.mgc/com.example.mgc.MainActivity, from=android.view.InsetsSourceConsumer.show:226 android.view.InsetsController.showDirectly:1451 android.view.InsetsController.controlAnimationUnchecked:1118 android.view.InsetsController.applyAnimation:1431 android.view.InsetsController.show:970 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6253 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:247 android.app.ActivityThread.main:8676 java.lang.reflect.Method.invoke:-2
D/InsetsAnimationCtrlImpl(15081): cancel: control=android.view.InsetsAnimationControlImpl@828f192, types=8, mFinished=false
D/InsetsAnimationCtrlImpl(15081): finish: control=android.view.InsetsAnimationControlImpl@828f192, types=8, mCancelled=true, mCancelRequested=false
D/InsetsSourceConsumer(15081): setRequestedVisible: visible=false, type=13, host=com.example.mgc/com.example.mgc.MainActivity, from=android.view.InsetsSourceConsumer.hide:233 android.view.ImeInsetsSourceConsumer.hide:101 android.view.InsetsController.hideDirectly:1444 android.view.InsetsController.controlAnimationUnchecked:1120 android.view.InsetsController.applyAnimation:1431 android.view.InsetsController.hide:992 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6257 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:247 android.app.ActivityThread.main:8676
I/SurfaceControl(15081): nativeRelease nativeObject s[503336847008]
I/SurfaceControl(15081): nativeRelease nativeObject e[503336847008]
D/InputConnectionAdaptor(15081): The input method toggled cursor monitoring off
D/InsetsAnimationCtrlImpl(15081): finish: control=android.view.InsetsAnimationControlImpl@66094de, types=8, mCancelled=false, mCancelRequested=false
I/SurfaceControl(15081): nativeRelease nativeObject s[503336844224]
I/SurfaceControl(15081): nativeRelease nativeObject e[503336844224]

I have done everything and still this very simple input also does not work. Please help me out. I'm not sure whether I have to do any configurations in the android side. Please let me know if this is because of update.

    class STORequestScreen extends StatefulWidget {
  final List<String> locationData;
  final List<String> structureCodes;

  STORequestScreen(
      {Key? key, required this.locationData, required this.structureCodes})
      : super(key: key);

  @override
  _STORequestScreenState createState() => _STORequestScreenState();
}

class _STORequestScreenState extends State<STORequestScreen> {
  List<String> locations = [];
  List<String> structureCodes = [];

  @override
  void initState() {
    super.initState();
    locations = widget.locationData;
    structureCodes = widget.structureCodes;
    EasyLoading.dismiss();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
        child: ListView(shrinkWrap: true, children: [
      CustomAppBar(),
      const SizedBox(
        height: 10,
      ),
      const Align(
        alignment: Alignment.center,
        child: Text("STO Request",
            style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500)),
      ),
      const SizedBox(
        height: 10,
      ),
      const Padding(
        padding: EdgeInsets.only(left: 10, bottom: 20),
        child: Align(
          alignment: Alignment.centerLeft,
          child: Text("Details",
              style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
        ),
      ),
      TextFormField(
        decoration: InputDecoration(labelText: 'Location'),
      )
    ]));
  }
}

I have copied the console log when I click the TextFormField and I have added that as well. Hope it will help.
Here is my console log:

I/ViewRootImpl@219eef1[MainActivity](15081): ViewPostIme pointer 0
I/ViewRootImpl@219eef1[MainActivity](15081): ViewPostIme pointer 1
D/InputMethodManager(15081): prepareNavigationBarInfo() DecorView@c70c075[MainActivity]
D/InputMethodManager(15081): getNavigationBarColor() -855310
V/InputMethodManager(15081): Starting input: tba=com.example.mgc ic=io.flutter.plugin.editing.InputConnectionAdaptor@d1857f4 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(15081): startInputInner - Id : 0
I/InputMethodManager(15081): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(15081): Input channel constructed: 'ClientS', fd=105
D/InputTransport(15081): Input channel destroyed: 'ClientS', fd=108
D/InputMethodManager(15081): SSI - flag : 0 Pid : 15081 view : com.example.mgc
D/InputMethodManager(15081): view is not EditText
D/InputMethodManager(15081): prepareNavigationBarInfo() DecorView@c70c075[MainActivity]
D/InputMethodManager(15081): getNavigationBarColor() -855310
D/InputConnectionAdaptor(15081): The input method toggled cursor monitoring on
D/InputMethodManager(15081): HSIFW - flag : 0
D/InsetsSourceConsumer(15081): setRequestedVisible: visible=true, type=13, host=com.example.mgc/com.example.mgc.MainActivity, from=android.view.InsetsSourceConsumer.show:226 android.view.InsetsController.showDirectly:1451 android.view.InsetsController.controlAnimationUnchecked:1118 android.view.InsetsController.applyAnimation:1431 android.view.InsetsController.show:970 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6253 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:247 android.app.ActivityThread.main:8676 java.lang.reflect.Method.invoke:-2
D/InsetsAnimationCtrlImpl(15081): cancel: control=android.view.InsetsAnimationControlImpl@828f192, types=8, mFinished=false
D/InsetsAnimationCtrlImpl(15081): finish: control=android.view.InsetsAnimationControlImpl@828f192, types=8, mCancelled=true, mCancelRequested=false
D/InsetsSourceConsumer(15081): setRequestedVisible: visible=false, type=13, host=com.example.mgc/com.example.mgc.MainActivity, from=android.view.InsetsSourceConsumer.hide:233 android.view.ImeInsetsSourceConsumer.hide:101 android.view.InsetsController.hideDirectly:1444 android.view.InsetsController.controlAnimationUnchecked:1120 android.view.InsetsController.applyAnimation:1431 android.view.InsetsController.hide:992 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6257 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:247 android.app.ActivityThread.main:8676
I/SurfaceControl(15081): nativeRelease nativeObject s[503336847008]
I/SurfaceControl(15081): nativeRelease nativeObject e[503336847008]
D/InputConnectionAdaptor(15081): The input method toggled cursor monitoring off
D/InsetsAnimationCtrlImpl(15081): finish: control=android.view.InsetsAnimationControlImpl@66094de, types=8, mCancelled=false, mCancelRequested=false
I/SurfaceControl(15081): nativeRelease nativeObject s[503336844224]
I/SurfaceControl(15081): nativeRelease nativeObject e[503336844224]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文