VideoSingleCardConfig.fromMap constructor
从Map创建配置
Implementation
factory VideoSingleCardConfig.fromMap(Map<String, dynamic> map) {
final bool? hideTitleValue = map['hideTitle'] as bool?;
final bool? showTitleValue = map.containsKey('showTitle')
? map['showTitle'] as bool?
: (hideTitleValue != null ? !hideTitleValue : null);
return VideoSingleCardConfig(
scene: map['scene'] as String?,
hidePlay: map['hidePlay'] as bool?,
hideTitle: hideTitleValue,
showTitle: showTitleValue,
hideBottomInfo: map['hideBottomInfo'] as bool?,
coverHeight: map['coverHeight'] as int?,
coverWidth: map['coverWidth'] as int?,
componentPosition: map['componentPosition'] as String?,
reportTopPadding: map['reportTopPadding'] as int?,
cardWidth: map['cardWidth'] as int?,
cardHeight: map['cardHeight'] as int?,
showUserName: map['showUserName'] as bool?,
showDuration: map['showDuration'] as bool?,
showViewCount: map['showViewCount'] as bool?,
showLikeCount: map['showLikeCount'] as bool?,
showCommentCount: map['showCommentCount'] as bool?,
showShareButton: map['showShareButton'] as bool?,
showAvatar: map['showAvatar'] as bool?,
showFollowButton: map['showFollowButton'] as bool?,
autoPlay: map['autoPlay'] as bool?,
loopPlay: map['loopPlay'] as bool?,
mutePlay: map['mutePlay'] as bool?,
preloadCount: map['preloadCount'] as int?,
cacheSize: map['cacheSize'] as int?,
networkType: map['networkType'] as int?,
backgroundColor: map['backgroundColor'] as String?,
titleColor: map['titleColor'] as String?,
userNameColor: map['userNameColor'] as String?,
playButtonColor: map['playButtonColor'] as String?,
statsColor: map['statsColor'] as String?,
borderColor: map['borderColor'] as String?,
borderWidth: map['borderWidth'] as int?,
cornerRadius: map['cornerRadius'] as int?,
padding: map['padding'] as int?,
margin: map['margin'] as int?,
enableShadow: map['enableShadow'] as bool?,
shadowColor: map['shadowColor'] as String?,
shadowOffsetX: map['shadowOffsetX'] as int?,
shadowOffsetY: map['shadowOffsetY'] as int?,
shadowBlurRadius: map['shadowBlurRadius'] as int?,
fontSize: map['fontSize'] as int?,
fontBold: map['fontBold'] as bool?,
titleMaxLines: map['titleMaxLines'] as int?,
userNameMaxLength: map['userNameMaxLength'] as int?,
playButtonSize: map['playButtonSize'] as int?,
avatarSize: map['avatarSize'] as int?,
followButtonWidth: map['followButtonWidth'] as int?,
followButtonHeight: map['followButtonHeight'] as int?,
actionButtonSpacing: map['actionButtonSpacing'] as int?,
bottomInfoHeight: map['bottomInfoHeight'] as int?,
topInfoHeight: map['topInfoHeight'] as int?,
);
}