Правки + иконка
This commit is contained in:
@@ -2,26 +2,41 @@
|
||||
//
|
||||
// final collectionDto = collectionDtoFromJson(jsonString);
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'collection_dto.freezed.dart';
|
||||
part 'collection_dto.g.dart';
|
||||
// part 'collection_dto.g.dart';
|
||||
|
||||
CollectionDto collectionDtoFromJson(String str) =>
|
||||
CollectionDto.fromJson(json.decode(str));
|
||||
// CollectionDto collectionDtoFromJson(String str) =>
|
||||
// CollectionDto.fromJson(json.decode(str));
|
||||
|
||||
String collectionDtoToJson(CollectionDto data) => json.encode(data.toJson());
|
||||
// String collectionDtoToJson(CollectionDto data) => json.encode(data.toJson());
|
||||
|
||||
@freezed
|
||||
class CollectionDto with _$CollectionDto {
|
||||
// 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,
|
||||
String? avatar,
|
||||
Uint8List? avatar,
|
||||
}) = _CollectionDto;
|
||||
|
||||
factory CollectionDto.fromJson(Map<String, dynamic> json) =>
|
||||
_$CollectionDtoFromJson(json);
|
||||
// factory CollectionDto.fromJson(Map<String, dynamic> json) =>
|
||||
// _$CollectionDtoFromJson(json);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user