flutter_desktop: fix canvas height - tabBarHeight

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-08-03 15:31:19 +08:00
parent 0dd55d6ef1
commit d4c735bc3a
10 changed files with 130 additions and 96 deletions

View File

@@ -213,13 +213,13 @@ class _ConnectionPageState extends State<ConnectionPage> {
/// Get all the saved peers.
Widget getPeers() {
final size = MediaQuery.of(context).size;
final windowWidth = MediaQuery.of(context).size.width;
final space = 8.0;
var width = size.width - 2 * space;
var width = windowWidth - 2 * space;
final minWidth = 320.0;
if (size.width > minWidth + 2 * space) {
final n = (size.width / (minWidth + 2 * space)).floor();
width = size.width / n - 2 * space;
if (windowWidth > minWidth + 2 * space) {
final n = (windowWidth / (minWidth + 2 * space)).floor();
width = windowWidth / n - 2 * space;
}
final cards = <Widget>[];
var peers = gFFI.peers();