weblnDecode function

Map weblnDecode(
  1. dynamic obj
)

weblnDecode helps us to deseralize "object Object" result to jsonMap.

weblnDecode(FlutterWebln.webln);

Result: => {} // if webln provider is not installed => {enabled: false, isEnabled: false, executing: false}

Implementation

Map weblnDecode(obj) {
  String rawString = stringify(obj) ?? '{}';
  final jsonMap = jsonDecode(rawString);
  return jsonMap;
}