Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Upgrade packages (#277)
Browse files Browse the repository at this point in the history
更新套件並刪除啟動器內建回饋功能,因為該功能會造成許多 bug 且很少人使用,再者不如在 Discord 中回饋來得方便。
  • Loading branch information
SiongSng committed Nov 28, 2022
2 parents 9256665 + e787910 commit ff9c128
Show file tree
Hide file tree
Showing 23 changed files with 153 additions and 238 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Build App
run: |
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Build
run: |
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Install dependencies
run: |
Expand All @@ -272,7 +272,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Generate coverage
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Pull Request Analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- run: flutter pub get
- name: Analyze code
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Generate coverage
run: |
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@main
with:
flutter-version: 3.0.4
flutter-version: 3.3.9
cache: true
- name: Install Dependencies
if: ${{ runner.os == 'Linux' }}
Expand Down
4 changes: 0 additions & 4 deletions assets/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,6 @@
"rpmlauncher.tips.1": "Press Escape key to return to the previous page",
"rpmlauncher.tips.2": "RPMLauncher will automatically download dependent mods",
"rpmlauncher.tips.3": "Did you find the rickroll easter eggs?",
"rpmlauncher.feedback.submit": "Submit",
"rpmlauncher.feedback.description": "Please describe your issue or suggestion",
"rpmlauncher.feedback.draw": "Draw",
"rpmlauncher.feedback.navigate": "Move Interface",
"rpmlauncher.file.delete.error": "Failed to delete the file. It may be that a game or other program is accessing the file",
"rpmlauncher.exit_confirm.title": "Do you really want to close the window?",
"mods.filter.notfound": "The current filtering method cannot find any mods",
Expand Down
5 changes: 5 additions & 0 deletions lib/handler/window_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ class _SelfWindowController implements WindowController {
await windowManager.show();
}

@override
Future<bool> resizable(bool resizable) async {
return resizable;
}

@override
int get windowId => id;
}
7 changes: 1 addition & 6 deletions lib/screen/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _HomePageState extends State<HomePage> {
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leadingWidth: 300,
leadingWidth: 250,
leading: RowScrollView(
center: false,
child: Row(
Expand Down Expand Up @@ -105,11 +105,6 @@ class _HomePageState extends State<HomePage> {
);
},
),
IconButton(
icon: const Icon(Icons.bug_report),
onPressed: () => LauncherInfo.feedback(context),
tooltip: I18n.format('homepage.bug_report'),
),
IconButton(
icon: const Icon(Icons.change_circle),
tooltip: I18n.format('homepage.update'),
Expand Down
2 changes: 1 addition & 1 deletion lib/screen/loading_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class _LoadingScreenState extends State<LoadingScreen> {
user: SentryUser(
id: Config.getValue('ga_client_id'),
username: userName,
extras: {
data: {
'userOrigin': LauncherInfo.userOrigin,
'githubSourceMap': githubSourceMap,
'config': Config.toMap()
Expand Down
20 changes: 2 additions & 18 deletions lib/screen/main_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
Expand All @@ -14,7 +13,6 @@ import 'package:rpmlauncher/util/data.dart';
import 'package:rpmlauncher/route/GenerateRoute.dart';
import 'package:rpmlauncher/util/i18n.dart';
import 'package:rpmlauncher/util/launcher_info.dart';
import 'package:rpmlauncher/util/RPMFeedbackLocalizations.dart';
import 'package:rpmlauncher/util/theme.dart';
import 'package:rpmlauncher/route/RPMNavigatorObserver.dart';
import 'package:rpmlauncher/util/updater.dart';
Expand Down Expand Up @@ -155,22 +153,8 @@ class _MainScreenState extends State<MainScreen> {
};
}

return BetterFeedback(
theme: FeedbackThemeData(
background: Colors.white10,
feedbackSheetColor: Colors.white12,
bottomSheetDescriptionStyle: const TextStyle(
fontFamily: 'font',
color: Colors.white,
),
),
localeOverride: WidgetsBinding.instance.window.locale,
localizationsDelegates: const [
RPMFeedbackLocalizationsDelegate(),
],
child: widget ??
Scaffold(body: Center(child: Text(title, style: style))),
);
return widget ??
Scaffold(body: Center(child: Text(title, style: style)));
},
onGenerateInitialRoutes: (String initialRouteName) {
return [
Expand Down
2 changes: 0 additions & 2 deletions lib/util/Intents.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ class EscIntent extends Intent {}

class RestartIntent extends Intent {}

class FeedBackIntent extends Intent {}

class FullScreenIntent extends Intent {}
44 changes: 0 additions & 44 deletions lib/util/RPMFeedbackLocalizations.dart

This file was deleted.

27 changes: 0 additions & 27 deletions lib/util/launcher_info.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import 'dart:io';

import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';
import 'package:path/path.dart';
import 'package:pub_semver/pub_semver.dart';
import 'package:rpmlauncher/util/config.dart';
import 'package:rpmlauncher/util/updater.dart';
import 'package:rpmlauncher/util/i18n.dart';
import 'package:rpmtw_dart_common_library/rpmtw_dart_common_library.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

bool kTestMode = false;

Expand Down Expand Up @@ -125,28 +122,4 @@ class LauncherInfo {
static bool isDebugMode = false;

static late DateTime startTime;

static void feedback(BuildContext context) {
BetterFeedback.of(context).show((UserFeedback feedback) async {
String text = feedback.text;
if (text.isAllEmpty) {
return;
}

// ignore: invalid_use_of_internal_member
final realHub = Sentry.currentHub;

final id = await realHub.captureMessage(text, withScope: (scope) {
scope.addAttachment(SentryAttachment.fromUint8List(
feedback.screenshot,
'screenshot.png',
contentType: 'image/png',
));
});
await realHub.captureUserFeedback(SentryUserFeedback(
eventId: id,
comments: '${feedback.text}\n${feedback.extra.toString()}',
));
});
}
}
8 changes: 4 additions & 4 deletions lib/util/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class ThemeUtility {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: const Color.fromARGB(190, 86, 110, 244),
onPrimary: Colors.white)),
backgroundColor: const Color.fromARGB(190, 86, 110, 244),
foregroundColor: Colors.white)),
useMaterial3: false),
ThemeUtility.toInt(Themes.dark): ThemeData(
brightness: Brightness.dark,
Expand All @@ -101,8 +101,8 @@ class ThemeUtility {
)),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: const Color.fromARGB(190, 46, 160, 253),
onPrimary: Colors.white)),
backgroundColor: const Color.fromARGB(190, 46, 160, 253),
foregroundColor: Colors.white)),
useMaterial3: true),
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/util/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class Util {
comparableVersion = Version.parse('$sourceVersion.0');
}
} catch (e) {
String? _preVersion() {
String? preVersion() {
int pos = sourceVersion.indexOf('-pre');
if (pos >= 0) return sourceVersion.substring(0, pos);

Expand All @@ -392,7 +392,7 @@ class Util {
return null;
}

String? str = _preVersion();
String? str = preVersion();
if (str != null) {
try {
return Version.parse(str);
Expand Down
10 changes: 5 additions & 5 deletions lib/view/Edit/mods_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class _ModsViewState extends State<ModsView> {
logger.error(ErrorType.parseModInfo, "Mod Icon Parsing Error $err");
}

void _handle(Map map) {
void handle(Map map) {
try {
Map<String, dynamic> conflictsMap = map.cast<String, dynamic>();
conflictsMap.forEach((key, value) {
Expand All @@ -136,10 +136,10 @@ class _ModsViewState extends State<ModsView> {
}

if (modInfoMap.containsKey("conflicts")) {
_handle(modInfoMap["conflicts"]);
handle(modInfoMap["conflicts"]);
}
if (modInfoMap.containsKey("breaks")) {
_handle(modInfoMap["breaks"]);
handle(modInfoMap["breaks"]);
}

return ModInfo(
Expand Down Expand Up @@ -300,7 +300,7 @@ class _ModsViewState extends State<ModsView> {
Widget build(BuildContext context) {
final ReceivePort progressPort = ReceivePort();

Future<Map<File, ModInfo>> _get() async {
Future<Map<File, ModInfo>> get() async {
final ReceivePort hivePort = ReceivePort();

final List<ModInfo> needPuts = [];
Expand Down Expand Up @@ -329,7 +329,7 @@ class _ModsViewState extends State<ModsView> {
}

return FutureBuilder<Map<File, ModInfo>>(
future: _get(),
future: get(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {
Expand Down
8 changes: 0 additions & 8 deletions lib/widget/launcher_shortcuts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:rpmlauncher/handler/window_handler.dart';
import 'package:rpmlauncher/screen/home_page.dart';
import 'package:rpmlauncher/util/i18n.dart';
import 'package:rpmlauncher/util/Intents.dart';
import 'package:rpmlauncher/util/launcher_info.dart';
import 'package:rpmlauncher/util/data.dart';
import 'package:rpmlauncher/widget/rpmtw_design/OkClose.dart';

Expand Down Expand Up @@ -41,11 +40,6 @@ class LauncherShortcuts extends StatelessWidget {
});
return;
}),
FeedBackIntent:
CallbackAction<FeedBackIntent>(onInvoke: (FeedBackIntent intent) {
LauncherInfo.feedback(navigator.context);
return;
}),
FullScreenIntent: CallbackAction<FullScreenIntent>(
onInvoke: (FullScreenIntent intent) async {
bool isFullScreen = await WindowHandler.isFullScreen();
Expand All @@ -57,8 +51,6 @@ class LauncherShortcuts extends StatelessWidget {
LogicalKeySet(LogicalKeyboardKey.escape): EscIntent(),
LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyR):
RestartIntent(),
LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyF):
FeedBackIntent(),
LogicalKeySet(
LogicalKeyboardKey.f11,
): FullScreenIntent(),
Expand Down
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <desktop_multi_window/desktop_multi_window_plugin.h>
#include <flutter_window_close/flutter_window_close_plugin.h>
#include <rpmlauncher_plugin/rpmlauncher_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <sentry_flutter/sentry_flutter_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>
Expand All @@ -24,6 +25,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) rpmlauncher_plugin_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "RpmlauncherPlugin");
rpmlauncher_plugin_register_with_registrar(rpmlauncher_plugin_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
Expand Down
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
desktop_multi_window
flutter_window_close
rpmlauncher_plugin
screen_retriever
sentry_flutter
url_launcher_linux
window_manager
Expand Down
Loading

0 comments on commit ff9c128

Please sign in to comment.