toJSON method

Map<String, dynamic> toJSON([
  1. dynamic data
])

Implementation

Map<String, dynamic> toJSON([data]) {
  Map<String, dynamic> result = {
    "itemSize": itemSize,
    "type": array.runtimeType.toString(), // TODO remove runtimeType for on web release mode type minification
    "array": array.sublist(0),
    "normalized": normalized
  };

  if (name != null) result["name"] = name;
  if (usage != StaticDrawUsage) result["usage"] = usage;
  if (updateRange?["offset"] != 0 || updateRange?["count"] != -1) {
    result["updateRange"] = updateRange;
  }

  return result;
}