question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Needs to be updated for Dart 2 Compatibility

See original GitHub issue

needs to be updated to dart 2 preview. https://groups.google.com/forum/#!topic/flutter-dev/H8dDhWg_c8I

Steps to Reproduce

Integrated https://github.com/evrone/flutter_audio with an app for a few months. Was working until recently. Now throws

2018-05-01 10:17:34.794099-0700 Runner[52813:1608248] flutter: type '(Map<String, dynamic>) => void' is not a subtype of type '(dynamic) => void'

Logs

Run your application with flutter run and attach all the log output. 2018-05-01 10:17:34.627949-0700 Runner[52813:1608279] flutter: Observatory listening on http://127.0.0.1:61887/ 2018-05-01 10:17:34.786834-0700 Runner[52813:1608248] flutter: ══║ EXCEPTION CAUGHT BY WIDGETS LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• 2018-05-01 10:17:34.793689-0700 Runner[52813:1608248] flutter: The following assertion was thrown attaching to the render tree: 2018-05-01 10:17:34.794099-0700 Runner[52813:1608248] flutter: type β€˜(Map<String, dynamic>) => void’ is not a subtype of type β€˜(dynamic) => void’ 2018-05-01 10:17:34.803361-0700 Runner[52813:1608248] flutter: 2018-05-01 10:17:34.803674-0700 Runner[52813:1608248] flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially 2018-05-01 10:17:34.804658-0700 Runner[52813:1608248] flutter: more information in this error message to help you determine and fix the underlying cause. 2018-05-01 10:17:34.804950-0700 Runner[52813:1608248] flutter: In either case, please report this assertion by filing a bug on GitHub: 2018-05-01 10:17:34.805849-0700 Runner[52813:1608248] flutter: https://github.com/flutter/flutter/issues/new 2018-05-01 10:17:34.806535-0700 Runner[52813:1608248] flutter: 2018-05-01 10:17:34.806868-0700 Runner[52813:1608248] flutter: When the exception was thrown, this was the stack: 2018-05-01 10:17:34.811722-0700 Runner[52813:1608248] flutter: #0 new MedcorderAudio (package:medcorder_audio/medcorder_audio.dart:16:50) 2018-05-01 10:17:34.812700-0700 Runner[52813:1608248] flutter: #1 new _MyAppState (file:///Users/jeanpaul/Dev/flutter_audio/example/lib/main.dart:17:36) 2018-05-01 10:17:34.813265-0700 Runner[52813:1608248] flutter: #2 MyApp.createState (file:///Users/jeanpaul/Dev/flutter_audio/example/lib/main.dart:12:36) 2018-05-01 10:17:34.813675-0700 Runner[52813:1608248] flutter: #3 new StatefulElement (package:flutter/src/widgets/framework.dart:3702:23) 2018-05-01 10:17:34.813951-0700 Runner[52813:1608248] flutter: #4 StatefulWidget.createElement (package:flutter/src/widgets/framework.dart:781:42) 2018-05-01 10:17:34.814354-0700 Runner[52813:1608248] flutter: #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2897:40) 2018-05-01 10:17:34.814503-0700 Runner[52813:1608248] flutter: #6 Element.updateChild (package:flutter/src/widgets/framework.dart:2702:12) 2018-05-01 10:17:34.815057-0700 Runner[52813:1608248] flutter: #7 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:857:16) 2018-05-01 10:17:34.815264-0700 Runner[52813:1608248] flutter: #8 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:828:5) 2018-05-01 10:17:34.815461-0700 Runner[52813:1608248] flutter: #9 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:774:17) 2018-05-01 10:17:34.815602-0700 Runner[52813:1608248] flutter: #10 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2214:19) 2018-05-01 10:17:34.815924-0700 Runner[52813:1608248] flutter: #11 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:773:13) 2018-05-01 10:17:34.816070-0700 Runner[52813:1608248] flutter: #12 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:662:7) 2018-05-01 10:17:34.816395-0700 Runner[52813:1608248] flutter: #13 runApp (package:flutter/src/widgets/binding.dart:704:7) 2018-05-01 10:17:34.816566-0700 Runner[52813:1608248] flutter: #14 main (file:///Users/jeanpaul/Dev/flutter_audio/example/lib/main.dart:7:3) 2018-05-01 10:17:34.817113-0700 Runner[52813:1608248] flutter: #15 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19) 2018-05-01 10:17:34.817693-0700 Runner[52813:1608248] flutter: #16 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12) 2018-05-01 10:17:34.818300-0700 Runner[52813:1608248] flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════ Run flutter analyze and attach any output of that command also.

Flutter Doctor

144:example jeanpaul$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [βœ“] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E199, locale en-US) [βœ“] Android toolchain - develop for Android devices (Android SDK 27.0.3) [βœ“] iOS toolchain - develop for iOS devices (Xcode 9.3) [βœ“] Android Studio (version 3.1) [βœ“] VS Code (version 1.22.2) [βœ“] Connected devices (3 available)

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeanpaulcozzatticommented, Jun 7, 2018

i forked, and have it working for dart2: https://github.com/jeanpaulcozzatti/flutter_audio

1reaction
jeanpaulcozzatticommented, Jun 5, 2018

I’m still using -no-preview-dart-2.

I just wrote my first plugin, so let me see if I can write a patch for this.

Sent from Astro https://www.helloastro.com for Mac

On Jun 5, 2018 at 2:23 PM, Andrew Takao notifications@github.com wrote:

I’m also having this issue, and when I do flutter run -no-preview-dart-2 I run into other issues

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evrone/flutter_audio/issues/6#issuecomment-394865039, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ5eq57nNWf0UBbVa5rVAI2WXu38vbsks5t5vbRgaJpZM4TuO0a .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dart 2 migration guide
Dart 2 has a few key differences from earlier versions of Dart. This page briefly covers those differences and gives general advice on...
Read more >
Updating your pub package to Dart 2 | by Filip Hracek - Medium
Updating your pub package to Dart 2 Β· Take inventory Β· Decide which ones are worth updating Β· Install Dart 2 (and 1)...
Read more >
How to enable Null-Safety in Flutter? - dart - Stack Overflow
Run the below command to know what are libs in your project needs to be upgraded to the latest null safety. dart pub...
Read more >
[dart-announce] Migrating your packages to Dart 2
We expect the Dart 2 release to graduate to stable in the immediate future. Thus, it's critical that you migrate your code β€”...
Read more >
Updating the package to be null-safety compatible, so far 1.12 ...
pub-cache/hosted/pub.dartlang.org/build_runner-1.12.2/bin/build_runner.dart:91:49: Warning: Operand of null-aware operation '??' has type 'bool'Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found