I would like to paint widgets outside the canvas and display only cropped portion ie., the screen's size or my own size and I want to do this dynamically. Eg:sample img
I was able to do this by using
UnconstrainedBox(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.lightBlue,
//width: MediaQuery.of(context).size.width,
//height: MediaQuery.of(context).size.height ,
width: _size.width,
height: _size.height,
child: FittedBox(
alignment: Alignment.bottomCenter,
fit: BoxFit.none,
child: Container(
width: _size.width,
height: _size.height * 2,
child: MyWidget,
),
),
),
),
)
But using this setup allows me only to scale the widget to 3x since the alignment coordinates have only 3 positions along one axis. I want to be able to scale the widget to nx and display any of the portion. Pls help.