feat: fix some bugs.

This commit is contained in:
2022-01-18 18:58:18 +08:00
parent a088f857e8
commit c567122d84
5 changed files with 15 additions and 8 deletions
+2
View File
@@ -52,6 +52,8 @@ class Api {
if (builder is GetStatusCodeFunc) return builder({"statusCode": resp.statusCode});
T? res;
try {
if (resp.statusCode != HttpStatus.ok && resp.bodyBytes.length == 0)
throw HttpErrorCode(resp.statusCode, message: 'No resp body');
var decodeBody = json.decode(utf8.decode(resp.bodyBytes));
res = decodeBody is Map ? builder(decodeBody) : builder({'list': decodeBody});
} catch (e) {
-1
View File
@@ -6,7 +6,6 @@ import 'package:dde_gesture_manager/utils/helper.dart';
import 'package:dde_gesture_manager/utils/notificator.dart';
import 'package:flutter/material.dart';
import 'package:markdown_editor_ot/markdown_editor.dart';
import 'package:url_launcher/url_launcher.dart';
class DMarkdownField extends StatefulWidget {
const DMarkdownField({
-1
View File
@@ -34,7 +34,6 @@ class _MarketWidgetState extends State<MarketWidget> {
MarketSortType _type = MarketSortType.recommend;
String? _selected;
String? _hovering;
int _refreshKey = 0;
List<int> _likedSchemes = [];
@override
@@ -23,8 +23,7 @@ class TableCellShortcutListener extends StatefulWidget {
class _TableCellShortcutListenerState extends State<TableCellShortcutListener> {
List<KeyNames> _shortcut = [];
bool inputMode = false;
FocusNode _focusNode = FocusNode();
final FocusNode _focusNode = FocusNode();
_handleFocusChange() {
if (!_focusNode.hasFocus) {
@@ -43,6 +42,7 @@ class _TableCellShortcutListenerState extends State<TableCellShortcutListener> {
@override
void initState() {
super.initState();
var __shortcut = widget.initShortcut.split('+');
__shortcut.forEach((name) {
var keyNames = getPhysicalKeyNamesByRealName(name);
@@ -50,7 +50,6 @@ class _TableCellShortcutListenerState extends State<TableCellShortcutListener> {
});
_shortcut.sort();
_focusNode.addListener(_handleFocusChange);
super.initState();
}
@override
@@ -70,8 +69,8 @@ class _TableCellShortcutListenerState extends State<TableCellShortcutListener> {
onTap: () {
setState(() {
_shortcut = [];
inputMode = true;
});
_focusNode.requestFocus();
},
child: Focus(
autofocus: true,