DatabaseDefinition.fromJson constructor

DatabaseDefinition.fromJson(
  1. Map<String, dynamic> jsonSerialization
)

Implementation

factory DatabaseDefinition.fromJson(Map<String, dynamic> jsonSerialization) {
  return DatabaseDefinition(
    name: jsonSerialization['name'] as String?,
    moduleName: jsonSerialization['moduleName'] as String,
    tables: (jsonSerialization['tables'] as List)
        .map((e) => _i2.TableDefinition.fromJson((e as Map<String, dynamic>)))
        .toList(),
    installedModules: (jsonSerialization['installedModules'] as List)
        .map((e) => _i2.DatabaseMigrationVersion.fromJson(
            (e as Map<String, dynamic>)))
        .toList(),
    migrationApiVersion: jsonSerialization['migrationApiVersion'] as int,
  );
}