From 8d91855f24b554f48717caa7c51416de2e18e7cd Mon Sep 17 00:00:00 2001 From: Tricked <72335827+SkyBlockDev@users.noreply.github.com> Date: Thu, 3 Mar 2022 08:40:32 +0100 Subject: [PATCH] fix: windows build issue? --- .github/workflows/flutterci.yml | 2 ++ lib/main.dart | 34 ++++++++++++++++----------------- pubspec.lock | 28 +++++++++++++++++++++++++++ pubspec.yaml | 7 ++++++- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/.github/workflows/flutterci.yml b/.github/workflows/flutterci.yml index 18a95b8..0c56354 100644 --- a/.github/workflows/flutterci.yml +++ b/.github/workflows/flutterci.yml @@ -62,6 +62,7 @@ jobs: channel: beta cache: true - run: flutter config --enable-windows-desktop + - run: flutter pub run flutter_native_splash:create - run: flutter build windows - run: choco install make -y - run: make innoinstall @@ -100,6 +101,7 @@ jobs: - run: sudo apt-get update -y - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev vlc libvlc-dev libwebkit2gtk-4.0-dev libmediainfo-dev dpkg-dev alien - run: flutter config --enable-linux-desktop + - run: flutter pub run flutter_native_splash:create - run: flutter build linux --release - name: Build .deb executable diff --git a/lib/main.dart b/lib/main.dart index 7ab811c..c61558b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -40,10 +40,11 @@ void main(List args) async { windowManager.waitUntilReadyToShow().then((_) async { // Hide window title bar - - await windowManager.setTitleBarStyle('hidden'); + if (defaultTargetPlatform == TargetPlatform.windows) { + await windowManager.setTitleBarStyle('hidden'); + await windowManager.setMinimumSize(const Size(755, 545)); + } await windowManager.setSize(const Size(800, 600)); - await windowManager.setMinimumSize(const Size(755, 545)); await windowManager.center(); await windowManager.show(); await windowManager.setSkipTaskbar(false); @@ -176,24 +177,23 @@ class _TModInstallerPageState extends State { return true; }).toList(); return NavigationView( - appBar: NavigationAppBar( - title: () { - return const DragToMoveArea( - child: Align( - alignment: AlignmentDirectional.centerStart, - child: Text("TMod Installer"), - ), - ); - }(), - actions: defaultTargetPlatform == TargetPlatform.windows - ? DragToMoveArea( + appBar: defaultTargetPlatform == TargetPlatform.windows + ? NavigationAppBar( + title: () { + return const DragToMoveArea( + child: Align( + alignment: AlignmentDirectional.centerStart, + child: Text("TMod Installer"), + ), + ); + }(), + actions: DragToMoveArea( child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: const [Spacer(), WindowButtons()], ), - ) - : null, - ), + )) + : null, pane: NavigationPane( selected: index, onChanged: (i) => setState(() => index = i), diff --git a/pubspec.lock b/pubspec.lock index 8d2f92d..05bc891 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -15,6 +15,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.3.1" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" args: dependency: "direct main" description: @@ -316,6 +323,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.9" + flutter_native_splash: + dependency: "direct main" + description: + name: flutter_native_splash + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" flutter_svg: dependency: "direct main" description: @@ -382,6 +396,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" intl: dependency: transitive description: @@ -814,6 +835,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + universal_io: + dependency: transitive + description: + name: universal_io + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" url_launcher: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index beceabb..2607c6c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,10 @@ dependencies: system_theme: ^1.0.1 flutter_acrylic: ^1.0.0+1 provider: ^6.0.2 + flutter_native_splash: ^2.0.5 url_launcher: ^6.0.20 url_strategy: ^0.2.0 + bitsdojo_window: ^0.1.1+1 window_manager: ^0.1.6 shared_preferences: ^2.0.8 flutter_svg: ^1.0.3 @@ -31,7 +33,6 @@ dependencies: file_selector_macos: file_selector_windows: file_selector: ^0.8.3 - bitsdojo_window: ^0.1.1+1 dev_dependencies: build_runner: ^2.0.0 @@ -43,6 +44,10 @@ dev_dependencies: # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec +flutter_native_splash: + color: '#42a5f5' + image: assets/tmodinstaller.png + flutter: assets: - assets/Logo.svg