Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter-resizable-widget

a widget that allow user resize the widget with drag

example

bandicam.2021-11-11.12-34-41-056.mp4

const double dragwidgetsize = 30;

class homepage extends statelesswidget {
  const homepage({key? key}) : super(key: key);

  @override
  widget build(buildcontext context) {
    final areaheight = get.height * 0.70;
    final areawidth = get.width * 0.70;
    final controller = get.put(
      resizablewidgetcontroller(
        initialposition: offset(areawidth / 2, areaheight / 2),
        areaheight: areaheight,
        areawidth: areawidth,
        height: areaheight / 2,
        width: areawidth / 2,
        minwidth: 50,
        minheight: 50,
      ),
    );

    return scaffold(
      appbar: appbar(
        title: const text('resizable widget'),
      ),
      body: layoutbuilder(builder: (context, constraint) {
        return container(
          width: constraint.maxwidth,
          height: constraint.maxheight,
          color: colors.black,
          child: unconstrainedbox(
            child: container(
              width: areawidth,
              height: areaheight,
              alignment: alignment.center,
              decoration: const boxdecoration(
                image: decorationimage(
                  image: assetimage('assets/background.png'),
                  fit: boxfit.cover,
                ),
              ),
              child: resizablewidget(
                dragwidgetheight: dragwidgetsize,
                dragwidgetwidth: dragwidgetsize,
                controller: controller,
                dragwidget: container(
                  height: dragwidgetsize,
                  width: dragwidgetsize,
                  decoration: const boxdecoration(
                    shape: boxshape.circle,
                    color: colors.white24,
                  ),
                ),
                child: container(
                  decoration: boxdecoration(
                    border: border.all(
                      color: colors.white,
                    ),
                  ),
                ),
              ),
            ),
          ),
        );
      }),
    );
  }
}


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.