My project was working perfectly and Just today i have upgrade my Flutter then everything start going run.
At the bottom is the error they give me. Please help me.
file:///Users/macbook/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/animated_background-1.0.4/lib/image_helper.dart:17:30: Error: The argument type 'dynamic Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
newStream.removeListener(listener);
^
file:///Users/macbook/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/animated_background-1.0.4/lib/image_helper.dart:20:25: Error: The argument type 'dynamic Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
newStream.addListener(listener);
^
file:///Users/macbook/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/animated_background-1.0.4/lib/image_helper.dart:21:41: Error: The argument type 'dynamic Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/macbook/Documents/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
return () => newStream.removeListener(listener);
^
Compiler failed on /Users/macbook/AndroidStudioProjects/alimmentation/lib/main.dart
Finished with error: Gradle task assembleDebug failed with exit code 1
Run Code Online (Sandbox Code Playgroud)
小智 5
通过替换解决了类似的问题
/*...*/.addListener((ImageInfo image, bool synchronousCall) { /*...*/ });
Run Code Online (Sandbox Code Playgroud)
与
import 'package:flutter/painting.dart';
/*...*/.addListener(new ImageStreamListener((ImageInfo image, bool synchronousCall) { /*...*/ }) as ImageStreamListener);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1747 次 |
| 最近记录: |