feat: sync the icon & title (#4150)

* feat: sync the icon & title

* feat: diff the view data when refreshing

* fix: unable to update folder

* test: refactor bloc tests
This commit is contained in:
Lucas.Xu
2023-12-20 10:08:35 +08:00
committed by GitHub
parent b466b425a5
commit 9a1ea138fc
24 changed files with 378 additions and 789 deletions

View File

@ -1,9 +1,10 @@
// ignore: import_of_legacy_library_into_null_safe
import 'dart:ffi';
import 'package:ffi/ffi.dart' as ffi;
import 'package:flutter/foundation.dart';
import 'package:logger/logger.dart';
import 'package:ffi/ffi.dart' as ffi;
import 'ffi.dart';
class Log {
@ -13,15 +14,14 @@ class Log {
Log() {
_logger = Logger(
printer: PrettyPrinter(
methodCount: 2, // number of method calls to be displayed
errorMethodCount:
8, // number of method calls if stacktrace is provided
lineLength: 120, // width of the output
colors: true, // Colorful log messages
printEmojis: true, // Print an emoji for each log message
printTime: false // Should each log print contain a timestamp
),
level: kDebugMode ? Level.verbose : Level.info,
methodCount: 2, // number of method calls to be displayed
errorMethodCount: 8, // number of method calls if stacktrace is provided
lineLength: 120, // width of the output
colors: true, // Colorful log messages
printEmojis: true, // Print an emoji for each log message
printTime: false, // Should each log print contain a timestamp
),
level: kDebugMode ? Level.trace : Level.info,
);
}
@ -29,7 +29,11 @@ class Log {
if (isReleaseVersion()) {
log(0, toNativeUtf8(msg));
} else {
Log.shared._logger.i(msg, error, stackTrace);
Log.shared._logger.i(
msg,
error: error,
stackTrace: stackTrace,
);
}
}
@ -37,7 +41,11 @@ class Log {
if (isReleaseVersion()) {
log(1, toNativeUtf8(msg));
} else {
Log.shared._logger.d(msg, error, stackTrace);
Log.shared._logger.d(
msg,
error: error,
stackTrace: stackTrace,
);
}
}
@ -45,7 +53,11 @@ class Log {
if (isReleaseVersion()) {
log(3, toNativeUtf8(msg));
} else {
Log.shared._logger.w(msg, error, stackTrace);
Log.shared._logger.w(
msg,
error: error,
stackTrace: stackTrace,
);
}
}
@ -53,7 +65,11 @@ class Log {
if (isReleaseVersion()) {
log(2, toNativeUtf8(msg));
} else {
Log.shared._logger.v(msg, error, stackTrace);
Log.shared._logger.t(
msg,
error: error,
stackTrace: stackTrace,
);
}
}
@ -61,7 +77,11 @@ class Log {
if (isReleaseVersion()) {
log(4, toNativeUtf8(msg));
} else {
Log.shared._logger.e(msg, error, stackTrace);
Log.shared._logger.e(
msg,
error: error,
stackTrace: stackTrace,
);
}
}
}

View File

@ -16,7 +16,7 @@ dependencies:
protobuf: ^3.1.0
dartz: ^0.10.1
freezed_annotation:
logger: ^1.0.0
logger: ^2.0.0
plugin_platform_interface: ^2.1.3
json_annotation: ^4.7.0