$UikScreenTitleSubtitlePropsFromJson function

UikScreenTitleSubtitleProps $UikScreenTitleSubtitlePropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikScreenTitleSubtitleProps $UikScreenTitleSubtitlePropsFromJson(
    Map<String, dynamic> json) {
  final UikScreenTitleSubtitleProps uikScreenTitleSubtitleProps =
      UikScreenTitleSubtitleProps();

  final String? id = jsonConvert.convert<String>(json['id']);

  final double? leftPadding = jsonConvert.convert<double>(json["leftPadding"]);
  final double? rightPadding =
      jsonConvert.convert<double>(json["rightPadding"]);
  final double? topPadding = jsonConvert.convert<double>(json["topPadding"]);
  final double? bottomPadding =
      jsonConvert.convert<double>(json["bottomPadding"]);

  final String? title = jsonConvert.convert<String>(json["title"]);

  final String? subtitle = jsonConvert.convert<String>(json["subtitle"]);

  if (id != null) {
    uikScreenTitleSubtitleProps.id = id;
  }

  if (leftPadding != null) {
    uikScreenTitleSubtitleProps.leftPadding = leftPadding;
  }

  if (rightPadding != null) {
    uikScreenTitleSubtitleProps.rightPadding = rightPadding;
  }

  if (topPadding != null) {
    uikScreenTitleSubtitleProps.topPadding = topPadding;
  }

  if (bottomPadding != null) {
    uikScreenTitleSubtitleProps.bottomPadding = bottomPadding;
  }

  if (title != null) {
    uikScreenTitleSubtitleProps.title =
        UikText(WidgetType.UikText, UikTextProps.fromJson(json["title"]));
  }

  if (subtitle != null) {
    uikScreenTitleSubtitleProps.subtitle =
        UikText(WidgetType.UikText, UikTextProps.fromJson(json["subtitle"]));
  } else {
    uikScreenTitleSubtitleProps.subtitle = null;
  }

  return uikScreenTitleSubtitleProps;
}