Fix: Dark mode in diagnostics view

This commit is contained in:
otsmr 2026-02-21 01:35:21 +01:00
parent bbe6954ca6
commit 80910c1ba0
3 changed files with 9 additions and 54 deletions

View file

@ -4,7 +4,7 @@
## 0.0.93 ## 0.0.93
- Feature: Verification checkmark for friends - Feature: Verification checkmark for friends
- Fix: Added contacts in contact sharing where not click able - Fix: Added contacts in contact sharing that were not clickable.
- Fix: Open chat after the image expires in case a draft message exists - Fix: Open chat after the image expires in case a draft message exists
- Fix: Restore flames as a plus user - Fix: Restore flames as a plus user
- Fix: Route not found when sharing image - Fix: Route not found when sharing image
@ -12,6 +12,7 @@
- Fix: Increase show time of the focus indication - Fix: Increase show time of the focus indication
- Fix: Quoted text message not shown properly - Fix: Quoted text message not shown properly
- Fix: Push notification in groups when someone saves an image - Fix: Push notification in groups when someone saves an image
- Fix: Dark mode in diagnostics view
## 0.0.92 ## 0.0.92

View file

@ -83,7 +83,7 @@ class PurchasesProvider with ChangeNotifier, DiagnosticableTreeMixin {
if (user != null && isPayingUser(planFromString(user.subscriptionPlan))) { if (user != null && isPayingUser(planFromString(user.subscriptionPlan))) {
Log.info('Started IPA timer for verification.'); Log.info('Started IPA timer for verification.');
globalForceIpaCheck = Timer(const Duration(seconds: 5), () async { globalForceIpaCheck = Timer(const Duration(seconds: 5), () async {
Log.warn('Force Ipa check was not stopped. Requesting forced check...'); Log.info('Force Ipa check was not stopped. Requesting forced check...');
await apiService.forceIpaCheck(); await apiService.forceIpaCheck();
}); });
} }

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart'; import 'package:go_router/go_router.dart';
import 'package:share_plus/share_plus.dart'; import 'package:twonly/src/constants/routes.keys.dart';
import 'package:twonly/src/utils/log.dart'; import 'package:twonly/src/utils/log.dart';
import 'package:twonly/src/views/components/loader.dart'; import 'package:twonly/src/views/components/loader.dart';
@ -13,8 +13,6 @@ class DiagnosticsView extends StatefulWidget {
} }
class _DiagnosticsViewState extends State<DiagnosticsView> { class _DiagnosticsViewState extends State<DiagnosticsView> {
final ScrollController _scrollController = ScrollController();
String? _debugLogText; String? _debugLogText;
@override @override
@ -28,41 +26,6 @@ class _DiagnosticsViewState extends State<DiagnosticsView> {
setState(() {}); setState(() {});
} }
Future<void> _scrollToBottom() async {
// Assuming the button is at the bottom of the scroll view
await _scrollController.animateTo(
_scrollController.position.maxScrollExtent, // Scroll to the bottom
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
Future<void> _shareDebugLog() async {
if (_debugLogText == null) return;
final directory = await getApplicationSupportDirectory();
final logFile = XFile('${directory.path}/app.log');
final params = ShareParams(
text: 'Debug log',
files: [logFile],
);
final result = await SharePlus.instance.share(params);
if (result.status != ShareResultStatus.success) {
await Clipboard.setData(
ClipboardData(text: _debugLogText!),
);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Log copied to clipboard!'),
),
);
}
}
}
Future<void> _deleteDebugLog() async { Future<void> _deleteDebugLog() async {
if (await deleteLogFile()) { if (await deleteLogFile()) {
if (!mounted) return; if (!mounted) return;
@ -100,13 +63,10 @@ class _DiagnosticsViewState extends State<DiagnosticsView> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
TextButton( TextButton(
onPressed: _shareDebugLog, onPressed: () =>
context.push(Routes.settingsHelpContactUs),
child: const Text('Share debug log'), child: const Text('Share debug log'),
), ),
TextButton(
onPressed: _scrollToBottom,
child: const Text('Scroll to Bottom'),
),
TextButton( TextButton(
onPressed: _deleteDebugLog, onPressed: _deleteDebugLog,
child: const Text('Delete Log File'), child: const Text('Delete Log File'),
@ -186,7 +146,6 @@ class _LogViewerWidgetState extends State<LogViewerWidget> {
selected: selected, selected: selected,
onSelected: (_) => _setFilter(label), onSelected: (_) => _setFilter(label),
selectedColor: _colorForLevel(label).withAlpha(120), selectedColor: _colorForLevel(label).withAlpha(120),
backgroundColor: Colors.grey.shade200,
); );
} }
@ -198,7 +157,7 @@ class _LogViewerWidgetState extends State<LogViewerWidget> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'monospace', fontFamily: 'monospace',
); );
const msgStyle = TextStyle(color: Colors.black87, fontFamily: 'monospace'); const msgStyle = TextStyle(fontFamily: 'monospace');
return TextSpan( return TextSpan(
children: [ children: [
@ -249,12 +208,7 @@ class _LogViewerWidgetState extends State<LogViewerWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.only(left: 8),
decoration: BoxDecoration(
color: Colors.grey.shade50,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.shade300),
),
child: Scrollbar( child: Scrollbar(
controller: _controller, controller: _controller,
child: ListView.builder( child: ListView.builder(