draggable_floating_button

Creator: coderz1093

Last updated:

0 purchases

draggable_floating_button Image
draggable_floating_button Images

Languages

Categories

Add to Cart

Description:

draggable floating button

draggable_floating_button #
We all like the Floating Action Button Widget, but how can it be better?
Well, we made a Draggable Floating Action Button!
You can use it to make the user interact in crazy and unexpected ways with your application.
How Can I Get This Widget? #

Add draggable_floating_button to your pubspec.yaml file
When the notification bar pops up in Android Studio prompting you to get Packages, do so



Add an import statement in your Dart code like so, import 'package:draggable_floating_button/draggable_floating_button.dart';
You are ready to create draggable floating actions buttons

Usage #
DraggableFloatingActionButton(
offset: new Offset(200, 200),
backgroundColor: Theme.of(context).accentColor,
child: new Icon(
Icons.your_icon,
color: lightDfabColor,
),
onPressed: () => foo(),
appContext: context,
appBar: appBar,
data: 'your_data',
);
copied to clipboard
The Draggable Floating Action Button (or DFAB), can be created just like the Floating Action Button, but it has a few features in addition:


You need to pass in an Offset object, to letting the button know where to position itself


You need to pass in the context and appBar of your application in order for the button to calculate correctly which where it has been dragged to across the application.


The data field works in a similar fashion it works in a Draggable widget

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.