You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter Web发布版TextField空格键失效问题求助

Flutter Web发布版TextField组件异常问题

问题现象

  • 按下空格键时,空格无法显示;持续按空格键会出现“.”,且之后无法继续编辑文本
  • 仅在发布版中出现,Debug模式下功能完全正常
  • 使用的构建命令:flutter build web --web-renderer html --release

环境信息

[✓] Flutter (稳定通道,3.0.5,运行于 macOS 12.6 21G115 darwin-arm,语言区域 it-IT)
• Flutter 版本 3.0.5,路径:/Users/mauriziomancini/FlutterDev/flutter
• 上游仓库:https://github.com/flutter/flutter.git
• Framework 版本号 f1875d570e(2个月前,2022-07-13 11:24:16 -0700)
• Engine 版本号 e85ea0e79c
• Dart 版本 2.17.6
• DevTools 版本 2.12.2

[✓] Android 开发工具链(Android SDK 版本 33.0.0-rc1)
• Android SDK 路径:/Users/mauriziomancini/Library/Android/sdk
• 平台:android-33,构建工具版本 33.0.0-rc1
• Java 二进制文件路径:/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java 版本:OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• 所有 Android 许可证已接受

[✓] Xcode(iOS 和 macOS 开发,Xcode 14.0)
• Xcode 路径:/Applications/Xcode.app/Contents/Developer
• CocoaPods 版本 1.11.2

[✓] Chrome(Web 开发)
• Chrome 路径:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio(版本 2021.1)
• Android Studio 路径:/Applications/Android Studio.app/Contents
• Flutter 插件可从以下地址安装:https://plugins.jetbrains.com/plugin/9212-flutter
• Dart 插件可从以下地址安装:https://plugins.jetbrains.com/plugin/6351-dart
• Java 版本:OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code(版本 1.71.2)
• VS Code 路径:/Applications/Visual Studio Code.app/Contents
• Flutter 扩展版本 3.48.0

[✓] 已连接设备(3 台可用)
• iPhone 14 Pro Max(移动设备)• 8D8DCB54-F212-4551-9CD4-B367955056BB • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-0(模拟器)
• macOS(桌面设备)• macos • darwin-arm64 • macOS 12.6 21G115 darwin-arm
• Chrome(Web)• chrome • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP 主机可用性
• 所有必需的 HTTP 主机均可用

• 未发现问题!

代码片段

Scaffold(
          appBar: AppBar(
            backgroundColor: coloreApp,
            title: Image.asset("lib/assets/titolo.png"),
            actions: [
              IconButton(
                onPressed: () async {
                  await FirebaseAuth.instance.signOut();
                  setState(() {});
                },
                icon: const Icon(Icons.login_rounded),
              ),
            ],
          ),
          body: SingleChildScrollView(
              child: Column(
            children: [
              Padding(
                padding: const EdgeInsets.all(20),
                child: SizedBox(
                  child: Image.asset("lib/assets/icona.png"),
                  height: 80,
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(paddingNumber),
                child: TextField(
                  controller: emailController,
                  keyboardType: TextInputType.emailAddress,
                  decoration: inputDecoration("Email"),
                ),
              ),
              
              Padding(
                padding: const EdgeInsets.all(paddingNumber),
                child: TextField(
                  controller: passwordController,
                  obscureText: true,
                  keyboardType: TextInputType.visiblePassword,
                  decoration: inputDecoration("Password"),
                ),
              ),
            ],
          )),
        );

内容的提问来源于stack exchange,提问作者Maurizio Mancini

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 13:20:14