new: delete all in settings page

This commit is contained in:
lollipopkit
2023-08-30 18:52:28 +08:00
parent be62767d45
commit c899a84b29
10 changed files with 74 additions and 41 deletions

View File

@@ -470,7 +470,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -478,7 +478,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -602,7 +602,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -610,7 +610,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -628,7 +628,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -636,7 +636,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -657,7 +657,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -670,7 +670,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
@@ -696,7 +696,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -709,7 +709,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@@ -732,7 +732,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
DEVELOPMENT_TEAM = BA88US33G6; DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -745,7 +745,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
extension LocaleX on Locale { extension LocaleX on Locale {
String get name { String get code {
if (countryCode == null) { if (countryCode == null) {
return languageCode; return languageCode;
} }

View File

@@ -163,6 +163,7 @@ class AppRoute {
String? path, String? path,
String? text, String? text,
String? langCode, String? langCode,
String? title,
}) { }) {
return AppRoute( return AppRoute(
EditorPage( EditorPage(
@@ -170,6 +171,7 @@ class AppRoute {
path: path, path: path,
text: text, text: text,
langCode: langCode, langCode: langCode,
title: title,
), ),
'editor'); 'editor');
} }

View File

@@ -2,8 +2,8 @@
class BuildData { class BuildData {
static const String name = "ServerBox"; static const String name = "ServerBox";
static const int build = 515; static const int build = 517;
static const String engine = "3.13.1"; static const String engine = "3.13.1";
static const String buildAt = "2023-08-30 16:31:26.338447"; static const String buildAt = "2023-08-30 17:23:28.418667";
static const int modifications = 3; static const int modifications = 2;
} }

View File

@@ -1,5 +1,5 @@
const backendUrl = 'https://res.lolli.tech'; const backendUrl = 'https://res.lolli.tech';
const baseUrl = '$backendUrl/serverbox'; const baseResUrl = '$backendUrl/serverbox';
const joinQQGroupUrl = 'https://jq.qq.com/?_wv=1027&k=G0hUmPAq';
const myGithub = 'https://github.com/lollipopkit'; const myGithub = 'https://github.com/lollipopkit';
const appHelpUrl = '$myGithub/flutter_server_box#-help'; const appHelpUrl = '$myGithub/flutter_server_box#-help';
const appWikiUrl = '$myGithub/flutter_server_box/wiki';

View File

@@ -5,7 +5,7 @@ import '../res/url.dart';
class AppService { class AppService {
Future<AppUpdate> getUpdate() async { Future<AppUpdate> getUpdate() async {
final resp = await Dio().get('$baseUrl/update.json'); final resp = await Dio().get('$baseResUrl/update.json');
return AppUpdate.fromJson(resp.data); return AppUpdate.fromJson(resp.data);
} }
} }

View File

@@ -30,11 +30,14 @@ class EditorPage extends StatefulWidget {
/// Higher priority than [path] /// Higher priority than [path]
final String? langCode; final String? langCode;
final String? title;
const EditorPage({ const EditorPage({
Key? key, Key? key,
this.path, this.path,
this.text, this.text,
this.langCode, this.langCode,
this.title,
}) : super(key: key); }) : super(key: key);
@override @override
@@ -110,7 +113,11 @@ class _EditorPageState extends State<EditorPage> with AfterLayoutMixin {
PreferredSizeWidget _buildAppBar() { PreferredSizeWidget _buildAppBar() {
return CustomAppBar( return CustomAppBar(
title: TwoLineText(up: getFileName(widget.path) ?? '', down: _s.editor), centerTitle: true,
title: TwoLineText(
up: widget.title ?? getFileName(widget.path) ?? '',
down: _s.editor,
),
actions: [ actions: [
PopupMenuButton<String>( PopupMenuButton<String>(
icon: const Icon(Icons.language), icon: const Icon(Icons.language),
@@ -134,21 +141,20 @@ class _EditorPageState extends State<EditorPage> with AfterLayoutMixin {
Widget _buildBody() { Widget _buildBody() {
return SingleChildScrollView( return SingleChildScrollView(
child: CodeTheme( child: CodeTheme(
data: CodeThemeData( data: CodeThemeData(
styles: _codeTheme, styles: _codeTheme,
), ),
child: CodeField( child: CodeField(
focusNode: _focusNode, focusNode: _focusNode,
controller: _controller, controller: _controller,
textStyle: _textStyle, textStyle: _textStyle,
lineNumberStyle: const LineNumberStyle( lineNumberStyle: const LineNumberStyle(
width: 47, width: 47,
margin: 7, margin: 7,
),
), ),
), ),
); ));
} }
@override @override

View File

@@ -271,6 +271,10 @@ class _HomePageState extends State<HomePage>
title: Text(_s.about), title: Text(_s.about),
child: _buildAboutContent(), child: _buildAboutContent(),
actions: [ actions: [
TextButton(
onPressed: () => openUrl(appWikiUrl),
child: const Text('Wiki'),
),
TextButton( TextButton(
onPressed: () => openUrl(appHelpUrl), onPressed: () => openUrl(appHelpUrl),
child: Text(_s.feedback), child: Text(_s.feedback),
@@ -380,6 +384,7 @@ class _HomePageState extends State<HomePage>
final result = await AppRoute.editor( final result = await AppRoute.editor(
text: text, text: text,
langCode: 'json', langCode: 'json',
title: _s.setting,
).go(context); ).go(context);
if (result == null) { if (result == null) {
return; return;

View File

@@ -110,6 +110,26 @@ class _SettingPageState extends State<SettingPage> {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: Text(_s.setting), title: Text(_s.setting),
actions: [
IconButton(
onPressed: () => showRoundDialog(
context: context,
title: Text(_s.attention),
child: Text(_s.sureDelete(_s.all)),
actions: [
TextButton(
onPressed: () {
_setting.box.deleteAll(_setting.box.keys);
context.pop();
showSnackBar(context, Text(_s.success));
},
child: Text(_s.ok, style: const TextStyle(color: Colors.red)),
),
],
),
icon: const Icon(Icons.delete),
),
],
), ),
body: ListView( body: ListView(
padding: const EdgeInsets.symmetric(horizontal: 17), padding: const EdgeInsets.symmetric(horizontal: 17),
@@ -609,8 +629,8 @@ class _SettingPageState extends State<SettingPage> {
final items = S.supportedLocales final items = S.supportedLocales
.map( .map(
(e) => PopupMenuItem<String>( (e) => PopupMenuItem<String>(
value: e.name, value: e.code,
child: Text(e.name), child: Text(e.code),
), ),
) )
.toList(); .toList();

View File

@@ -474,9 +474,9 @@
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -489,9 +489,9 @@
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -504,9 +504,9 @@
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 515; CURRENT_PROJECT_VERSION = 517;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.515; MARKETING_VERSION = 1.0.517;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;