fromJson static method
Implementation
static TextCompositionStyle? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return TextCompositionStyle(
name: (json['name'] as String?) ?? '',
customEmojiId:
int.tryParse(
(json['custom_emoji_id'] as dynamic)?.toString() ?? '',
) ??
0,
title: (json['title'] as String?) ?? '',
isCustom: (json['is_custom'] as bool?) ?? false,
isCreator: (json['is_creator'] as bool?) ?? false,
installCount: (json['install_count'] as int?) ?? 0,
prompt: (json['prompt'] as String?) ?? '',
creatorUserId: (json['creator_user_id'] as int?) ?? 0,
englishExample: TextCompositionStyleExample.fromJson(
tdMapFromJson(json['english_example']),
),
);
}