$UikSwitchPropsFromJson function
Implementation
UikSwitchProps $UikSwitchPropsFromJson(Map<String, dynamic> json) {
final UikSwitchProps uikSwitchProps = UikSwitchProps();
final String? id = jsonConvert.convert<String>(json['id']);
if (id != null) {
uikSwitchProps.id = id;
}
final String? activetopColor =
jsonConvert.convert<String>(json['activetopColor']);
if (activetopColor != null) {
uikSwitchProps.activetopColor = Color(int.parse(activetopColor));
}
final String? inactivetopColor =
jsonConvert.convert<String>(json['inactivetopColor']);
if (inactivetopColor != null) {
uikSwitchProps.inactivetopColor = Color(int.parse(inactivetopColor));
}
final String? activebackgroundColor =
jsonConvert.convert<String>(json['activebackgroundColor']);
if (activebackgroundColor != null) {
uikSwitchProps.activebackgroundColor =
Color(int.parse(activebackgroundColor));
}
final String? inactivebackgroundColor =
jsonConvert.convert<String>(json['inactivebackgroundColor']);
if (inactivebackgroundColor != null) {
uikSwitchProps.inactivebackgroundColor =
Color(int.parse(inactivebackgroundColor));
}
final bool? isSwitched = jsonConvert.convert<bool>(json['isSwitched']);
if (isSwitched != null) {
uikSwitchProps.isSwitched = isSwitched;
}
final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
if (action != null) {
uikSwitchProps.action = action;
}
return uikSwitchProps;
}