import 'package:mc_common_app/view_models/ad_view_model.dart';

class AppInfoModel {
  int? id;
  String? header;
  String? content;
  bool? isActive;
  int? channel;
  List<ImageModel>? images;

  AppInfoModel({this.id, this.header, this.content, this.isActive, this.channel, this.images});

  AppInfoModel.fromJson(Map<String, dynamic> json, {bool isForTermsAndCondition = false}) {
    String imagesKey = "appInfoImages";
    if (isForTermsAndCondition) {
      imagesKey = "termAndConditionImages";
    }
    id = json['id'];
    header = json['header'];
    content = json['content'];
    isActive = json['isActive'];
    channel = json['channel'];
    if (json[imagesKey] != null) {
      images = <ImageModel>[];
      json[imagesKey].forEach((v) {
        images!.add(ImageModel.fromJson(v));
      });
    }
  }
}
