Merge branch 'release/1.0.2'

This commit is contained in:
YuanXuan 2025-09-12 11:21:05 +08:00
commit 509aae27df
5 changed files with 8 additions and 98 deletions

View File

@ -39,10 +39,6 @@ class YxNetInspectorController extends ChangeNotifier {
void initialize(YxNetInspectorConfig config) {
_config = config;
_showFloatingBall = config.showFloatingBall;
if (kDebugMode) {
debugPrint('🔍 YX 网络检查器已初始化');
}
}
///
@ -72,10 +68,6 @@ class YxNetInspectorController extends ChangeNotifier {
_requestCount++;
_trimLogs();
notifyListeners();
if (kDebugMode) {
debugPrint('📡 请求已记录: $method $url');
}
}
///
@ -117,12 +109,6 @@ class YxNetInspectorController extends ChangeNotifier {
}
notifyListeners();
if (kDebugMode) {
debugPrint(
'📨 响应已记录: $statusCode for ${originalLog.method} ${originalLog.url}',
);
}
}
///
@ -154,12 +140,6 @@ class YxNetInspectorController extends ChangeNotifier {
}
notifyListeners();
if (kDebugMode) {
debugPrint(
'❌ 错误已记录: $error for ${originalLog.method} ${originalLog.url}',
);
}
}
///
@ -170,10 +150,6 @@ class YxNetInspectorController extends ChangeNotifier {
_errorCount = 0;
_totalDuration = 0;
notifyListeners();
if (kDebugMode) {
debugPrint('🧹 所有日志已清空');
}
}
///

View File

@ -96,16 +96,10 @@ class _YxFloatingBallState extends State<YxFloatingBall>
OverlayState? overlay;
try {
overlay = Overlay.of(context, rootOverlay: true);
print('YxNetInspector: 成功找到根 Overlay');
} catch (e) {
print('YxNetInspector: 根 Overlay 查找失败: $e');
debugPrint('YxNetInspector: 根 Overlay 查找失败: $e');
// Overlay.of
overlay = _findOverlayInContext(context);
if (overlay != null) {
print('YxNetInspector: 手动查找 Overlay 成功');
} else {
print('YxNetInspector: 手动查找 Overlay 也失败');
}
}
if (overlay == null) {
@ -144,9 +138,8 @@ class _YxFloatingBallState extends State<YxFloatingBall>
overlay.insert(overlayEntry);
_currentOverlayEntry = overlayEntry;
print('YxNetInspector: 检查器面板显示成功');
} catch (e) {
print('YxNetInspector: 插入 OverlayEntry 失败: $e');
debugPrint('YxNetInspector: 插入 OverlayEntry 失败: $e');
//
setState(() {
_isExpanded = false;
@ -176,7 +169,6 @@ class _YxFloatingBallState extends State<YxFloatingBall>
void _createCustomOverlay() {
// Overlay
//
print('YxNetInspector: 无法找到 Overlay 上下文,请确保 YxNetInspector 在 MaterialApp 内部使用');
// SnackBar print
WidgetsBinding.instance.addPostFrameCallback((_) {
@ -190,7 +182,7 @@ class _YxFloatingBallState extends State<YxFloatingBall>
);
} catch (e) {
// ScaffoldMessenger
print('YxNetInspector: 无法显示检查器面板 - 请确保在 MaterialApp 内使用');
debugPrint('YxNetInspector: 无法显示检查器面板 - 请确保在 MaterialApp 内使用');
}
//

View File

@ -66,10 +66,6 @@ class _YxNetInspectorState extends State<YxNetInspector> {
//
_controller = YxNetInspectorController.instance;
_controller.initialize(widget.config);
if (kDebugMode) {
debugPrint('🔍 YX Net Inspector: App wrapper initialized');
}
}
@override

View File

@ -54,14 +54,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -91,14 +83,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.1"
lints:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
matcher:
dependency: transitive
description:

View File

@ -1,6 +1,6 @@
name: yx_net_inspector
description: A powerful network inspector with floating debug ball for Flutter apps. Monitor HTTP requests, responses, and debug network issues in real-time.
version: 1.0.0
version: 1.0.2
homepage: https://github.com/your-username/yx_net_inspector
environment:
@ -10,47 +10,9 @@ environment:
dependencies:
flutter:
sdk: flutter
# 可选依赖如果使用Dio拦截器请添加dio依赖
# dio: ^5.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware
# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages