mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
28b124813a
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
31 lines
680 B
Dart
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(),
|
|
);
|
|
}
|
|
}
|