diff --git a/lib/src/debug_helper.dart b/lib/src/debug_helper.dart index 792d46b..1a474ca 100644 --- a/lib/src/debug_helper.dart +++ b/lib/src/debug_helper.dart @@ -27,15 +27,17 @@ class DebugHelper extends StatelessWidget { children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 16), - child: Row(children: [ - Expanded( - child: DefaultTextStyle( - style: context.textTheme.titleMedium!, - child: title, + child: Row( + children: [ + Expanded( + child: DefaultTextStyle( + style: context.textTheme.titleMedium!, + child: title, + ), ), - ), - ...actions, - ]), + ...actions, + ], + ), ), const SizedBox(height: 8), Padding(padding: contentPadding, child: child), diff --git a/lib/src/debug_overlay.dart b/lib/src/debug_overlay.dart index d0953fc..5b12c35 100644 --- a/lib/src/debug_overlay.dart +++ b/lib/src/debug_overlay.dart @@ -154,10 +154,12 @@ class DebugOverlayState extends State { _isVisible && (_isInDebugMode || !widget.enableOnlyInDebugMode) ? _buildBottomSheet() : null; - return Stack(children: [ - if (widget.child != null) widget.child!, - if (bottomSheet != null) Positioned.fill(child: bottomSheet), - ]); + return Stack( + children: [ + if (widget.child != null) widget.child!, + if (bottomSheet != null) Positioned.fill(child: bottomSheet), + ], + ); } double _extent = 0; diff --git a/lib/src/helpers/logs/widgets.dart b/lib/src/helpers/logs/widgets.dart index f6120d2..9a522fa 100644 --- a/lib/src/helpers/logs/widgets.dart +++ b/lib/src/helpers/logs/widgets.dart @@ -124,16 +124,18 @@ class LogEntryWidget extends StatelessWidget { final textStyle = TextStyle(color: color); final title = Text.rich( - TextSpan(children: [ - TextSpan( - text: formattedTimestamp, - style: context.textTheme.bodySmall!.copyWith( - color: color.withOpacity(0.6), - fontFeatures: [const FontFeature.tabularFigures()], + TextSpan( + children: [ + TextSpan( + text: formattedTimestamp, + style: context.textTheme.bodySmall!.copyWith( + color: color.withOpacity(0.6), + fontFeatures: [const FontFeature.tabularFigures()], + ), ), - ), - TextSpan(text: ' ${log.message}'), - ]), + TextSpan(text: ' ${log.message}'), + ], + ), style: textStyle, ); @@ -226,24 +228,29 @@ class LogEntryWidget extends StatelessWidget { if (object is DiagnosticsNode) return object.toStringDeep(); try { + // ignore: avoid_dynamic_calls (object as dynamic).toJson(); // It supports `toJson()`. dynamic toEncodable(dynamic object) { try { + // ignore: avoid_dynamic_calls return object.toJson(); } catch (_) {} try { return '$object'; + // ignore: avoid_catches_without_on_clauses } catch (_) {} return describeIdentity(object); } return JsonEncoder.withIndent(' ', toEncodable).convert(object); + // ignore: avoid_catches_without_on_clauses } catch (_) {} try { return '$object'.trim(); + // ignore: avoid_catches_without_on_clauses } catch (_) {} return describeIdentity(object); } @@ -263,8 +270,10 @@ class LogEntryWidget extends StatelessWidget { } try { + // ignore: avoid_dynamic_calls (object as dynamic).toJson(); return true; + // ignore: avoid_catches_without_on_clauses } catch (_) {} return false; } @@ -273,7 +282,9 @@ class LogEntryWidget extends StatelessWidget { if (object is List || object is Map) return isJson(object); try { + // ignore: avoid_dynamic_calls return isJsonListOrMap((object as dynamic).toJson()); + // ignore: avoid_catches_without_on_clauses } catch (_) {} return false; } @@ -298,10 +309,13 @@ class LogEntryWidget extends StatelessWidget { } try { + // ignore: avoid_dynamic_calls return toJson((object as dynamic).toJson()); + // ignore: avoid_catches_without_on_clauses } catch (_) {} try { return '$object'; + // ignore: avoid_catches_without_on_clauses } catch (_) {} return describeIdentity(object); } @@ -449,12 +463,14 @@ class _ExpansionTileState extends State<_ExpansionTile> if (_isExpanded) { _animationController.forward(); } else { - unawaited(_animationController.reverse().then((value) { - if (!mounted) return; - setState(() { - // Rebuild without widget.children. - }); - })); + unawaited( + _animationController.reverse().then((value) { + if (!mounted) return; + setState(() { + // Rebuild without widget.children. + }); + }), + ); } PageStorage.maybeOf(context)?.writeState(context, _isExpanded); }); diff --git a/lib/src/helpers/media_override.dart b/lib/src/helpers/media_override.dart index d5596a7..744e924 100644 --- a/lib/src/helpers/media_override.dart +++ b/lib/src/helpers/media_override.dart @@ -57,11 +57,13 @@ class _MediaOverrideDebugHelperState extends State { builder: (context, currentState, _) => DebugHelper( title: const Text('Media Overrides'), contentPadding: EdgeInsets.zero, - child: Column(children: [ - _buildThemeModeOverride(currentState), - if (widget.supportedLocales != null) - _buildLocaleOverride(currentState), - ]), + child: Column( + children: [ + _buildThemeModeOverride(currentState), + if (widget.supportedLocales != null) + _buildLocaleOverride(currentState), + ], + ), ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index ae815f9..cc98adc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,4 +36,4 @@ dev_dependencies: git: url: https://github.com/JonasWanke/supernova.git path: supernova_flutter - ref: 281f167123facb724d112ffc84349cf39d8f691f + ref: b84d859caf3402b7b30099ac3f67c74fcc071cc6