Skip to content

Commit 705eea7

Browse files
author
Volodymyr Oliinyk
committed
bump dart version
1 parent 4a951ff commit 705eea7

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"android":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sensors","dependencies":[]}],"date_created":"2022-11-28 16:55:16.527262","version":"3.3.9"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"android":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sensors","dependencies":[]}],"date_created":"2022-11-28 17:02:23.593622","version":"3.3.9"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"android":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sensors","dependencies":[]}],"date_created":"2022-11-28 16:55:17.768815","version":"3.3.9"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"android":[{"name":"sensors","path":"/Users/volodymyroliinyk/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.2+6/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sensors","dependencies":[]}],"date_created":"2022-11-28 17:02:24.205567","version":"3.3.9"}

lib/src/ansi_parser.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ class AnsiParser {
77

88
AnsiParser(this.dark);
99

10-
Color foreground;
11-
Color background;
12-
List<TextSpan> spans;
10+
Color? foreground;
11+
Color? background;
12+
List<TextSpan> spans = [];
1313

1414
void parse(String s) {
1515
spans = [];
1616
var state = TEXT;
17-
StringBuffer buffer;
17+
StringBuffer buffer = StringBuffer();
1818
var text = StringBuffer();
1919
var code = 0;
20-
List<int> codes;
20+
List<int> codes = [];
2121

2222
for (var i = 0, n = s.length; i < n; i++) {
2323
var c = s[i];
@@ -99,7 +99,7 @@ class AnsiParser {
9999
}
100100
}
101101

102-
Color getColor(int colorCode, bool foreground) {
102+
Color? getColor(int colorCode, bool foreground) {
103103
switch (colorCode) {
104104
case 0:
105105
return foreground ? Colors.black : Colors.transparent;

lib/src/log_console.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RenderedEvent {
3838
}
3939

4040
class _LogConsoleState extends State<LogConsole> {
41-
OutputCallback _callback;
41+
OutputCallback? _callback;
4242

4343
ListQueue<RenderedEvent> _renderedBuffer = ListQueue();
4444
List<RenderedEvent> _filteredBuffer = [];
@@ -70,8 +70,7 @@ class _LogConsoleState extends State<LogConsole> {
7070

7171
_scrollController.addListener(() {
7272
if (!_scrollListenerEnabled) return;
73-
var scrolledToBottom = _scrollController.offset >=
74-
_scrollController.position.maxScrollExtent;
73+
var scrolledToBottom = _scrollController.offset >= _scrollController.position.maxScrollExtent;
7574
setState(() {
7675
_followBottom = scrolledToBottom;
7776
});
@@ -270,7 +269,7 @@ class _LogConsoleState extends State<LogConsole> {
270269
)
271270
],
272271
onChanged: (value) {
273-
_filterLevel = value;
272+
if (value != null) _filterLevel = value;
274273
_refreshFilter();
275274
},
276275
)
@@ -319,7 +318,10 @@ class LogBar extends StatelessWidget {
319318
final bool dark;
320319
final Widget child;
321320

322-
LogBar({this.dark, this.child});
321+
LogBar({
322+
required this.dark,
323+
required this.child,
324+
});
323325

324326
@override
325327
Widget build(BuildContext context) {
@@ -330,7 +332,7 @@ class LogBar extends StatelessWidget {
330332
boxShadow: [
331333
if (!dark)
332334
BoxShadow(
333-
color: Colors.grey[400],
335+
color: Colors.grey.shade400,
334336
blurRadius: 3,
335337
),
336338
],

lib/src/log_console_on_shake.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class LogConsoleOnShake extends StatefulWidget {
66
final bool debugOnly;
77

88
LogConsoleOnShake({
9-
@required this.child,
10-
this.dark,
9+
required this.child,
10+
required this.dark,
1111
this.debugOnly = true,
1212
});
1313

@@ -16,7 +16,7 @@ class LogConsoleOnShake extends StatefulWidget {
1616
}
1717

1818
class _LogConsoleOnShakeState extends State<LogConsoleOnShake> {
19-
ShakeDetector _detector;
19+
late ShakeDetector _detector;
2020
bool _open = false;
2121

2222
@override

lib/src/shake_detector.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
55
import 'package:sensors/sensors.dart';
66

77
class ShakeDetector {
8-
final VoidCallback onPhoneShake;
8+
final VoidCallback? onPhoneShake;
99

1010
final double shakeThresholdGravity;
1111

@@ -19,7 +19,7 @@ class ShakeDetector {
1919

2020
int lastShakeTimestamp = DateTime.now().millisecondsSinceEpoch;
2121

22-
StreamSubscription streamSubscription;
22+
StreamSubscription? streamSubscription;
2323

2424
ShakeDetector({
2525
this.onPhoneShake,
@@ -53,7 +53,7 @@ class ShakeDetector {
5353
lastShakeTimestamp = now;
5454
if (++shakeCount >= minShakeCount) {
5555
shakeCount = 0;
56-
onPhoneShake();
56+
onPhoneShake?.call();
5757
}
5858
}
5959
});
@@ -62,7 +62,7 @@ class ShakeDetector {
6262
/// Stops listening to accelerometer events
6363
void stopListening() {
6464
if (streamSubscription != null) {
65-
streamSubscription.cancel();
65+
streamSubscription?.cancel();
6666
}
6767
}
6868
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ author: Simon Leier <[email protected]>
55
homepage: https://github.com/leisim/logger_flutter
66

77
environment:
8-
sdk: ">=2.2.2 <3.0.0"
8+
sdk: ">=2.18.5 <3.0.0"
99

1010
dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
logger: ">=0.7.0"
14+
logger: "0.7.0"
1515
sensors: ^0.4.0+1

0 commit comments

Comments
 (0)