flutter 创建带输入框的Cupertino风格的弹窗

showCupertinoDialog(
            context: context,
            builder: (context) {
              return CupertinoAlertDialog(
                title: Text('温馨提示'),
                content: Card(
                  elevation: 0.0,
                  child: Column(
                    children: [
                      Text('this is a message'),
                      TextField(
                        decoration: InputDecoration(
                            hintText: 'input wahatever you want',
                            filled: true,
                            fillColor: Colors.grey.shade50),
                      ),
                    ],
                  ),
                ),
                actions: [
                  CupertinoDialogAction(
                    onPressed: () {
                      Navigator.pop(context);
                    },
                    child: Text('取消'),
                  ),
                  CupertinoDialogAction(
                    onPressed: () {
                      Navigator.pop(context);
                    },
                    child: Text('确定'),
                  ),
                ],
              );
            });

TextField 也可以换成CupertinoTextField

你可能感兴趣的:(Flutter)