48 lines
1.7 KiB
Dart
48 lines
1.7 KiB
Dart
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||
|
|
|
||
|
|
part of 'ink_stroke.dart';
|
||
|
|
|
||
|
|
// **************************************************************************
|
||
|
|
// JsonSerializableGenerator
|
||
|
|
// **************************************************************************
|
||
|
|
|
||
|
|
_$InkStrokeImpl _$$InkStrokeImplFromJson(Map<String, dynamic> json) =>
|
||
|
|
_$InkStrokeImpl(
|
||
|
|
id: json['id'] as String,
|
||
|
|
points: (json['points'] as List<dynamic>)
|
||
|
|
.map((e) => InkPoint.fromJson(e as Map<String, dynamic>))
|
||
|
|
.toList(),
|
||
|
|
tool: $enumDecodeNullable(_$PenToolEnumMap, json['tool']) ?? PenTool.pen,
|
||
|
|
color: (json['color'] as num?)?.toInt() ?? 0xFF000000,
|
||
|
|
strokeWidth: (json['strokeWidth'] as num?)?.toDouble() ?? 2.0,
|
||
|
|
createdAt: DateTime.parse(json['createdAt'] as String),
|
||
|
|
filled: json['filled'] as bool? ?? false,
|
||
|
|
textContent: json['textContent'] as String?,
|
||
|
|
fontSize: (json['fontSize'] as num?)?.toDouble() ?? 14.0,
|
||
|
|
);
|
||
|
|
|
||
|
|
Map<String, dynamic> _$$InkStrokeImplToJson(_$InkStrokeImpl instance) =>
|
||
|
|
<String, dynamic>{
|
||
|
|
'id': instance.id,
|
||
|
|
'points': instance.points,
|
||
|
|
'tool': _$PenToolEnumMap[instance.tool]!,
|
||
|
|
'color': instance.color,
|
||
|
|
'strokeWidth': instance.strokeWidth,
|
||
|
|
'createdAt': instance.createdAt.toIso8601String(),
|
||
|
|
'filled': instance.filled,
|
||
|
|
'textContent': instance.textContent,
|
||
|
|
'fontSize': instance.fontSize,
|
||
|
|
};
|
||
|
|
|
||
|
|
const _$PenToolEnumMap = {
|
||
|
|
PenTool.pen: 'pen',
|
||
|
|
PenTool.marker: 'marker',
|
||
|
|
PenTool.eraser: 'eraser',
|
||
|
|
PenTool.highlighter: 'highlighter',
|
||
|
|
PenTool.rectangle: 'rectangle',
|
||
|
|
PenTool.ellipse: 'ellipse',
|
||
|
|
PenTool.line: 'line',
|
||
|
|
PenTool.arrow: 'arrow',
|
||
|
|
PenTool.text: 'text',
|
||
|
|
};
|