getChildString function
create child in build method
Implementation
String getChildString(ChildType type) {
switch (type) {
case ChildType.none:
return '';
case ChildType.child:
return '''
final child = (data.children?.isEmpty ?? true)
? null
: data.children!.first
.build(context: context, childBuilder: childBuilder);
''';
case ChildType.requiredChild:
return 'final child = getChild(data).build(context: context, childBuilder: childBuilder);';
case ChildType.children:
return '''
final children = data.children
?.map(
(e) => e.build(
context: context,
childBuilder: childBuilder,
),
)
.toList() ??
<Widget>[];
''';
}
}