From c15e8cb712006e70a96c2c3aef7ae16c5c0baa45 Mon Sep 17 00:00:00 2001 From: Volodymyr Oliinyk Date: Fri, 6 Jan 2023 17:57:56 +0200 Subject: [PATCH] formated --- lib/src/shake/default_shake_detector.dart | 4 +++- lib/src/theme/log_console_theme.dart | 3 ++- lib/src/utils/log_console_manager.dart | 7 +++++-- lib/src/widgets/log_console_content.dart | 5 ++--- lib/src/widgets/log_console_widget.dart | 6 ++++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/src/shake/default_shake_detector.dart b/lib/src/shake/default_shake_detector.dart index a1478ba..aa737f2 100644 --- a/lib/src/shake/default_shake_detector.dart +++ b/lib/src/shake/default_shake_detector.dart @@ -54,7 +54,9 @@ class DefaultShakeDetector implements ShakeDetector { .map((lastShakeTimestamp) { var now = DateTime.now().millisecondsSinceEpoch; - _shakeCount = lastShakeTimestamp + shakeCountResetTime < now ? 0 : _shakeCount + 1; + _shakeCount = lastShakeTimestamp + shakeCountResetTime < now + ? 0 + : _shakeCount + 1; _lastShakeTimestamp = now; return _shakeCount; diff --git a/lib/src/theme/log_console_theme.dart b/lib/src/theme/log_console_theme.dart index ee7273a..2518e52 100644 --- a/lib/src/theme/log_console_theme.dart +++ b/lib/src/theme/log_console_theme.dart @@ -12,7 +12,8 @@ class LogConsoleTheme { ThemeData theme, ) => LogConsoleTheme._( - bottomAppBarColor: theme.bottomAppBarTheme.color ?? theme.bottomAppBarColor, + bottomAppBarColor: + theme.bottomAppBarTheme.color ?? theme.bottomAppBarColor, scaffoldBackgroundColor: theme.scaffoldBackgroundColor, bodyLarge: theme.textTheme.bodyLarge, ); diff --git a/lib/src/utils/log_console_manager.dart b/lib/src/utils/log_console_manager.dart index 123243f..aa3803a 100644 --- a/lib/src/utils/log_console_manager.dart +++ b/lib/src/utils/log_console_manager.dart @@ -18,8 +18,11 @@ class LogConsoleManager extends ChangeNotifier { String _filterText = ''; List get logs => _buffer - .where((element) => _filterLevel == null ? true : element.level == _filterLevel) - .where((element) => _filterText.isEmpty ? true : element.lowerCaseText.contains(_filterText)) + .where((element) => + _filterLevel == null ? true : element.level == _filterLevel) + .where((element) => _filterText.isEmpty + ? true + : element.lowerCaseText.contains(_filterText)) .toList(); void setFilterLevel(Level? level) { diff --git a/lib/src/widgets/log_console_content.dart b/lib/src/widgets/log_console_content.dart index c74c62b..62bfc46 100644 --- a/lib/src/widgets/log_console_content.dart +++ b/lib/src/widgets/log_console_content.dart @@ -45,8 +45,6 @@ class _LogConsoleContentState extends State { @override Widget build(BuildContext context) { - final theme = Theme.of(context); - return SingleChildScrollView( scrollDirection: Axis.horizontal, child: SizedBox( @@ -57,7 +55,8 @@ class _LogConsoleContentState extends State { itemBuilder: (context, index) => Text.rich( widget.logConsoleManager.logs[index].span, key: ValueKey(widget.logConsoleManager.logs[index].id), - style: widget.theme.bodyLarge?.copyWith(fontSize: widget.logFontSize), + style: + widget.theme.bodyLarge?.copyWith(fontSize: widget.logFontSize), ), itemCount: widget.logConsoleManager.logs.length, ), diff --git a/lib/src/widgets/log_console_widget.dart b/lib/src/widgets/log_console_widget.dart index 83cee53..4d23598 100644 --- a/lib/src/widgets/log_console_widget.dart +++ b/lib/src/widgets/log_console_widget.dart @@ -43,7 +43,8 @@ class _LogConsoleWidgetState extends State { Future _checkScrollPosition({Duration delay = Duration.zero}) async { await Future.delayed(delay); - final scrolledToBottom = _scrollController.offset >= _scrollController.position.maxScrollExtent; + final scrolledToBottom = + _scrollController.offset >= _scrollController.position.maxScrollExtent; if (_followBottom != scrolledToBottom) { setState(() { @@ -52,7 +53,8 @@ class _LogConsoleWidgetState extends State { } } - void _updateLogManagerCallback() => _checkScrollPosition(delay: const Duration(milliseconds: 400)); + void _updateLogManagerCallback() => + _checkScrollPosition(delay: const Duration(milliseconds: 400)); @override void dispose() {