toJson method
转换为 JSON
Implementation
Map<String, dynamic> toJson() {
return {
'type': type?.toString().split('.').last,
'isFloating': isFloating,
'hasAnimation': hasAnimation,
'isCollapsible': isCollapsible,
'initiallyExpanded': initiallyExpanded,
'animationDuration': animationDuration.inMilliseconds,
'animationType': animationType?.toString().split('.').last,
'width': width,
'height': height,
'margin':
margin != null
? {
'left': margin!.left,
'top': margin!.top,
'right': margin!.right,
'bottom': margin!.bottom,
}
: null,
'padding':
padding != null
? {
'left': padding!.left,
'top': padding!.top,
'right': padding!.right,
'bottom': padding!.bottom,
}
: null,
'customProps': customProps,
'backgroundColor': backgroundColor?.toARGB32(),
'showToggleButton': showToggleButton,
'isShow': isShow,
};
}