From 711f82735ee843538672ed9369ea59c39242eab8 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Mon, 9 Oct 2023 17:06:28 -0400 Subject: [PATCH] icon fix --- assets/i18n/en.json | 7 +++++++ lib/pages/developer.dart | 28 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 5a9d4c6..5debbde 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -164,5 +164,12 @@ "title": "Developer Logs", "command": "Command", "copied": "Selection copied" + }, + "log": { + "error": "Error", + "warning": "Warning", + "info": "Info", + "debug": "Debug", + "trace": "Trace" } } \ No newline at end of file diff --git a/lib/pages/developer.dart b/lib/pages/developer.dart index d0e9e3d..a021cea 100644 --- a/lib/pages/developer.dart +++ b/lib/pages/developer.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_translate/flutter_translate.dart'; import 'package:go_router/go_router.dart'; +import 'package:loggy/loggy.dart'; import 'package:xterm/xterm.dart'; import '../tools/tools.dart'; @@ -28,7 +29,7 @@ class DeveloperPage extends ConsumerStatefulWidget { class DeveloperPageState extends ConsumerState { final terminalController = TerminalController(); - + var logLevelDropDown = log.level.logLevel; final TextEditingController _debugCommandController = TextEditingController(); @override @@ -115,7 +116,30 @@ class DeveloperPageState extends ConsumerState { ? null : () async { await copySelection(context); - }) + }), + DropdownMenu( + initialSelection: logLevelDropDown, + onSelected: (value) { + if (value != null) { + setState(() { + logLevelDropDown = value; + //log. = value; + setVeilidLogLevel(value); + }); + } + }, + dropdownMenuEntries: [ + DropdownMenuEntry( + value: LogLevel.error, label: translate('log.error')), + DropdownMenuEntry( + value: LogLevel.warning, label: translate('log.warning')), + DropdownMenuEntry( + value: LogLevel.info, label: translate('log.info')), + DropdownMenuEntry( + value: LogLevel.debug, label: translate('log.debug')), + DropdownMenuEntry( + value: traceLevel, label: translate('log.trace')), + ]) ], title: Text(translate('developer.title')), centerTitle: true,