marcglasberg / i18n_extension

Flutter package: Easy and powerful internationalization using Dart extensions.
Other
294 stars 64 forks source link

Disable automatic setState within I18n #58

Open hlemcke opened 3 years ago

hlemcke commented 3 years ago

To properly integrate with MaterialApp Localizations, redraw must take place outside I18n. As a non-breaking change I suggest to add a bool property autoRedraw with default value true to I18n.

bool autoRedraw;
I18n({ this.autoRedraw = true, ...})

This enhancement allows exception free integration with MaterialApp. Together with #56 makes enhancement #55 obselete.

marcglasberg commented 3 years ago

Sorry, I don't understand what you mean. The autoRedraw parameter is there to do what exactly? Could you please explain in more detail or PR?