Files
divkit/api_generator/tests/references/dart/entity_with_array.dart
T
man-y 28b124813a Generation of the main functionality
Generation of the main functionality
- fix non-deterministic sorting of objects
- generate data classes and check functionality
- rewrite entity_enumeration declaration
- generate default values
- generate description to values
- custom wrapper to parse primitive types
- generate map and maybeMap aka freezed funcs
- generate class deserialization fromJson
- add simple unit test to check the basic components
- clean
2023-03-02 12:18:32 +03:00

31 lines
680 B
Dart

// Generated code. Do not modify.
import 'package:equatable/equatable.dart';
import '../utils/parsing_extensions.dart';
import 'entity.dart';
class EntityWithArray with EquatableMixin {
const EntityWithArray({
required this.array,
});
static const type = "entity_with_array";
// at least 1 elements
final List<Entity> array;
@override
List<Object?> get props => [
array,
];
static EntityWithArray? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return EntityWithArray(
array: (json['array'] as List<dynamic>).map((j) => Entity.fromJson(j as Map <String, dynamic>)!).toList(),
);
}
}