Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: How to get rid of the first touch delay?

Tags:

flutter

touch

I have a little issue with Flutter. I did a clean install and everything works smoothly. Nonetheless, there is a delay of half a second between my touch and the action of a button (or menu hamburger). This delay exists only for the first touch action. After the first touch / click, any further touch action is without delay.

This problem exists on the emulator but also on a real device.

Could you explain to me why (and how to fix it)?

like image 259
John Doe Avatar asked Jan 19 '26 03:01

John Doe


1 Answers

Thanks to @RandalSchwartz the problem is now solved.

Flutter applications are slower in development mode (with the hot reload). This cause the app to have a delay with the first touch action (on a button or hamburger menu for example).

This also cause the app to have a long splash screen in development mode (around 3 seconds)

Therefore the solution is pretty simple if you want to get rid of all the waiting times, just launch you app in release mode with the following command:

"flutter run --release"

like image 139
John Doe Avatar answered Jan 21 '26 08:01

John Doe