Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from CCXXXI/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
CCXXXI authored Oct 2, 2021
2 parents 0534916 + e6b431c commit 856b2bc
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions lib/home/home_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions lib/home/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class HomePage extends StatelessWidget {
'求实创造 为人师表',
style: TextStyle(fontFamily: fontSerif),
),
leading: ecnuButton(),
)
: null,
body: Row(
Expand All @@ -40,6 +41,7 @@ class HomePage extends StatelessWidget {
),
],
selectedIconTheme: IconTheme.of(context),
leading: ecnuButton(),
);
}),
Expanded(
Expand Down Expand Up @@ -81,6 +83,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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'utils/sentry.dart';
Future<void> main() async {
initLogger();
await Settings.init();
if (GetPlatform.isDesktop) initDesktop();
if (GetPlatform.isDesktop && !GetPlatform.isWeb) initDesktop();
await initSentry(const MyApp());
}

Expand Down
2 changes: 1 addition & 1 deletion lib/settings/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
}
2 changes: 1 addition & 1 deletion lib/utils/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
4 changes: 2 additions & 2 deletions lib/utils/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -45,3 +45,6 @@ flutter:
- family: NotoSerifSC
fonts:
- asset: assets/fonts/NotoSerifSC-Regular.otf

assets:
- assets/images/

0 comments on commit 856b2bc

Please sign in to comment.