// To parse this JSON data, do // // final collectionDto = collectionDtoFromJson(jsonString); import 'package:freezed_annotation/freezed_annotation.dart'; import 'dart:convert'; 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()); @freezed class CollectionDto with _$CollectionDto { const factory CollectionDto({ required String desc, required String title, required bool isPublic, String? avatar, }) = _CollectionDto; factory CollectionDto.fromJson(Map json) => _$CollectionDtoFromJson(json); }