Flattern ausrichten textfield nach unten und text oben

Wie kann ich die Ausrichtung für den text von oben und textfield von unten? Dies ist eine Art chat-ähnliche Oberfläche.

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Retrieve Text Input'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.end,

          children: <Widget>[
            Text(
              'Hello, How are you?\nwow',
              textAlign: TextAlign.left,
              overflow: TextOverflow.ellipsis,
              //style: new TextStyle(fontWeight: FontWeight.bold),
            ),
            TextField(
              controller: myController,
              onChanged: (text) {
                //print("First text field: $text");
              },
              onSubmitted: (text) {
                print(text);
                //myController.clear();
                myController.text = "";
              },
              decoration: new InputDecoration(
                  hintText:"Enter your response."
              ),
              focusNode: _focusNode,
              autofocus: true,
            ),
          ],
        ),
      ),
    );
  }

Habe ich versucht, die Trennung von text und Textfeldern in Containern statt, aber ohne Erfolg.

Gibt es einen Weg, es zu tun in flattern ähnlich wie iOS-layout-constraints, wo textfield beschränkt sich auf Tastatur-Höhe und der text ist beschränkt auf den textfield?

InformationsquelleAutor lws803 | 2018-07-10
Schreibe einen Kommentar