mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: only req noti perm on Android
This commit is contained in:
@@ -58,8 +58,8 @@ Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartss
|
||||
## ⬇️ Download
|
||||
Platform | Support | Sign
|
||||
--- | --- | ---
|
||||
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://res.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703) | Full | My own certificate
|
||||
[Linux](https://res.lolli.tech/serverbox/latest.AppImage) / [Windows](https://res.lolli.tech/serverbox/latest.win.zip) | Not tested | Flutter default certificate
|
||||
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://cdn.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703) | Full | My own certificate
|
||||
[Linux](https://cdn.lolli.tech/serverbox/latest.AppImage) / [Windows](https://cdn.lolli.tech/serverbox/latest.win.zip) | Not tested | Flutter default certificate
|
||||
|
||||
|
||||
## 🆘 Help
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
## ⬇️ 下载
|
||||
平台 | 支持 | 签名
|
||||
:-: | :-: | :-:
|
||||
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://res.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703) | 完整 | 个人可信签名
|
||||
[Linux](https://res.lolli.tech/serverbox/latest.AppImage) / [Windows](https://res.lolli.tech/serverbox/latest.win.zip) | 未测试 | Flutter 默认签名
|
||||
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://cdn.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703) | 完整 | 个人可信签名
|
||||
[Linux](https://cdn.lolli.tech/serverbox/latest.AppImage) / [Windows](https://cdn.lolli.tech/serverbox/latest.win.zip) | 未测试 | Flutter 默认签名
|
||||
|
||||
|
||||
## 🆘 帮助
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:toolbox/data/res/build_data.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/rebuild.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/page/home.dart';
|
||||
import 'package:toolbox/view/page/home/home.dart';
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import 'package:toolbox/view/page/backup.dart';
|
||||
import 'package:toolbox/view/page/container.dart';
|
||||
import 'package:toolbox/view/page/home.dart';
|
||||
import 'package:toolbox/view/page/home/home.dart';
|
||||
import 'package:toolbox/view/page/iperf.dart';
|
||||
import 'package:toolbox/view/page/ping.dart';
|
||||
import 'package:toolbox/view/page/private_key/edit.dart';
|
||||
|
||||
28
lib/view/page/home/appbar.dart
Normal file
28
lib/view/page/home/appbar.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
part of 'home.dart';
|
||||
|
||||
final class _AppBar extends CustomAppBar {
|
||||
final ValueNotifier<int> selectIndex;
|
||||
|
||||
const _AppBar({
|
||||
required this.selectIndex,
|
||||
super.title,
|
||||
super.actions,
|
||||
super.centerTitle,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder(
|
||||
valueListenable: selectIndex,
|
||||
builder: (_, idx, __) {
|
||||
if (idx == AppTab.ssh.index) {
|
||||
return SizedBox(
|
||||
height: CustomAppBar.barHeight ??
|
||||
0 + MediaQuery.of(context).padding.top,
|
||||
);
|
||||
}
|
||||
return super.build(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -11,26 +11,28 @@ import 'package:toolbox/core/extension/context/common.dart';
|
||||
import 'package:toolbox/core/extension/context/dialog.dart';
|
||||
import 'package:toolbox/core/extension/context/locale.dart';
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/core/route.dart';
|
||||
import 'package:toolbox/core/update.dart';
|
||||
import 'package:toolbox/core/utils/platform/auth.dart';
|
||||
import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/core/utils/platform/perm.dart';
|
||||
import 'package:toolbox/core/utils/ui.dart';
|
||||
import 'package:toolbox/data/model/app/github_id.dart';
|
||||
import 'package:toolbox/data/model/app/tab.dart';
|
||||
import 'package:toolbox/data/res/build_data.dart';
|
||||
import 'package:toolbox/data/res/github_id.dart';
|
||||
import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/misc.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/data/res/ui.dart';
|
||||
import 'package:toolbox/data/res/url.dart';
|
||||
import 'package:toolbox/view/widget/appbar.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/markdown.dart';
|
||||
|
||||
import '../../core/route.dart';
|
||||
import '../../core/utils/ui.dart';
|
||||
import '../../data/model/app/github_id.dart';
|
||||
import '../../data/model/app/tab.dart';
|
||||
import '../../data/res/build_data.dart';
|
||||
import '../../data/res/misc.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
import '../../data/res/url.dart';
|
||||
import '../widget/appbar.dart';
|
||||
import '../widget/cardx.dart';
|
||||
|
||||
part 'appbar.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
const HomePage({super.key});
|
||||
@@ -318,7 +320,19 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
||||
// Auth required for first launch
|
||||
BioAuth.go();
|
||||
|
||||
PermUtils.request(Permission.notification).then((suc) {
|
||||
_reqNotiPerm();
|
||||
|
||||
if (Stores.setting.autoCheckAppUpdate.fetch()) {
|
||||
doUpdate(context);
|
||||
}
|
||||
HomeWidgetMC.update();
|
||||
await GetIt.I.allReady();
|
||||
await Pros.server.load();
|
||||
await Pros.server.refresh();
|
||||
}
|
||||
|
||||
Future<void> _reqNotiPerm() async {
|
||||
final suc = await PermUtils.request(Permission.notification);
|
||||
if (!suc) {
|
||||
final noNotiPerm = Stores.setting.noNotiPerm;
|
||||
if (noNotiPerm.fetch()) return;
|
||||
@@ -336,15 +350,6 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
||||
],
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (Stores.setting.autoCheckAppUpdate.fetch()) {
|
||||
doUpdate(context);
|
||||
}
|
||||
HomeWidgetMC.update();
|
||||
await GetIt.I.allReady();
|
||||
await Pros.server.load();
|
||||
await Pros.server.refresh();
|
||||
}
|
||||
|
||||
Future<void> _onLongPressSetting() async {
|
||||
@@ -378,30 +383,3 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final class _AppBar extends CustomAppBar {
|
||||
final ValueNotifier<int> selectIndex;
|
||||
|
||||
const _AppBar({
|
||||
required this.selectIndex,
|
||||
super.title,
|
||||
super.actions,
|
||||
super.centerTitle,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder(
|
||||
valueListenable: selectIndex,
|
||||
builder: (_, idx, __) {
|
||||
if (idx == AppTab.ssh.index) {
|
||||
return SizedBox(
|
||||
height: CustomAppBar.barHeight ??
|
||||
0 + MediaQuery.of(context).padding.top,
|
||||
);
|
||||
}
|
||||
return super.build(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,8 @@ Future<void> _onPkg(BuildContext context, ServerPrivateInfo spi) async {
|
||||
final gotoUpgrade = await context.showRoundDialog<bool>(
|
||||
title: Text(l10n.attention),
|
||||
child: SingleChildScrollView(
|
||||
child: Text('${l10n.pkgUpgradeTip}\n${l10n.foundNUpdate(upgradeable.length)}\n\n$upgradeCmd'),
|
||||
child: Text(
|
||||
'${l10n.pkgUpgradeTip}\n${l10n.foundNUpdate(upgradeable.length)}\n\n$upgradeCmd'),
|
||||
),
|
||||
actions: [
|
||||
CountDownBtn(
|
||||
|
||||
Reference in New Issue
Block a user