You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, if I change _cropAspectRatio, the widget will be rebuilt correctly, but then the user can't change the ratio freely by hand. On the other hand, if I change the _originalCropAspectRatio (of course with setState called), nothing will happen.
I want to find a way to have some clickable buttons for some default ratios, but still keep the ability for the user to change the ratio freely by hand.
The first time this function is called, it works fine (the current crop is reset to 16 / 9 and still editable by hand) but after that, it doesn't do anything at all! it seems somehow flutter caches the actions, and skips the first setState the next time you call this function, and just runs the second one.
making the function async and adding an await Future.delayed(const Duration(milliseconds: 1)); solves the problem but probably this is dependent on device's performance, because if we use 1 microsecond instead of 1 millisecond, it wont work.
Platforms
Android, iOS
Description
Here, if I change
_cropAspectRatio
, the widget will be rebuilt correctly, but then the user can't change the ratio freely by hand. On the other hand, if I change the_originalCropAspectRatio
(of course withsetState
called), nothing will happen.I want to find a way to have some clickable buttons for some default ratios, but still keep the ability for the user to change the ratio freely by hand.
My code
No response
Try do it
I want to change the
cropAspectRatio
but still keep it freely customizable.The text was updated successfully, but these errors were encountered: