adjustable_positioned 1.0.0 copy "adjustable_positioned: ^1.0.0" to clipboard
adjustable_positioned: ^1.0.0 copied to clipboard

A Positioned Widget that can handle repositioning itself based on user input.

A Positioned Widget that can handle repositioning itself based on user input.

Features #

Reposition your widget.

Change the size of your widget.

Customize drag handles.

Sample

Getting started #

1. Depend on it #

Add this to your package's pubspec.yaml file:

dependencies:
    adjustable_positioned: '^1.0.0'
copied to clipboard

2. Install it

You can install packages from the command line:

$ pub get
..
copied to clipboard

Alternatively, your editor might support pub. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:adjustable_positioned/adjustable_positioned.dart';
copied to clipboard

Usage #

...
var handleSize = 24.0;
Stack(
    children: [
        Positioned(...),
        AdjustablePositionedWidget<Object>(
            startX: 48,
            startY: 64,
            startW: 128,
            startH: 128,
            minW: 64,
            minH: 64,
            activeAdjustmentCallback: (rect) { /** Do something */ },
            finishedAdjustmentCallback: (rect) { /** Do something else */ },
            handleWidgetBuilder: (context, handleId) => const Icon(Icons.circle),
            handleSize: handleSize,
            dragData: null,
            child: Padding(
                padding: EdgeInsets.all(handleSize),
                child: Container(color: Colors.red,),
            ),
        ),
    ....
    ]);
...
copied to clipboard

Additional information #

https://github.com/jdrotos/adjustable_positioned

1
likes
130
points
22
downloads

Publisher

verified publisherdrotos.dev

Weekly Downloads

2024.07.08 - 2025.01.20

A Positioned Widget that can handle repositioning itself based on user input.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on adjustable_positioned