$UikPaginationPropsFromJson function

UikPaginationProps $UikPaginationPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikPaginationProps $UikPaginationPropsFromJson(Map<String, dynamic> json) {
  final UikPaginationProps uikPaginationProps = UikPaginationProps();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    uikPaginationProps.id = id;
  }
  final bool? hasicons = jsonConvert.convert<bool>(json['hasIcons']);
  if (hasicons != null) {
    uikPaginationProps.hasIcons = hasicons;
  }
  final String? text = jsonConvert.convert<String>(json['text']);
  if (text != null) {
    uikPaginationProps.text = text;
  }
  final String? icon1 = jsonConvert.convert<String>(json['icon1']);
  if (icon1 != null) {
    uikPaginationProps.Icon1 =
        UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['icon1']));
  }
  final List<dynamic>? IconList =
      jsonConvert.convert<List<dynamic>>(json['iconList']);
  if (IconList != null) {
    for (int i = 0; i < IconList.length; i++) {
      uikPaginationProps.iconList
          .add(UikIcon(WidgetType.UikText, UikIconProps.fromJson(IconList[i])));
    }
  }
  final List<dynamic>? ImgList =
      jsonConvert.convert<List<dynamic>>(json['imgList']);
  if (ImgList != null) {
    for (int i = 0; i < ImgList.length; i++) {
      if (json['imgList'][i]['id'] == 'Img') {
        uikPaginationProps.imgList.add(
            UikImage(WidgetType.UikText, UikImageProps.fromJson(ImgList[i])));
      } else if (json['imgList'][i]['id'] == 'Vid') {
        uikPaginationProps.imgList.add(
            UikImage(WidgetType.UikText, UikImageProps.fromJson(ImgList[i])));
      }
    }
  }

  final double? imagePadding =
      jsonConvert.convert<double>(json['imagePadding']);
  if (imagePadding != null) {
    uikPaginationProps.imagePadding = imagePadding;
  }

  final double? imageLeftMargin =
      jsonConvert.convert<double>(json["imageLeftMargin"]);
  final double? imageRightMargin =
      jsonConvert.convert<double>(json["imageRightMargin"]);
  final double? imageTopMargin =
      jsonConvert.convert<double>(json["imageTopMargin"]);
  final double? imageBottomMargin =
      jsonConvert.convert<double>(json["imageBottomMargin"]);

  if (imageLeftMargin != null) {
    uikPaginationProps.imageLeftMargin = imageLeftMargin;
  }
  if (imageRightMargin != null) {
    uikPaginationProps.imageRightMargin = imageRightMargin;
  }
  if (imageTopMargin != null) {
    uikPaginationProps.imageTopMargin = imageTopMargin;
  }
  if (imageBottomMargin != null) {
    uikPaginationProps.imageBottomMargin = imageBottomMargin;
  }

  final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
  if (action != null) {
    uikPaginationProps.action = action;
  }
  return uikPaginationProps;
}