fix(app): 移除设置页调试服务器地址
This commit is contained in:
1 parent
2b95c79931
commit
061aac6577
6 files changed
+25
-273
No files matched your search
@@ -1,16 +1,13 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../core/config/app_config.dart';
|
||||
import '../../core/config/locale_controller.dart';
|
||||
import '../../core/data/models/drama.dart';
|
||||
import '../../core/data/models/watch_progress.dart';
|
||||
import '../../core/data/repositories/watch_history_repository.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/widgets/server_endpoint_dialog.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
enum MyPageAction { home, discover, resume }
|
||||
@@ -114,10 +111,7 @@ class MineLogic extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> showLanguage(
|
||||
BuildContext context, {
|
||||
bool showServerSetting = kDebugMode,
|
||||
}) async {
|
||||
Future<void> showLanguage(BuildContext context) async {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
@@ -146,17 +140,6 @@ class MineLogic extends ChangeNotifier {
|
||||
Navigator.pop(sheetContext);
|
||||
},
|
||||
),
|
||||
if (showServerSetting) ...[
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
key: const Key('server-endpoint-setting'),
|
||||
leading: const Icon(Icons.dns_outlined),
|
||||
title: Text(l10n.serverAddress),
|
||||
subtitle: Text(AppConfig.apiBaseUrl),
|
||||
trailing: const Icon(Icons.edit_outlined),
|
||||
onTap: () => _editServerEndpoint(context, l10n),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
@@ -166,11 +149,6 @@ class MineLogic extends ChangeNotifier {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _editServerEndpoint(
|
||||
BuildContext context,
|
||||
AppLocalizations l10n,
|
||||
) => showServerEndpointDialog(context, l10n);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_disposed = true;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -49,7 +48,6 @@ class MyPage extends StatefulWidget {
|
||||
this.dramas,
|
||||
this.onDramaSelected,
|
||||
this.wallet,
|
||||
this.debugShowSetting = kDebugMode,
|
||||
});
|
||||
|
||||
final Drama drama;
|
||||
@@ -67,7 +65,6 @@ class MyPage extends StatefulWidget {
|
||||
final List<Drama>? dramas;
|
||||
final ValueChanged<Drama>? onDramaSelected;
|
||||
final WalletController? wallet;
|
||||
final bool debugShowSetting;
|
||||
|
||||
@override
|
||||
State<MyPage> createState() => _MyPageState();
|
||||
@@ -759,10 +756,7 @@ class _MyPageState extends State<MyPage> {
|
||||
};
|
||||
return InkWell(
|
||||
key: const Key('mine-language'),
|
||||
onTap: () => logic.showLanguage(
|
||||
context,
|
||||
showServerSetting: widget.debugShowSetting,
|
||||
),
|
||||
onTap: () => logic.showLanguage(context),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
@@ -844,10 +838,7 @@ class _MyPageState extends State<MyPage> {
|
||||
_menuTile(
|
||||
icon: Icons.settings_rounded,
|
||||
title: l10n.settings,
|
||||
onTap: () => logic.showLanguage(
|
||||
context,
|
||||
showServerSetting: widget.debugShowSetting,
|
||||
),
|
||||
onTap: () => logic.showLanguage(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user