Skip to content

Commit e808779

Browse files
committed
+chore: Update dependencies
1 parent 21ec1f1 commit e808779

10 files changed

Lines changed: 84 additions & 87 deletions

File tree

.github/scripts/update_changelog.dart

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ Set<_VersionSection> extractSections(String contents) {
7171
.where((e) => e.isNotEmpty);
7272
for (var line in old) {
7373
if (line.contains('Released @')) {
74-
final temp = line.split('Released @').last.trim();
75-
releasedAt = DateTime.tryParse(temp) ?? releasedAt;
74+
releasedAt = parseReleaseDate(line);
7675
} else {
7776
updates.add(line);
7877
}
@@ -155,3 +154,19 @@ int compareVersions(String version1, String version2) {
155154
}
156155
return 0;
157156
}
157+
158+
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
159+
160+
DateTime parseReleaseDate(String line) {
161+
if (line.contains('Released @')) {
162+
final temp = line.split('Released @').last.trim().replaceAll(' (UTC)', '');
163+
final parts = temp.split('/');
164+
if (parts.length == 2) {
165+
final month = int.tryParse(parts[0]) ?? 1;
166+
final year = int.tryParse(parts[1]) ?? DateTime.now().year;
167+
return DateTime.utc(year, month);
168+
}
169+
}
170+
171+
return DateTime.now().toUtc();
172+
}

lib/src/list_mixins/cancel_list_mixin.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
15+
import 'package:df_type/df_type.dart' show SequentialController;
1616
import 'package:flutter/foundation.dart' show protected;
1717

1818
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -28,14 +28,14 @@ mixin CancelListsMixin {
2828

2929
@protected
3030
FutureOr<void> cancelAll() {
31-
final foc = FutureOrController<void>();
31+
final sc = SequentialController<void>();
3232
for (final resource in _cancelList) {
3333
try {
34-
foc.add((_) => resource.cancel());
34+
sc.add((_) => resource.cancel());
3535
} on NoSuchMethodError catch (e) {
36-
foc.addException(e);
36+
sc.addException(e);
3737
}
3838
}
39-
return foc.complete();
39+
return sc.complete();
4040
}
4141
}

lib/src/list_mixins/close_list_mixin.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
15+
import 'package:df_type/df_type.dart' show SequentialController;
1616
import 'package:flutter/foundation.dart' show protected;
1717

1818
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -28,14 +28,14 @@ mixin CloseListsMixin {
2828

2929
@protected
3030
FutureOr<void> closeAll() {
31-
final foc = FutureOrController<void>();
31+
final sc = SequentialController<void>();
3232
for (final resource in _closeList) {
3333
try {
34-
foc.add((_) => resource.close());
34+
sc.add((_) => resource.close());
3535
} on NoSuchMethodError catch (e) {
36-
foc.addException(e);
36+
sc.addException(e);
3737
}
3838
}
39-
return foc.complete();
39+
return sc.complete();
4040
}
4141
}

lib/src/list_mixins/dispose_list_mixin.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
15+
import 'package:df_type/df_type.dart' show SequentialController;
1616
import 'package:flutter/foundation.dart' show protected;
1717

1818
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -28,14 +28,14 @@ mixin DisposeListsMixin {
2828

2929
@protected
3030
FutureOr<void> disposeAll() {
31-
final foc = FutureOrController<void>();
31+
final sc = SequentialController<void>();
3232
for (final resource in _disposeList) {
3333
try {
34-
foc.add((_) => resource.dispose());
34+
sc.add((_) => resource.dispose());
3535
} on NoSuchMethodError catch (e) {
36-
foc.addException(e);
36+
sc.addException(e);
3737
}
3838
}
39-
return foc.complete();
39+
return sc.complete();
4040
}
4141
}

lib/src/list_mixins/stop_list_mixin.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
15+
import 'package:df_type/df_type.dart' show SequentialController;
1616
import 'package:flutter/foundation.dart' show protected;
1717

1818
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -28,14 +28,14 @@ mixin StopListsMixin {
2828

2929
@protected
3030
FutureOr<void> stopAll() {
31-
final foc = FutureOrController<void>();
31+
final sc = SequentialController<void>();
3232
for (final resource in _stopList) {
3333
try {
34-
foc.add((_) => resource.stop());
34+
sc.add((_) => resource.stop());
3535
} on NoSuchMethodError catch (e) {
36-
foc.addException(e);
36+
sc.addException(e);
3737
}
3838
}
39-
return foc.complete();
39+
return sc.complete();
4040
}
4141
}

lib/src/will_mixins/will_cancel/will_cancel_mixin.dart

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
16-
import 'package:flutter/foundation.dart'
17-
show kDebugMode, mustCallSuper, nonVirtual;
15+
import 'package:df_type/df_type.dart' show SequentialController;
16+
import 'package:flutter/foundation.dart' show kDebugMode, mustCallSuper, nonVirtual;
1817

1918
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2019

@@ -27,8 +26,7 @@ import 'package:flutter/foundation.dart'
2726
/// invoked on each resource wrapped with [willCancel].
2827
mixin WillCancelMixin on CancelMixin {
2928
/// The list of resources marked for cancel via [willCancel].
30-
Set<_ToCancelResource<dynamic>> get toCancelResources =>
31-
Set.unmodifiable(_toCancelResources);
29+
Set<_ToCancelResource<dynamic>> get toCancelResources => Set.unmodifiable(_toCancelResources);
3230

3331
final Set<_ToCancelResource<dynamic>> _toCancelResources = {};
3432

@@ -50,13 +48,11 @@ mixin WillCancelMixin on CancelMixin {
5048
_verifyCancelMethod(resource);
5149
final disposable = (
5250
resource: resource as dynamic,
53-
onBeforeCancel:
54-
onBeforeCancel != null ? (dynamic e) => onBeforeCancel(e as T) : null,
51+
onBeforeCancel: onBeforeCancel != null ? (dynamic e) => onBeforeCancel(e as T) : null,
5552
);
5653

5754
// Check for any duplicate resource.
58-
final duplicate =
59-
_toCancelResources.where((e) => e.resource == resource).firstOrNull;
55+
final duplicate = _toCancelResources.where((e) => e.resource == resource).firstOrNull;
6056

6157
if (duplicate != null) {
6258
if (kDebugMode) {
@@ -78,11 +74,11 @@ mixin WillCancelMixin on CancelMixin {
7874
@mustCallSuper
7975
@override
8076
FutureOr<void> cancel() {
81-
final foc = FutureOrController<void>();
77+
final sc = SequentialController<void>();
8278

8379
try {
8480
// Call the parent's cancel method.
85-
foc.add((_) => super.cancel());
81+
sc.add((_) => super.cancel());
8682

8783
for (final disposable in _toCancelResources) {
8884
final resource = disposable.resource;
@@ -92,13 +88,13 @@ mixin WillCancelMixin on CancelMixin {
9288
// Attempt to call onBeforeCancel, catching and copying any exceptions.
9389
Object? onBeforeCancelError;
9490
try {
95-
foc.add((_) => disposable.onBeforeCancel?.call(resource));
91+
sc.add((_) => disposable.onBeforeCancel?.call(resource));
9692
} catch (e) {
9793
onBeforeCancelError = e;
9894
}
9995

10096
// Attempt to call cancel on the resource.
101-
foc.add((_) => resource.cancel());
97+
sc.add((_) => resource.cancel());
10298

10399
// If successful, rethrow any exception from onBeforeCancel.
104100
if (onBeforeCancelError != null) {
@@ -108,11 +104,11 @@ mixin WillCancelMixin on CancelMixin {
108104
} catch (e) {
109105
// Collect exceptions to throw them all at the end, ensuring cancel gets
110106
// called on all resources.
111-
foc.addException(e);
107+
sc.addException(e);
112108
}
113109

114110
// Return a Future or complete synchronously.
115-
return foc.complete();
111+
return sc.complete();
116112
}
117113

118114
/// Throws [NoCancelMethodDebugError] if [resource] does not have a `cancel`

lib/src/will_mixins/will_close/will_close_mixin.dart

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
16-
import 'package:flutter/foundation.dart'
17-
show kDebugMode, mustCallSuper, nonVirtual;
15+
import 'package:df_type/df_type.dart' show SequentialController;
16+
import 'package:flutter/foundation.dart' show kDebugMode, mustCallSuper, nonVirtual;
1817

1918
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2019

@@ -27,8 +26,7 @@ import 'package:flutter/foundation.dart'
2726
/// invoked on each resource wrapped with [willClose].
2827
mixin WillCloseMixin on CloseMixin {
2928
/// The list of resources marked for close via [willClose].
30-
Set<_ToCloseResource<dynamic>> get toCloseResources =>
31-
Set.unmodifiable(_toCloseResources);
29+
Set<_ToCloseResource<dynamic>> get toCloseResources => Set.unmodifiable(_toCloseResources);
3230

3331
final Set<_ToCloseResource<dynamic>> _toCloseResources = {};
3432

@@ -50,13 +48,11 @@ mixin WillCloseMixin on CloseMixin {
5048
_verifyCloseMethod(resource);
5149
final disposable = (
5250
resource: resource as dynamic,
53-
onBeforeClose:
54-
onBeforeClose != null ? (dynamic e) => onBeforeClose(e as T) : null,
51+
onBeforeClose: onBeforeClose != null ? (dynamic e) => onBeforeClose(e as T) : null,
5552
);
5653

5754
// Check for any duplicate resource.
58-
final duplicate =
59-
_toCloseResources.where((e) => e.resource == resource).firstOrNull;
55+
final duplicate = _toCloseResources.where((e) => e.resource == resource).firstOrNull;
6056

6157
if (duplicate != null) {
6258
if (kDebugMode) {
@@ -78,11 +74,11 @@ mixin WillCloseMixin on CloseMixin {
7874
@mustCallSuper
7975
@override
8076
FutureOr<void> close() {
81-
final foc = FutureOrController<void>();
77+
final sc = SequentialController<void>();
8278

8379
try {
8480
// Call the parent's close method.
85-
foc.add((_) => super.close());
81+
sc.add((_) => super.close());
8682

8783
for (final disposable in _toCloseResources) {
8884
final resource = disposable.resource;
@@ -92,13 +88,13 @@ mixin WillCloseMixin on CloseMixin {
9288
// Attempt to call onBeforeClose, catching and copying any exceptions.
9389
Object? onBeforeCloseError;
9490
try {
95-
foc.add((_) => disposable.onBeforeClose?.call(resource));
91+
sc.add((_) => disposable.onBeforeClose?.call(resource));
9692
} catch (e) {
9793
onBeforeCloseError = e;
9894
}
9995

10096
// Attempt to call close on the resource.
101-
foc.add((_) => resource.close());
97+
sc.add((_) => resource.close());
10298

10399
// If successful, rethrow any exception from onBeforeClose.
104100
if (onBeforeCloseError != null) {
@@ -108,11 +104,11 @@ mixin WillCloseMixin on CloseMixin {
108104
} catch (e) {
109105
// Collect exceptions to throw them all at the end, ensuring close gets
110106
// called on all resources.
111-
foc.addException(e);
107+
sc.addException(e);
112108
}
113109

114110
// Return a Future or complete synchronously.
115-
return foc.complete();
111+
return sc.complete();
116112
}
117113

118114
/// Throws [NoCloseMethodDebugError] if [resource] does not have a `close`

lib/src/will_mixins/will_dispose/will_dispose_mixin.dart

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
import 'dart:async' show FutureOr;
1414

15-
import 'package:df_type/df_type.dart' show FutureOrController;
16-
import 'package:flutter/foundation.dart'
17-
show kDebugMode, mustCallSuper, nonVirtual;
15+
import 'package:df_type/df_type.dart' show SequentialController;
16+
import 'package:flutter/foundation.dart' show kDebugMode, mustCallSuper, nonVirtual;
1817

1918
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2019

@@ -27,8 +26,7 @@ import 'package:flutter/foundation.dart'
2726
/// invoked on each resource wrapped with [willDispose].
2827
mixin WillDisposeMixin on DisposeMixin {
2928
/// The list of resources marked for dispose via [willDispose].
30-
Set<_ToDisposeResource<dynamic>> get toDisposeResources =>
31-
Set.unmodifiable(_toDisposeResources);
29+
Set<_ToDisposeResource<dynamic>> get toDisposeResources => Set.unmodifiable(_toDisposeResources);
3230

3331
final Set<_ToDisposeResource<dynamic>> _toDisposeResources = {};
3432

@@ -50,14 +48,11 @@ mixin WillDisposeMixin on DisposeMixin {
5048
_verifyDisposeMethod(resource);
5149
final disposable = (
5250
resource: resource as dynamic,
53-
onBeforeDispose: onBeforeDispose != null
54-
? (dynamic e) => onBeforeDispose(e as T)
55-
: null,
51+
onBeforeDispose: onBeforeDispose != null ? (dynamic e) => onBeforeDispose(e as T) : null,
5652
);
5753

5854
// Check for any duplicate resource.
59-
final duplicate =
60-
_toDisposeResources.where((e) => e.resource == resource).firstOrNull;
55+
final duplicate = _toDisposeResources.where((e) => e.resource == resource).firstOrNull;
6156

6257
if (duplicate != null) {
6358
if (kDebugMode) {
@@ -79,11 +74,11 @@ mixin WillDisposeMixin on DisposeMixin {
7974
@mustCallSuper
8075
@override
8176
FutureOr<void> dispose() {
82-
final foc = FutureOrController<void>();
77+
final sc = SequentialController<void>();
8378

8479
try {
8580
// Call the parent's dispose method.
86-
foc.add((_) => super.dispose());
81+
sc.add((_) => super.dispose());
8782

8883
for (final disposable in _toDisposeResources) {
8984
final resource = disposable.resource;
@@ -93,13 +88,13 @@ mixin WillDisposeMixin on DisposeMixin {
9388
// Attempt to call onBeforeDispose, catching and copying any exceptions.
9489
Object? onBeforeDisposeError;
9590
try {
96-
foc.add((_) => disposable.onBeforeDispose?.call(resource));
91+
sc.add((_) => disposable.onBeforeDispose?.call(resource));
9792
} catch (e) {
9893
onBeforeDisposeError = e;
9994
}
10095

10196
// Attempt to call dispose on the resource.
102-
foc.add((_) => resource.dispose());
97+
sc.add((_) => resource.dispose());
10398

10499
// If successful, rethrow any exception from onBeforeDispose.
105100
if (onBeforeDisposeError != null) {
@@ -109,11 +104,11 @@ mixin WillDisposeMixin on DisposeMixin {
109104
} catch (e) {
110105
// Collect exceptions to throw them all at the end, ensuring dispose gets
111106
// called on all resources.
112-
foc.addException(e);
107+
sc.addException(e);
113108
}
114109

115110
// Return a Future or complete synchronously.
116-
return foc.complete();
111+
return sc.complete();
117112
}
118113

119114
/// Throws [NoDisposeMethodDebugError] if [resource] does not have a `dispose`
@@ -168,8 +163,7 @@ final class WillAlreadyDisposeDebugError<T> extends Error {
168163
WillAlreadyDisposeDebugError(this.resource);
169164

170165
@override
171-
String toString() =>
172-
'[$WillAlreadyDisposeDebugError] willDispose has already '
166+
String toString() => '[$WillAlreadyDisposeDebugError] willDispose has already '
173167
'been called on the resource ${resource.hashCode} and of type $T.';
174168
}
175169

0 commit comments

Comments
 (0)