Skip to content

Commit

Permalink
feat: require analyzer: '>=4.4.0 <6.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
amondnet committed Sep 15, 2023
1 parent 938c62c commit b7225fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mobx_codegen/lib/src/template/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class AsyncMethodChecker {
method.returnType.isDartAsyncFuture ||
(method.isAsynchronous &&
!method.isGenerator &&
// ignore: deprecated_member_use
method.returnType.isDynamic);

bool returnsStream(MethodElement method) =>
_checkStream.isAssignableFromType(method.returnType) ||
(method.isAsynchronous &&
method.isGenerator &&
// ignore: deprecated_member_use
method.returnType.isDynamic);
}

Expand Down
2 changes: 2 additions & 0 deletions mobx_codegen/test/util_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ MockMethod mockFutureMethod({
bool isGenerator = false,
}) {
final returnType = MockType();
// ignore: deprecated_member_use
when(() => returnType.isDynamic).thenReturn(returnsDynamic);
when(() => returnType.isDartAsyncFuture).thenReturn(returnsFuture);
when(() => returnType.isDartAsyncFutureOr).thenReturn(returnsFutureOr);
Expand All @@ -37,6 +38,7 @@ MockMethod mockStreamMethod({
bool returnsDynamic = false,
}) {
final returnType = MockType();
// ignore: deprecated_member_use
when(() => returnType.isDynamic).thenReturn(returnsDynamic);

final method = MockMethod();
Expand Down

0 comments on commit b7225fe

Please sign in to comment.