Uma solução interessante para criar um botão responsivo no flutter é utilizar o SizedBox.expand widget, que força o filho a corresponder ao tamanho do pai.
new SizedBox.expand(
child: new RaisedButton(...),
)
Existem muitas alternativas, o que permite mais ou menos essa personalização:
new SizedBox(
width: double.infinity,
// height: double.infinity,
child: new RaisedButton(...),
)
ou usando um ConstrainedBox
new ConstrainedBox(
constraints: const BoxConstraints(minWidth: double.infinity),
child: new RaisedButton(...),
)
Top comments (0)