我想使用 Replaceall 方法替换从 flutter 中的文本字段获取的多个字符。我怎样才能正确实现它。\nIv\'e 尝试按如下方式执行此操作,但它不会替换字符。
\n\n_textSelect(String str){\n str=str.replaceAll(\'e\', \'\xc3\xa9\');\n str=str.replaceAll(\'i\', \'I\');\n str=str.replaceAll(\'b\', \'*\');\n str=str.replaceAll(\'v\', \'<\');\n\n return str;\n }\nRun Code Online (Sandbox Code Playgroud)\n\n语境
\n\nWidget build(BuildContext context) {\n return Scaffold(\n appBar: AppBar(\n title: Text(\'Retrieve Text Input\'),\n ),\n body: Padding(\n padding: const EdgeInsets.all(16.0),\n child: TextField(\n controller: myController,\n ),\n ),\n floatingActionButton: FloatingActionButton(\n // When the user presses the button, show an alert dialog containing\n // the text that the user has entered into the text field.\n onPressed: () {\n _textSelect(myController.text);//update\n return showDialog(\n context: …Run Code Online (Sandbox Code Playgroud) 我使用 flutter 构建了简单的模因/照片编辑器应用程序。它在调试模式下运行良好,但在发布模式下不起作用。我的应用程序中有一个容器,用于显示使用图像选择器加载的用户图像。当我选择它在调试应用程序中显示图像,但在发布版本中尝试时它仅显示一个空白容器,并且它的对齐方式也发生了更改。我已经尝试flutter clean并将其添加Internet permission到清单文件中。但没有任何方法可以纠正该问题。
另外,我尝试过应用程序捆绑包和拆分 apk,但问题仍然存在。是否有任何方法可以生成调试 apk 并将其上传到 Playstore,而不会出现任何安全问题?
这是有问题的部分...它在调试模式下工作正常,但在发布模式下工作不正常。
Center(child: Stack(
children: <Widget>[
_image != null ? Expanded(
child: Container(
child: Image.file(
_image,
height: 400,
width: 400,
fit: BoxFit.cover,),
),
)
Run Code Online (Sandbox Code Playgroud)