我的 AlertDialog 有一个奇怪的问题,无法关闭对话框。我使用下面的代码片段来关闭颤振文档中提到的对话框。
Navigator.of(dialogContext).pop();
Run Code Online (Sandbox Code Playgroud)
但是显示它如何不起作用并使应用程序进入非活动模式并变成黑屏窗口。为了让它再次工作,我必须杀死应用程序并重新启动。
这是flutter中alertdialog的完整代码
Future<Null> _showDialogContactDial(context, Contact contactRecord) async {
return showDialog<Null>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext dialogContext) {
return new AlertDialog(
title: new Text('Confirm Number'),
content: new SingleChildScrollView(
child: new ListBody(
children: <Widget>[
new TextFormField(
maxLines: 1,
decoration: new InputDecoration(hintText: 'Number'),
keyboardType: TextInputType.number,
autofocus: false,
initialValue: contactRecord.phoneNumber.number,
),
],
),
),
actions: <Widget>[
new FlatButton(
child: new Text(
'Call',
style: TextStyle(color: Colors.black),
),
onPressed: () {
Navigator.of(dialogContext).pop();
_launchURL(
context);
},
), …Run Code Online (Sandbox Code Playgroud) 升级到mac中的Xcode 10.0版本后,Flutter iOS构建失败.
Nagendras-MacBook-Pro:uaenumber nagendra$ flutter run
Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done. 1.4s
Failed to build iOS app
Error output from Xcode build:
?
** BUILD FAILED **
Xcode's output:
?
error: Multiple commands produce '/Users/dev/Documents/projects/Personal/uaenumber/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/dev/Documents/projects/Personal/uaenumber/ios/Flutter/Flutter.framework' to '/Users/dev/Documents/projects/Personal/uaenumber/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: The use of Swift 3 @objc inference in Swift …Run Code Online (Sandbox Code Playgroud) 我是新手,可以尝试Sateful小部件。事情就是这样,在我的UI屏幕布局中,我有两个不同的小部件
When I was trying to update dropdown selected value to the DropdownButton widget, it automatically clears the text in TextFormField. Does it require to store text in global variable to restore again every time we call setState() method to update the values?
Here is the code for widgets, DropdownButton
new Padding(
padding: const EdgeInsets.all(15.0),
child: new Column(
children: <Widget>[
DropdownButton<String>(
value: _referPractice,
isDense: true,
hint: new Text(CONST_SELECT),
items: _stdCodesList.map((value) {
return new …Run Code Online (Sandbox Code Playgroud)