encode method

String encode()

The file export --to writes.

Implementation

String encode() {
  final Map<String, Object?> document = {
    'nylo': formatVersion,
    if (exportedAt != null)
      'exportedAt': exportedAt!.toUtc().toIso8601String(),
    if (app != null) 'app': app,
    if (env != null) 'env': env,
    if (device != null) 'device': device,
    if (route != null) 'route': route,
    'storage': storage,
    'backpack': backpack,
  };
  return '${const JsonEncoder.withIndent('  ').convert(document)}\n';
}