Some useful options

This commit is contained in:
LittleSheep 2024-08-11 00:36:27 +08:00
parent b5da8ece4a
commit 00092ba7b6
4 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:solian/controllers/chat_events_controller.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/providers/theme_switcher.dart'; import 'package:solian/providers/theme_switcher.dart';
import 'package:solian/router.dart'; import 'package:solian/router.dart';
@ -93,6 +94,18 @@ class _SettingScreenState extends State<SettingScreen> {
AppRouter.instance.pushNamed('about'); AppRouter.instance.pushNamed('about');
}, },
), ),
TextButton(
style: const ButtonStyle(
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
),
child: Text('messageHistoryWipe'.tr),
onPressed: () {
final chatHistory = ChatEventController();
chatHistory.initialize().then((_) async {
await chatHistory.database.localEvents.wipeLocalEvents();
});
},
),
], ],
).paddingSymmetric(horizontal: 12, vertical: 8), ).paddingSymmetric(horizontal: 12, vertical: 8),
], ],

View File

@ -373,4 +373,5 @@ const i18nEnglish = {
'messageOutOfSync': 'May Out of Sync with Server', 'messageOutOfSync': 'May Out of Sync with Server',
'messageOutOfSyncCaption': 'messageOutOfSyncCaption':
'Since the App has entered the background, there may be a time difference between the message list and the server. Click to Refresh.', 'Since the App has entered the background, there may be a time difference between the message list and the server. Click to Refresh.',
'messageHistoryWipe': 'Wipe local message history',
}; };

View File

@ -339,4 +339,5 @@ const i18nSimplifiedChinese = {
'callStatusReconnected': '重连中', 'callStatusReconnected': '重连中',
'messageOutOfSync': '消息可能与服务器脱节', 'messageOutOfSync': '消息可能与服务器脱节',
'messageOutOfSyncCaption': '由于 App 进入后台,消息列表可能与服务器存在时差,点击刷新。', 'messageOutOfSyncCaption': '由于 App 进入后台,消息列表可能与服务器存在时差,点击刷新。',
'messageHistoryWipe': '清除消息记录',
}; };

View File

@ -1,3 +1,5 @@
import 'dart:math' as math;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/account_status.dart'; import 'package:solian/models/account_status.dart';
@ -54,6 +56,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
backgroundColor: backgroundColor:
SolianTheme.isLargeScreen(context) ? Colors.transparent : null, SolianTheme.isLargeScreen(context) ? Colors.transparent : null,
child: SafeArea( child: SafeArea(
bottom: false,
child: Column( child: Column(
children: [ children: [
Obx(() { Obx(() {
@ -187,7 +190,10 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
}, },
), ),
], ],
).paddingOnly(top: 8) ).paddingOnly(
top: 8,
bottom: math.max(8, MediaQuery.of(context).padding.bottom),
),
], ],
), ),
), ),