fix: row_detail layout error in Windows

This commit is contained in:
Lucas.Xu 2022-07-08 11:45:39 +08:00
parent a6c001941e
commit 8cfacc4bcc

View File

@ -19,7 +19,6 @@ import 'package:app_flowy/generated/locale_keys.g.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:window_size/window_size.dart';
class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate { class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate {
final GridRow rowData; final GridRow rowData;
@ -35,8 +34,8 @@ class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate {
State<RowDetailPage> createState() => _RowDetailPageState(); State<RowDetailPage> createState() => _RowDetailPageState();
void show(BuildContext context) async { void show(BuildContext context) async {
final window = await getWindowInfo(); final windowSize = MediaQuery.of(context).size;
final size = Size(window.frame.size.width * 0.7, window.frame.size.height * 0.7); final size = windowSize * 0.7;
FlowyOverlay.of(context).insertWithRect( FlowyOverlay.of(context).insertWithRect(
widget: OverlayContainer( widget: OverlayContainer(
child: this, child: this,
@ -44,7 +43,7 @@ class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate {
), ),
identifier: RowDetailPage.identifier(), identifier: RowDetailPage.identifier(),
anchorPosition: Offset(-size.width / 2.0, -size.height / 2.0), anchorPosition: Offset(-size.width / 2.0, -size.height / 2.0),
anchorSize: window.frame.size, anchorSize: windowSize,
anchorDirection: AnchorDirection.center, anchorDirection: AnchorDirection.center,
style: FlowyOverlayStyle(blur: false), style: FlowyOverlayStyle(blur: false),
delegate: this, delegate: this,