more robust parsing of settings (issue #115)

This commit is contained in:
Jonas Bark
2025-10-18 09:14:17 +02:00
parent 3b1c05aba4
commit 45fecfb4f6
3 changed files with 11 additions and 12 deletions

View File

@@ -250,14 +250,6 @@ jobs:
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
#12 Modify Tag if it Exists
- name: Modify Tag
if: env.TAG_EXISTS && inputs.build_github
id: modify_tag
run: |
new_version="${{ env.VERSION }}-build-${{ github.run_number }}"
echo "VERSION=$new_version" >> $GITHUB_ENV
#13 Create Release
- name: Create Release
if: inputs.build_github

View File

@@ -115,10 +115,16 @@ class KeyPair {
)
: Offset.zero;
final buttons = decoded['actions']
.map<ControllerButton?>((e) => ControllerButton.values.firstOrNullWhere((element) => element.name == e))
.where((e) => e != null)
.cast<ControllerButton>()
.toList();
if (buttons.isEmpty) {
return null;
}
return KeyPair(
buttons: decoded['actions']
.map<ControllerButton>((e) => ControllerButton.values.firstWhere((element) => element.name == e))
.toList(),
buttons: buttons,
logicalKey: decoded.containsKey('logicalKey') && int.parse(decoded['logicalKey']) != 0
? LogicalKeyboardKey(int.parse(decoded['logicalKey']))
: null,

View File

@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:dartx/dartx.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../bluetooth/messages/notification.dart';
@@ -27,7 +28,7 @@ class _LogviewerState extends State<LogViewer> {
if (mounted) {
setState(() {
_actions.add((date: DateTime.now(), entry: data.toString()));
_actions = _actions.takeLast(60).toList();
_actions = _actions.takeLast(kIsWeb ? 1000 : 60).toList();
});
if (_scrollController.hasClients) {
// scroll to the bottom