flutter align widget

51

Align(
  alignment: Alignment.topRight,
  child: Text("widget"),
)
Center(
        child: Container(
          color: Colors.blue[100], 
          height: 200.0,
          width: 200.0,
          child: Align(
            alignment: Alignment.center, // or AlignmentDirectional.center,
                     //Alignment(0.0,0.0) value must be 1 to -1
            child: Text('Align')
          )
        ),
      )
Center(
  child: Container(
    height: 120.0,
    width: 120.0,
    color: Colors.blue[50],
    child: Align(
      alignment: Alignment(0.5, 0.6),
      child: FlutterLogo(
        size: 60,
      ),
    ),
  ),
)

Comments

Submit
0 Comments