Runtime display error with Dart v2
compiling and running the app under Dart2 gave me a red screen on the device with the message
type '_BroadcastStream
' is not a subtype of type 'Stream<List<Favorite>>'
It seems the error can be fixed by repacing line 7 in file lib/favorites_manager.dart
StreamController _favStreamController = new StreamController.broadcast();
with:
StreamController<List<Favorite>> _favStreamController = new StreamController<List<Favorite>>.broadcast();
(Dart2 is more rigid with type checking than Dart1)
there seem to be more
...VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
type '_BroadcastSubscription<CameraPosition>' is not a subtype of type 'StreamSubscription<Null>'
#0 _MyHomePageState._addFavorite (file:///Users/macsetup/Documents/myGIT/flutter_map_demo/lib/main.dart:92:5)
#1 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#2 _MyHomePageState._addFavorite (file:///Users/macsetup/Documents/myGIT/flutter_map_demo/lib/main.dart:78:22)
#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:503:14)
#4 _InkResponseState.build.