Alert Dialog mit Abgerundeten Ecken flattern

Ich versuche, erstellen Sie einen alert-dialog mit abgerundeten Ecken Flattern, wie unten screenshot. fügen Sie auch meinen code hier, aber meine Ausgabe ist genau das, unterscheidet sich von dem erwarteten. irgendjemand, bitte helft mir.

Erwartet Warnmeldung

Alert Dialog mit Abgerundeten Ecken flattern

mein code ist hier.

void _showAlert() {
AlertDialog dialog = new AlertDialog(
  content: new Container(
    width: 260.0,
    height: 230.0,
    decoration: new BoxDecoration(
      shape: BoxShape.rectangle,
      color: const Color(0xFFFFFF),
      borderRadius: new BorderRadius.all(new Radius.circular(32.0)),
    ),
    child: new Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: <Widget>[
        //dialog top
        new Expanded(
          child: new Row(
            children: <Widget>[
              new Container(
                //padding: new EdgeInsets.all(10.0),
                decoration: new BoxDecoration(
                  color: Colors.white,
                ),
                child: new Text(
                  'Rate',
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 18.0,
                    fontFamily: 'helvetica_neue_light',
                  ),
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),

        //dialog centre
        new Expanded(
          child: new Container(
              child: new TextField(
            decoration: new InputDecoration(
              border: InputBorder.none,
              filled: false,
              contentPadding: new EdgeInsets.only(
                  left: 10.0, top: 10.0, bottom: 10.0, right: 10.0),
              hintText: ' add review',
              hintStyle: new TextStyle(
                color: Colors.grey.shade500,
                fontSize: 12.0,
                fontFamily: 'helvetica_neue_light',
              ),
            ),
          )),
          flex: 2,
        ),

        //dialog bottom
        new Expanded(
          child: new Container(
            padding: new EdgeInsets.all(16.0),
            decoration: new BoxDecoration(
              color: const Color(0xFF33b17c),
            ),
            child: new Text(
              'Rate product',
              style: TextStyle(
                color: Colors.white,
                fontSize: 18.0,
                fontFamily: 'helvetica_neue_light',
              ),
              textAlign: TextAlign.center,
            ),
          ),
        ),
      ],
    ),
  ),
);

showDialog(context: context, child: dialog);
}
}

Die Ausgabe, die ich von den oben genannten code ist.

Alert Dialog mit Abgerundeten Ecken flattern

  • ich weiß nicht warum, aber das Ergebnis hat mich zum lachen so schwer
InformationsquelleAutor Rosemary | 2018-06-21
Schreibe einen Kommentar