opendyn_dart 0.1.0 copy "opendyn_dart: ^0.1.0" to clipboard
opendyn_dart: ^0.1.0 copied to clipboard

An OpenDyn JSON Spec Parser, fromJson and toJson

example/opendyn_dart_example.dart

import 'dart:convert';

import 'package:opendyn_dart/opendyn_dart.dart';

import 'dart:io';

void main() async {
  String folder = "${Directory.current.path}${Platform.pathSeparator}example${Platform.pathSeparator}json";
  List<String> jsonFileNameList = ["example.json"];

  jsonFileNameList.forEach((jsonFileName) async {
    print("FILE_NAME: $jsonFileName");
    String jsonPath = "$folder${Platform.pathSeparator}$jsonFileName";
    OpenDynLoader openDynLoader = OpenDynLoader();
    OpenDyn openDyn = await openDynLoader.loadFromFile(jsonPath);
    // JsonEncoder.withIndent('  ').convert(openDyn.toJson());
    print("```json\n${JsonEncoder.withIndent('  ').convert(openDyn.toJson())}\n```");
  });
}
0
likes
130
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

An OpenDyn JSON Spec Parser, fromJson and toJson

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

json_annotation

More

Packages that depend on opendyn_dart