I need to have a secondary action to be performed during the long press of my FloatingActionButton
in my app.
floatingActionButton: FloatingActionButton(
onPressed: someFunction,
child: Icon(Icons.add),
onLongPressed: //Something like this or any other solution
),
I'd suggest to use InkWell
so that you can also have ripple effect.
Here is how you can use it.
floatingActionButton: InkWell(
splashColor: Colors.blue,
onLongPress: () {
// handle your long press functionality here
},
child: FloatingActionButton(
child: Icon(Icons.add),
onPressed: someFunction,
),
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With