The package make easier drag and drop stack of widgets
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: EasyDragAndDrop(
initialPositions: [
Offset(-100, 0),
Offset(0, -100),
],
width: 300,
height: 300,
items: [
FlutterLogo(),
FlutterLogo(),
],
),
),
);
}
Run this command:
With Flutter:
$ flutter pub add easy_drag_and_drop
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
easy_drag_and_drop: ^0.0.5
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:easy_drag_and_drop/easy_drag_and_drop.dart';
Download details:
Author: SonaHunanyan