I have faced an issue using ResizableWidget with Easy_Localization package.
Easy_Localization trigger widget three to rebuild if the application locale is changed using the context.setLocale method.
However, ResizableWidget prevent rebuild if the width or height (depending on axis direction) is not changed.
This makes the translation fail for widgets inside ResizableWidget.
I have workaround this issue by editing resizable_widget.dart like this:
@override
Widget build(BuildContext context) {
// Force children to rebuild
_controller.eventStream.add(_controller);
return LayoutBuilder(
builder: (context, constraints) {
_controller.setSizeIfNeeded(constraints);
return StreamBuilder(
stream: _controller.eventStream.stream,
builder: (context, snapshot) =>
_info.isHorizontalSeparator
? Column(children: _controller.children.map(_buildChild).toList())
: Row(children: _controller.children.map(_buildChild).toList()),
);
},
);
}
I know this will cause rebuild children every time the ResizableWidget rebuild and may will make _controller.setSizeIfNeeded(constraints) useless, but this is what I have to do right now.
Another question ...
Why does ResizableWidget prevent rebuilding children if the application state is changed, the BoxConstraint is one of the application states on which ResizableWidget depends on, but maybe there is another state that children need.
I have faced an issue using
ResizableWidgetwithEasy_Localizationpackage.Easy_Localizationtrigger widget three to rebuild if the application locale is changed using thecontext.setLocalemethod.However,
ResizableWidgetprevent rebuild if the width or height (depending on axis direction) is not changed.This makes the translation fail for widgets inside
ResizableWidget.I have workaround this issue by editing
resizable_widget.dartlike this:I know this will cause rebuild children every time the
ResizableWidgetrebuild and may will make_controller.setSizeIfNeeded(constraints)useless, but this is what I have to do right now.Another question ...
Why does
ResizableWidgetprevent rebuilding children if the application state is changed, theBoxConstraintis one of the application states on whichResizableWidgetdepends on, but maybe there is another state that children need.