0

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.

wcyankees424
  • 2,554
  • 2
  • 12
  • 24
veradeus
  • 41
  • 4

1 Answers1

0

Found the solution, used Alignment(x,y) to scale and position the widget ;)

veradeus
  • 41
  • 4