CPDFPushButtonWidget.fromJson constructor

CPDFPushButtonWidget.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CPDFPushButtonWidget.fromJson(Map<String, dynamic> json) {
  CPDFWidget common = CPDFWidget.fromJson(json);
  return CPDFPushButtonWidget(
      type: common.type,
      title: common.title,
      page: common.page,
      uuid: common.uuid,
      createDate: common.createDate,
      rect: common.rect,
      borderColor: common.borderColor,
      fillColor: common.fillColor,
      borderWidth: common.borderWidth,
      buttonTitle: json['buttonTitle'],
      action: json['action'] != null
          ? CPDFAction.fromJson(
              Map<String, dynamic>.from(json['action'] ?? {}))
          : null,
      fontColor: HexColor.fromHex(json['fontColor'] ?? '#000000'),
      fontSize: double.parse((json['fontSize'] as double).toStringAsFixed(2)),
      familyName: json['familyName'] ?? 'Helvetica',
      styleName: json['styleName'] ?? 'Regular');
}