Skip to content

Commit 01e7315

Browse files
committed
Updated example.
1 parent 43c3a2b commit 01e7315

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,14 @@ the mixin `TimeTracker`.
3636

3737

3838
```Dart
39-
import 'package:exception_templates/exception_templates.dart';
39+
mport 'package:exception_templates/exception_templates.dart';
4040
import 'package:time_tracker/time_tracker.dart';
4141
4242
/// Demonstrates how to use TimeTracker.
4343
class TennisMatch with TimeTracker {
4444
final List<String> players;
4545
46-
/// Note the use of the constructor `super.startNow()`.
47-
/// This creates an instance of TennisMatch with status: started
48-
/// and records the instantiation time as the first time point.
49-
TennisMatch(List<String> players) : players = List.of(players);
46+
TennisMatch(List<String> players) : players = List.unmodifiable(players);
5047
5148
/// Constructs an object from a json map.
5249
factory TennisMatch.fromJson(Map<String, Object?> json) {

test/src/tennis_match.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import 'package:time_tracker/time_tracker.dart';
55
class TennisMatch with TimeTracker {
66
final List<String> players;
77

8-
/// Note the use of the constructor `super.startNow()`.
9-
/// This creates an instance of TennisMatch with status: started
10-
/// and records the instantiation time as the first time point.
118
TennisMatch(List<String> players) : players = List.unmodifiable(players);
129

1310
/// Constructs an object from a json map.

test/time_tracker_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,10 @@ void main() {
339339
),
340340
),
341341
);
342-
343342
});
344343
test('failed init in state started', () {
345344
expect(
346-
() => matchFactory(status: started, timePoints: [0, 1000,]),
345+
() => matchFactory(status: started, timePoints: [0, 1000]),
347346
throwsA(
348347
isA<ErrorOf<TimeTracker>>().having(
349348
(e) => e.message,

0 commit comments

Comments
 (0)