MixinNetwork / flutter-plugins

🧱 Flutter plugins used in Mixin Messenger.
MIT License
443 stars 192 forks source link

[desktop_webview_window]A RenderFlex overflowed #81

Open ilgnefz opened 2 years ago

ilgnefz commented 2 years ago

If you click the minimize button in the upper right corner of the Web window, you will most likely get an overflow error

======== Exception caught by rendering library =====================================================
The following assertion was thrown during layout:
A RenderFlex overflowed by 119 pixels on the right.

The relevant error-causing widget was: 
  Row Row:file:///C:/Users/ilgnefz/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/desktop_webview_window-0.1.6/lib/src/title_bar.dart:218:10
The overflowing RenderFlex has an orientation of Axis.horizontal.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#45928 OVERFLOWING
...  parentData: offset=Offset(0.0, 0.0) (can use size)
...  constraints: BoxConstraints(w=0.8, h=40.0)
...  size: Size(0.8, 40.0)
...  direction: horizontal
...  mainAxisAlignment: start
...  mainAxisSize: max
...  crossAxisAlignment: center
...  textDirection: ltr
...  verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
====================================================================================================
ilgnefz commented 2 years ago

Also need to modify the following readme

import 'package:desktop_webview_window/desktop_webview_window.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Add this your main method.
  // used to show a webview title bar.
  if (runWebViewTitleBarWidget(args)) {
    return;
  }

  runApp(MyApp());
}

To the following

import 'package:desktop_webview_window/desktop_webview_window.dart';

void main() async {

  // Add this your main method.
  // used to show a webview title bar.
  if (runWebViewTitleBarWidget(args)) {
    return;
  }

  WidgetsFlutterBinding.ensureInitialized();

  runApp(MyApp());
}
strongwill01 commented 2 years ago

marker