Skip to content

Instantly share code, notes, and snippets.

@uc-apa
uc-apa / Main.dart
Last active March 23, 2021 02:48
DartJson Class Implementation to encode and decode/parse complex nested json objects directly in flutter/dart. Direct object manipulation.
import 'dart:convert';
/* To handle(read/write) complex json in dart */
/* Reference https://dev.to/onmyway133/how-to-resolve-deep-json-object-in-dart-5c5l */
/* Usage:-
var myjson = '''your strigified json''';
var jsonObject = DartJson(myjson);
var jsonObject = DartJson(myjson, customSeperator: '/');
var newObj = jsonObject.read('Employee.Entitlements.GP.Balance');
newObj.read('xyz.abc').raw();