Compare commits

..

3 Commits

Author SHA1 Message Date
YuanXuan 509aae27df Merge branch 'release/1.0.2' 2025-09-12 11:21:05 +08:00
YuanXuan c02486e072 feat: 清理日志 2025-09-12 11:20:41 +08:00
YuanXuan 747dba216f feat: remove lint 2025-08-29 13:51:06 +08:00
5 changed files with 8 additions and 98 deletions

View File

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

View File

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

View File

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

View File

@ -54,14 +54,6 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" 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: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -91,14 +83,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.1" 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: matcher:
dependency: transitive dependency: transitive
description: description:

View File

@ -1,6 +1,6 @@
name: yx_net_inspector 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. 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 homepage: https://github.com/your-username/yx_net_inspector
environment: environment:
@ -10,47 +10,9 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# 可选依赖如果使用Dio拦截器请添加dio依赖
# dio: ^5.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter 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