Skip to content
Back

There is an issue with Appwrite SDK in flutter in realtime

  • 0
  • Flutter
  • Realtime
  • Cloud
Abid G
12 Jan, 2025, 14:29

I'm getting this error [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<dynamic, dynamic>'

I'm assuming the issue is with the above line in realtime_mixin. When the response is "{"type": "pong"} its not able to decode it...

factory RealtimeResponse.fromJson(String source) => RealtimeResponse.fromMap(json.decode(source));

in realtime_response.dart

It runs "{"type": "pong"} every few seconds...

TL;DR
Issue: Appwrite SDK in Flutter is encountering an error related to decoding JSON response in `realtime_mixin`. Solution: Update the `fromJson` method in `realtime_response.dart` to handle when the response is `{"type": "pong"}` by ensuring it is a valid `Map<dynamic, dynamic>`.
Abid G
12 Jan, 2025, 14:30
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more