mirror of
https://github.com/tonytins/bullseye.git
synced 2025-03-21 22:52:19 +00:00
Renamed desktop.dart to adaptive.dart
- Added Attach to Device to launch settings - Fallback to standard flutter desktop window on Linux
This commit is contained in:
parent
6f3938e848
commit
dd34e59e94
3 changed files with 27 additions and 15 deletions
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
|
@ -14,6 +14,11 @@
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"flutterMode": "profile"
|
"flutterMode": "profile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Flutter: Attach to Device",
|
||||||
|
"type": "dart",
|
||||||
|
"request": "attach"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
bool get isDesktop =>
|
bool get isDesktop =>
|
||||||
(Platform.isLinux || Platform.isMacOS || Platform.isWindows);
|
(Platform.isLinux || Platform.isMacOS || Platform.isWindows);
|
||||||
|
bool get isMacWin => (Platform.isMacOS || Platform.isWindows);
|
||||||
|
|
||||||
class WindowButtons extends StatelessWidget {
|
class WindowButtons extends StatelessWidget {
|
||||||
@override
|
@override
|
|
@ -1,6 +1,6 @@
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||||
import 'package:bullseye/desktop.dart';
|
import 'package:bullseye/adaptive.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -96,20 +96,26 @@ class _GamePageState extends State<GamePage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget desktopContainer() {
|
Widget desktopContainer() {
|
||||||
return Column(children: [
|
var score = Score(totalScore: _model.totalScore, round: _model.round);
|
||||||
Container(
|
|
||||||
height: 50,
|
// Fallback to standard Flutter window on Linux while retaining the score toolbar.
|
||||||
child: WindowTitleBarBox(
|
// Rendering on Linux isn't quite perfect yet, but it's better than nothing.
|
||||||
child: Row(
|
if (isMacWin) {
|
||||||
children: [
|
return Column(children: [
|
||||||
Expanded(
|
Container(
|
||||||
child: MoveWindow(
|
height: 50,
|
||||||
child: Score(
|
child: WindowTitleBarBox(
|
||||||
totalScore: _model.totalScore, round: _model.round)))
|
child: Row(
|
||||||
],
|
children: [Expanded(child: MoveWindow(child: score))],
|
||||||
))),
|
))),
|
||||||
Expanded(child: gameContainer()),
|
Expanded(child: gameContainer()),
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
return Column(children: [
|
||||||
|
Container(height: 50, child: score),
|
||||||
|
Expanded(child: gameContainer()),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Add table
Reference in a new issue