import 'package:didvan/models/home_page_content/banner.dart';

import 'home_page_list.dart';

class MainPageContent {
  final List<List<MainPageBannerType>> banners;
  final List<MainPageList> lists;

  const MainPageContent({required this.banners, required this.lists});

  factory MainPageContent.fromJson(Map<String, dynamic> json) {
    return MainPageContent(
      banners: List<List<MainPageBannerType>>.from(
        json['banners'].map(
          (list) => List<MainPageBannerType>.from(
            list.map((e) => MainPageBannerType.fromJson(e)).toList(),
          ),
        ),
      ),
      lists: List<MainPageList>.from(
        json['lists'].map(
          (x) => MainPageList.fromJson(x),
        ),
      ),
    );
  }
}
