generateMethod method

  1. @override
GeneratorExtras generateMethod(
  1. StringBuffer buffer,
  2. Objects objects,
  3. DartGeneratorOptions options
)
override

Implementation

@override
GeneratorExtras generateMethod(
    StringBuffer buffer, Objects objects, DartGeneratorOptions options) {
  final reviverName = _reviverName(options.className(objects.name));
  buffer.writeFromJson(objects, reviverName, options);
  return GeneratorExtras(
      const {'dart:convert', 'package:schemake/schemake.dart'},
      {reviverName},
      (writer) => writer.writeJsonReviver(objects, reviverName, options));
}