$ flutter test
00:01 +0: loading /home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart test/os_logo_test.mocks.dart:56:23: Error: The return type of the method 'MockAssetBundle.loadBuffer' is 'Future<dynamic>', which does not match the return type, 'Future<ImmutableBuffer>',
of the overridden method, 'AssetBundle.loadBuffer'.
- 'Future' is from 'dart:async'.
- 'ImmutableBuffer' is from 'dart:ui'.
Change to a subtype of 'Future<ImmutableBuffer>'.
_i4.Future<dynamic> loadBuffer(String? key) => (super.noSuchMethod(
^
../../../../../.fvm/versions/stable/packages/flutter/lib/src/services/asset_bundle.dart:64:30: Context: This is the overridden method ('loadBuffer').
Future<ui.ImmutableBuffer> loadBuffer(String key) async {
^
00:04 +0 -1: loading /home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart [E]
Failed to load "/home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart": Compilation failed for testPath=/home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart
To run this test again: /home/jpnurmi/.fvm/versions/stable/bin/cache/dart-sdk/bin/dart test /home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart -p vm --plain-name 'loading /home/jpnurmi/Projects/canonical/workshops/packages/os_logo/test/os_logo_test.dart'
00:04 +0 -1: Some tests failed.
diff --git a/packages/os_logo/test/os_logo_test.mocks.dart b/packages/os_logo/test/os_logo_test.mocks.dart
index 39f201f..50ed777 100644
--- a/packages/os_logo/test/os_logo_test.mocks.dart
+++ b/packages/os_logo/test/os_logo_test.mocks.dart
@@ -3,11 +3,10 @@
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
-import 'dart:async' as _i5;
+import 'dart:async' as _i4;
import 'dart:typed_data' as _i2;
-import 'dart:ui' as _i3;
-import 'package:flutter/src/services/asset_bundle.dart' as _i4;
+import 'package:flutter/src/services/asset_bundle.dart' as _i3;
import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: type=lint
@@ -31,57 +30,38 @@ class _FakeByteData_0 extends _i1.SmartFake implements _i2.ByteData {
);
}
-class _FakeImmutableBuffer_1 extends _i1.SmartFake
- implements _i3.ImmutableBuffer {
- _FakeImmutableBuffer_1(
- Object parent,
- Invocation parentInvocation,
- ) : super(
- parent,
- parentInvocation,
- );
-}
-
/// A class which mocks [AssetBundle].
///
/// See the documentation for Mockito's code generation for more information.
-class MockAssetBundle extends _i1.Mock implements _i4.AssetBundle {
+class MockAssetBundle extends _i1.Mock implements _i3.AssetBundle {
MockAssetBundle() {
_i1.throwOnMissingStub(this);
}
@override
- _i5.Future<_i2.ByteData> load(String? key) => (super.noSuchMethod(
+ _i4.Future<_i2.ByteData> load(String? key) => (super.noSuchMethod(
Invocation.method(
#load,
[key],
),
- returnValue: _i5.Future<_i2.ByteData>.value(_FakeByteData_0(
+ returnValue: _i4.Future<_i2.ByteData>.value(_FakeByteData_0(
this,
Invocation.method(
#load,
[key],
),
)),
- ) as _i5.Future<_i2.ByteData>);
+ ) as _i4.Future<_i2.ByteData>);
@override
- _i5.Future<_i3.ImmutableBuffer> loadBuffer(String? key) =>
- (super.noSuchMethod(
+ _i4.Future<dynamic> loadBuffer(String? key) => (super.noSuchMethod(
Invocation.method(
#loadBuffer,
[key],
),
- returnValue:
- _i5.Future<_i3.ImmutableBuffer>.value(_FakeImmutableBuffer_1(
- this,
- Invocation.method(
- #loadBuffer,
- [key],
- ),
- )),
- ) as _i5.Future<_i3.ImmutableBuffer>);
+ returnValue: _i4.Future<dynamic>.value(),
+ ) as _i4.Future<dynamic>);
@override
- _i5.Future<String> loadString(
+ _i4.Future<String> loadString(
String? key, {
bool? cache = true,
}) =>
@@ -91,12 +71,12 @@ class MockAssetBundle extends _i1.Mock implements _i4.AssetBundle {
[key],
{#cache: cache},
),
- returnValue: _i5.Future<String>.value(''),
- ) as _i5.Future<String>);
+ returnValue: _i4.Future<String>.value(''),
+ ) as _i4.Future<String>);
@override
- _i5.Future<T> loadStructuredData<T>(
+ _i4.Future<T> loadStructuredData<T>(
String? key,
- _i5.Future<T> Function(String)? parser,
+ _i4.Future<T> Function(String)? parser,
) =>
(super.noSuchMethod(
Invocation.method(
@@ -106,8 +86,8 @@ class MockAssetBundle extends _i1.Mock implements _i4.AssetBundle {
parser,
],
),
- returnValue: _i5.Future<T>.value(null),
- ) as _i5.Future<T>);
+ returnValue: _i4.Future<T>.value(null),
+ ) as _i4.Future<T>);
@override
void evict(String? key) => super.noSuchMethod(
Invocation.method(