简体   繁体   English

是否可以在 system_alert_window Flutter 中实现 TextField?

[英]Is possible to implement TextField in system_alert_window Fluttter?

I used system_alert_window this library for implement sytem alert window. I need a Textfield on this dialog.我使用system_alert_window这个库来实现系统警报 window。我需要这个对话框上的文本字段。

  1. How do we implement this?我们如何实施呢?

  2. Or is there other way to bring textfield in System alert window?或者还有其他方法可以在系统警报 window 中引入文本字段吗?

     SystemWindowHeader header = SystemWindowHeader( title: SystemWindowText( text: "Incoming Call", fontSize: 10, textColor: Colors.black45), padding: SystemWindowPadding.setSymmetricPadding(12, 12), subTitle: SystemWindowText( text: "9898989899", fontSize: 14, fontWeight: FontWeight.BOLD, textColor: Colors.black87), decoration: SystemWindowDecoration(startColor: Colors.grey[100]), button: SystemWindowButton( text: SystemWindowText( text: "Spam", fontSize: 10, textColor: Colors.black45), tag: "spam_btn"), buttonPosition: ButtonPosition.TRAILING); SystemWindowBody body = SystemWindowBody( rows: [ EachRow( columns: [ EachColumn( text: SystemWindowText( text: "Some body", fontSize: 12, textColor: Colors.black45), ), ], gravity: ContentGravity.CENTER, ), ], padding: SystemWindowPadding(left: 16, right: 16, bottom: 12, top: 12), ); SystemWindowFooter footer = SystemWindowFooter( buttons: [ SystemWindowButton( text: SystemWindowText( text: "Simple button", fontSize: 12, textColor: Colors.blue), tag: "simple_button", padding: SystemWindowPadding(left: 10, right: 10, bottom: 10, top: 10), width: 0, height: SystemWindowButton.WRAP_CONTENT, decoration: SystemWindowDecoration( startColor: Colors.white, endColor: Colors.white, borderWidth: 0, borderRadius: 0.0), ), SystemWindowButton( text: SystemWindowText( text: "Focus button", fontSize: 12, textColor: Colors.white), tag: "focus_button", width: 0, padding: SystemWindowPadding(left: 10, right: 10, bottom: 10, top: 10), height: SystemWindowButton.WRAP_CONTENT, decoration: SystemWindowDecoration( startColor: Colors.lightBlueAccent, endColor: Colors.blue, borderWidth: 0, borderRadius: 30.0), ) ], padding: SystemWindowPadding(left: 16, right: 16, bottom: 12, top: 10), decoration: SystemWindowDecoration(startColor: Colors.white), buttonsPosition: ButtonPosition.CENTER); SystemAlertWindow.showSystemWindow( height: 230, header: header, body: body, footer: footer, margin: SystemWindowMargin(left: 8, right: 8, top: 200, bottom: 0), gravity: SystemWindowGravity.TOP, notificationTitle: "Incoming Call", notificationBody: "+1 646 980 4741", prefMode: prefMode, backgroundColor: Colors.black12, isDisableClicks: false); setState(() { _isShowingWindow = true; });

在此处输入图像描述

I don't thing so.. but with alert dialog you can achieve this stuff like this我不这么认为..但是通过警报对话框你可以实现这样的东西

AlertDialog( 
        title: Text('TextField in Dialog'), 
        content: TextField( 
          onChanged: (value) { }, 
          controller: _textFieldController, 
          decoration: InputDecoration(hintText: "Text Field in Dialog"), 
        ),
    ),

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM