create static method
ContentAds
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "contentAds",
- String? ads_unique_id,
- String? content_type,
- List<
String> ? medias, - String? caption,
- List<
List< ? inline_keyboard,InlineKeyboard> >
override
Generated
Implementation
static ContentAds create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "contentAds",
String? ads_unique_id,
String? content_type,
List<String>? medias,
String? caption,
List<List<InlineKeyboard>>? inline_keyboard,
}) {
// ContentAds contentAds = ContentAds({
final Map contentAds_data_create_json = {
"@type": special_type,
"ads_unique_id": ads_unique_id,
"content_type": content_type,
"medias": medias,
"caption": caption,
"inline_keyboard": (inline_keyboard != null)
? inline_keyboard
.map((res) => res.map((e) => e.toJson()).toList().cast<Map>())
.toList()
.cast<List<Map>>()
: null,
};
contentAds_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (contentAds_data_create_json.containsKey(key) == false) {
contentAds_data_create_json[key] = value;
}
});
}
return ContentAds(contentAds_data_create_json);
}