|
|
@ -240,13 +240,9 @@ abstract class TdBase { |
|
|
|
return 'td::TdBase()'; |
|
|
|
return 'td::TdBase()'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static TdBase? fromJson(Map<String, dynamic>? json) { |
|
|
|
static final constructors = { |
|
|
|
if (json == null) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
final type = json['@type'] as String; |
|
|
|
|
|
|
|
final constructors = { |
|
|
|
|
|
|
|
"""; |
|
|
|
"""; |
|
|
|
|
|
|
|
|
|
|
|
for (final o in scheme.objects) { |
|
|
|
for (final o in scheme.objects) { |
|
|
|
final normName = o.name.pascalCase; |
|
|
|
final normName = o.name.pascalCase; |
|
|
|
result += ''' |
|
|
|
result += ''' |
|
|
@ -254,12 +250,18 @@ abstract class TdBase { |
|
|
|
'''; |
|
|
|
'''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result += ''' |
|
|
|
result += """ |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TdBase? fromJson(Map<String, dynamic>? json) { |
|
|
|
|
|
|
|
if (json == null) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
final type = json['@type'] as String; |
|
|
|
return constructors[type]!(json); |
|
|
|
return constructors[type]!(json); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
'''; |
|
|
|
"""; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
String makeAbstractFile(TlSchema scheme) { |
|
|
|
String makeAbstractFile(TlSchema scheme) { |
|
|
|