mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: more friendly err tip
This commit is contained in:
@@ -19,6 +19,7 @@ import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/auto_hide.dart';
|
||||
import 'package:toolbox/view/widget/markdown.dart';
|
||||
import 'package:toolbox/view/widget/percent_circle.dart';
|
||||
|
||||
import '../../../core/route.dart';
|
||||
@@ -516,21 +517,25 @@ class _ServerPageState extends State<ServerPage>
|
||||
_showFailReason(s.status);
|
||||
},
|
||||
child: Text(
|
||||
hasErr ? l10n.viewErr : s.getTopRightStr(s.spi),
|
||||
s.getTopRightStr(s.spi),
|
||||
style: UIs.text13Grey,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showFailReason(ServerStatus ss) {
|
||||
final md = '''
|
||||
${ss.err?.solution ?? l10n.unknown}
|
||||
|
||||
```sh
|
||||
${ss.err?.message ?? l10n.unknownError}
|
||||
''';
|
||||
context.showRoundDialog(
|
||||
title: Text(l10n.error),
|
||||
child: SingleChildScrollView(
|
||||
child: Text(ss.err ?? l10n.unknownError),
|
||||
),
|
||||
child: SingleChildScrollView(child: SimpleMarkdown(data: md)),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Shares.copy(ss.err ?? l10n.unknownError),
|
||||
onPressed: () => Shares.copy(md),
|
||||
child: Text(l10n.copy),
|
||||
)
|
||||
],
|
||||
|
||||
@@ -41,7 +41,6 @@ final class _AutoHideState extends State<AutoHide> {
|
||||
void _setupTimer() {
|
||||
_timer?.cancel();
|
||||
_timer = Timer.periodic(const Duration(seconds: 3), (_) {
|
||||
debugPrint('[AutoHideFab._timer] trigger timer');
|
||||
if (_isScrolling) return;
|
||||
if (!_visible) return;
|
||||
if (!widget.controller.positions.any((e) => e.maxScrollExtent >= 0)) {
|
||||
|
||||
Reference in New Issue
Block a user