43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final collectionDto = collectionDtoFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
import 'dart:typed_data';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'collection_dto.freezed.dart';
|
|
// part 'collection_dto.g.dart';
|
|
|
|
// CollectionDto collectionDtoFromJson(String str) =>
|
|
// CollectionDto.fromJson(json.decode(str));
|
|
|
|
// String collectionDtoToJson(CollectionDto data) => json.encode(data.toJson());
|
|
|
|
// class Uint8ListConverter implements JsonConverter<Uint8List?, List<int>?> {
|
|
// const Uint8ListConverter();
|
|
|
|
// @override
|
|
// Uint8List? fromJson(List<int>? json) {
|
|
// return json == null ? null : Uint8List.fromList(json);
|
|
// }
|
|
|
|
// @override
|
|
// List<int>? toJson(Uint8List? object) {
|
|
// return object?.toList();
|
|
// }
|
|
// }
|
|
|
|
@Freezed(copyWith: true, equal: true, fromJson: false, toJson: false)
|
|
abstract class CollectionDto with _$CollectionDto {
|
|
const factory CollectionDto({
|
|
required String desc,
|
|
required String title,
|
|
required bool isPublic,
|
|
Uint8List? avatar,
|
|
}) = _CollectionDto;
|
|
|
|
// factory CollectionDto.fromJson(Map<String, dynamic> json) =>
|
|
// _$CollectionDtoFromJson(json);
|
|
}
|