Skip to content
Rein Gundersen Bentdal edited this page Feb 14, 2020 · 1 revision
Text('some text')
  .bold()
  .fontSize(24)
  .padding(all: 10)
  .backgroundColor(Colors.amber)
  .alignment(Alignment.center);

"Native" flutter eqivalent

Align(
  alignment: Alignment.center,
  child: DecoratedBox(
    decoration: BoxDecoration(
      color: Colors.amber,
    ),
    child: Padding(
      padding: EdgeInsets.all(10),
      child: Text(
        'some text', 
        style: TextStyle(
          fontSize: 24,
          fontWeight: FontWeight.bold,
        ),
      ),
    ),
  ),
);
Clone this wiki locally