Last updated:
0 purchases
gpt draggable fab
Draggable Fab generated with Chat GPT
Features #
Drag the fab wherever you want.
Getting started #
Add draggable fab to your pubspec
draggable_fab: 0.0.2
copied to clipboard
Usage #
use like normal fab :
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: DraggableFab(
onPressed: _incrementCounter,
tooltip: 'Increment',
iconData: Icons.add,
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.