0

Is there a way to prevent RenderFlex overflow, if the canvas becomes too small? This does not only apply to web but all devices.

Say a user resizes a browser window to 0 height, the "app" will crash.

Edit: Looking for a global solution, something like:

runApp(IgnoreRenderFlexOverflowApp(child: SomeWidget));

class IgnoreRenderFlexOverflowApp extends StatelessWidget {
  final Widget child;

  IgnoreRenderFlexOverflowApp({this.child});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Some app title',
      home: LayoutBuilder(
        builder: (BuildContext context, BoxConstraints constraints) {
          return SizedOverflowBox(
            size: Size(constraints.maxWidth, constraints.maxHeight),
            child: child,
          );
        }
      )
    );
  }
}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mythar
  • 479
  • 1
  • 5
  • 10

1 Answers1

0
sinkWrap :true 

Just Add this your problem will be solved by this