From d741bd8e8df71d7cb38f8d18771c75904089ed24 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 05:27:40 +0800 Subject: [PATCH 1/7] chore: assets/images/ --- pubspec.lock | 2 +- pubspec.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index bb76e576..582cc824 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -204,7 +204,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.0.7" + version: "3.0.8" io: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9da065d6..45cfd36d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,3 +45,6 @@ flutter: - family: NotoSerifSC fonts: - asset: assets/fonts/NotoSerifSC-Regular.otf + + assets: + - assets/images/ From 9c35eb9ab18971e83c1d00300767075bf67552f9 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 05:43:51 +0800 Subject: [PATCH 2/7] fix: MissingPluginException on web --- lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 8e4f9b6e..f2552a70 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,7 +13,7 @@ import 'utils/sentry.dart'; Future main() async { initLogger(); await Settings.init(); - if (GetPlatform.isDesktop) initDesktop(); + if (GetPlatform.isDesktop && !GetPlatform.isWeb) initDesktop(); await initSentry(const MyApp()); } From 91819effb36fba02bf3da3d2364b9f11885a438b Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 05:46:36 +0800 Subject: [PATCH 3/7] fix: overflow on web --- lib/settings/theme.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/settings/theme.dart b/lib/settings/theme.dart index 77ce42a1..24760f49 100644 --- a/lib/settings/theme.dart +++ b/lib/settings/theme.dart @@ -37,7 +37,7 @@ void updateTheme() { Get.snackbar( '主题切换目前有 bug,请手动重启以使更改生效', 'https://github.com/jonataslaw/getx/issues/1878', - duration: const Duration(days: 42), + duration: const Duration(days: 1), ); } } From 9fdd89f65d98a981c48e5838d6ab86f58dc42d8a Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 06:10:35 +0800 Subject: [PATCH 4/7] feat: add school badge to appbar --- lib/home/home_logic.dart | 3 +++ lib/home/home_view.dart | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/home/home_logic.dart b/lib/home/home_logic.dart index 9d8ac2c0..e7859769 100644 --- a/lib/home/home_logic.dart +++ b/lib/home/home_logic.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_settings_screens/flutter_settings_screens.dart'; import 'package:get/get.dart'; +import '../utils/gu.dart'; import '../utils/logger.dart'; class HomeLogic extends GetxController { @@ -44,6 +45,8 @@ class HomeLogic extends GetxController { void onPageChanged(int idx_) { if (isAnimating.isFalse) idx.value = idx_; } + + void ecnuLongPress() => gu(); // todo } // NavigationRail: Timetable, Toolbox, Settings diff --git a/lib/home/home_view.dart b/lib/home/home_view.dart index b1591dad..fcd969e8 100644 --- a/lib/home/home_view.dart +++ b/lib/home/home_view.dart @@ -23,6 +23,7 @@ class HomePage extends StatelessWidget { '求实创造 为人师表', style: TextStyle(fontFamily: fontSerif), ), + leading: ecnuButton(), ) : null, body: Row( @@ -81,6 +82,15 @@ class HomePage extends StatelessWidget { : null, ); } + + Widget ecnuButton() => GestureDetector( + child: IconButton( + iconSize: 42, + icon: const ImageIcon(AssetImage('assets/images/ecnu_c.png')), + onPressed: () {}, + ), + onLongPress: logic.ecnuLongPress, + ); } class _LabelIcon { From 6d8e5f8bb11b84811fb8d080ff01afc04330be79 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 06:13:31 +0800 Subject: [PATCH 5/7] chore: 0.5.0+7 --- lib/utils/messages.dart | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/messages.dart b/lib/utils/messages.dart index d9904e5b..b5bc8ec6 100644 --- a/lib/utils/messages.dart +++ b/lib/utils/messages.dart @@ -4,8 +4,8 @@ import 'pangu.dart'; // record them manually const appName = 'ECNU Timetable'; const packageName = 'io.github.ccxxxi.ecnu_timetable'; -const version = '0.4.0'; -const buildNumber = '6'; +const version = '0.5.0'; +const buildNumber = '7'; const release = '$packageName@$version+$buildNumber'; diff --git a/pubspec.yaml b/pubspec.yaml index 45cfd36d..d8918197 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: 更美观更智能的ECNU课程表。 # Prevent the package from being accidentally published to pub.dev. publish_to: "none" -version: 0.4.0+6 +version: 0.5.0+7 environment: sdk: ">=2.15.0-172.0.dev" From 37da1ae46327a0ab117916dab359ef968e3cf83f Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 06:17:05 +0800 Subject: [PATCH 6/7] feat: add school badge to rail --- lib/home/home_view.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/home/home_view.dart b/lib/home/home_view.dart index fcd969e8..d3456dfc 100644 --- a/lib/home/home_view.dart +++ b/lib/home/home_view.dart @@ -41,6 +41,7 @@ class HomePage extends StatelessWidget { ), ], selectedIconTheme: IconTheme.of(context), + leading: ecnuButton(), ); }), Expanded( From e6b431c70cb9165790bb724377db2413dc4ca2f9 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Sun, 3 Oct 2021 06:18:31 +0800 Subject: [PATCH 7/7] fix: setWindowMinSize(const Size(300, 400)) --- lib/utils/desktop.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/desktop.dart b/lib/utils/desktop.dart index 42ef9be9..b6cd60d3 100644 --- a/lib/utils/desktop.dart +++ b/lib/utils/desktop.dart @@ -14,7 +14,7 @@ void initDesktop() { setWindowTitle(appName); logger.d('setWindowMinSize'); - setWindowMinSize(const Size(300, 300)); + setWindowMinSize(const Size(300, 400)); logger.i('initDesktop end.'); }