FooterLayoutEntity.fromJson constructor

FooterLayoutEntity.fromJson(
  1. Map<String, dynamic> jsonRes
)

Implementation

factory FooterLayoutEntity.fromJson(Map<String, dynamic> jsonRes) {
  final List<FooterEntity>? footerContent =
      jsonRes['content'] is List ? <FooterEntity>[] : null;
  if (footerContent != null) {
    for (final dynamic item in jsonRes['content']!) {
      if (item != null) {
        tryCatch(() {
          footerContent
              .add(FooterEntity.fromJson(asT<Map<String, dynamic>>(item)!));
        });
      }
    }
  }
  return FooterLayoutEntity(
    layoutDirection: asT<String?>(jsonRes['layout_direction']) ?? 'row',
    footerContent: footerContent,
  );
}