toMap method

Map<String, dynamic> toMap()

Serialises config fields to pass over the method channel.

Implementation

Map<String, dynamic> toMap() => {
      if (title != null) 'title': title,
      // toSigned(32) ensures the value fits in Int32 on both native platforms
      if (initialPenColor != null)
        'initialPenColor': initialPenColor!.toARGB32().toSigned(32),
      if (initialHighlightColor != null)
        'initialHighlightColor':
            initialHighlightColor!.toARGB32().toSigned(32),
      if (initialStrokeWidth != null) 'initialStrokeWidth': initialStrokeWidth,
      if (initialPage != 0) 'initialPage': initialPage,
      if (locale != null) 'locale': locale!.code,
    };