О
Size: a a a
О
О
О
DY
DY
О
DK
class SomeFormShit extends StatelessWidget {
final String name;
final String value;
final Color color;
const SomeFormShit({Key key, this.name, this.value, this.color})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: color,
child: Column(
children: [
Text(name),
Text(
value,
)
],
),
);
}
static SomeFormShit fromJson(Map m) {
if (m['color'] == 'red') {
return SomeFormShit(
color: Colors.red, value: m['value'], name: m['name']);
}
return SomeFormShit(
color: Colors.white,
);
}
}
child: SomeFormShit.fromJson(map),
О
О
О
DK
Widget build(BuildContext context) {
if (formData['type'] == 'Widget1') {
return Widget1(
formData['name'],
);
} ;
if (formData['type'] == 'Widget2') {
return Widget2(
formData['name'],
);
};
return Text('Тип виджета не определен');
}
О
V
О
EF
KK
AD
AD