bugfix(image): Перенос хранения картинок из бд в папку приложения

This commit is contained in:
2025-09-08 20:55:17 +03:00
parent a376faf0ce
commit 51c4ae4f02
22 changed files with 191 additions and 155 deletions

View File

@@ -2,8 +2,6 @@
//
// final collectionDto = collectionDtoFromJson(jsonString);
import 'dart:convert';
import 'dart:typed_data';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:remever/database/database.dart';
@@ -14,9 +12,9 @@ abstract class CreateTicketDto with _$CreateTicketDto {
const factory CreateTicketDto({
Collection? collection,
String? question,
Uint8List? questionImage,
String? questionImage,
String? answer,
Uint8List? answerImage,
String? answerImage,
bool? needRevert,
}) = _CreateTicketDto;
}

View File

@@ -19,9 +19,9 @@ final _privateConstructorUsedError = UnsupportedError(
mixin _$CreateTicketDto {
Collection? get collection => throw _privateConstructorUsedError;
String? get question => throw _privateConstructorUsedError;
Uint8List? get questionImage => throw _privateConstructorUsedError;
String? get questionImage => throw _privateConstructorUsedError;
String? get answer => throw _privateConstructorUsedError;
Uint8List? get answerImage => throw _privateConstructorUsedError;
String? get answerImage => throw _privateConstructorUsedError;
bool? get needRevert => throw _privateConstructorUsedError;
/// Create a copy of CreateTicketDto
@@ -41,9 +41,9 @@ abstract class $CreateTicketDtoCopyWith<$Res> {
$Res call({
Collection? collection,
String? question,
Uint8List? questionImage,
String? questionImage,
String? answer,
Uint8List? answerImage,
String? answerImage,
bool? needRevert,
});
}
@@ -86,7 +86,7 @@ class _$CreateTicketDtoCopyWithImpl<$Res, $Val extends CreateTicketDto>
freezed == questionImage
? _value.questionImage
: questionImage // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
answer:
freezed == answer
? _value.answer
@@ -96,7 +96,7 @@ class _$CreateTicketDtoCopyWithImpl<$Res, $Val extends CreateTicketDto>
freezed == answerImage
? _value.answerImage
: answerImage // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
needRevert:
freezed == needRevert
? _value.needRevert
@@ -120,9 +120,9 @@ abstract class _$$CreateTicketDtoImplCopyWith<$Res>
$Res call({
Collection? collection,
String? question,
Uint8List? questionImage,
String? questionImage,
String? answer,
Uint8List? answerImage,
String? answerImage,
bool? needRevert,
});
}
@@ -164,7 +164,7 @@ class __$$CreateTicketDtoImplCopyWithImpl<$Res>
freezed == questionImage
? _value.questionImage
: questionImage // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
answer:
freezed == answer
? _value.answer
@@ -174,7 +174,7 @@ class __$$CreateTicketDtoImplCopyWithImpl<$Res>
freezed == answerImage
? _value.answerImage
: answerImage // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
needRevert:
freezed == needRevert
? _value.needRevert
@@ -202,11 +202,11 @@ class _$CreateTicketDtoImpl implements _CreateTicketDto {
@override
final String? question;
@override
final Uint8List? questionImage;
final String? questionImage;
@override
final String? answer;
@override
final Uint8List? answerImage;
final String? answerImage;
@override
final bool? needRevert;
@@ -226,15 +226,11 @@ class _$CreateTicketDtoImpl implements _CreateTicketDto {
) &&
(identical(other.question, question) ||
other.question == question) &&
const DeepCollectionEquality().equals(
other.questionImage,
questionImage,
) &&
(identical(other.questionImage, questionImage) ||
other.questionImage == questionImage) &&
(identical(other.answer, answer) || other.answer == answer) &&
const DeepCollectionEquality().equals(
other.answerImage,
answerImage,
) &&
(identical(other.answerImage, answerImage) ||
other.answerImage == answerImage) &&
(identical(other.needRevert, needRevert) ||
other.needRevert == needRevert));
}
@@ -244,9 +240,9 @@ class _$CreateTicketDtoImpl implements _CreateTicketDto {
runtimeType,
const DeepCollectionEquality().hash(collection),
question,
const DeepCollectionEquality().hash(questionImage),
questionImage,
answer,
const DeepCollectionEquality().hash(answerImage),
answerImage,
needRevert,
);
@@ -266,9 +262,9 @@ abstract class _CreateTicketDto implements CreateTicketDto {
const factory _CreateTicketDto({
final Collection? collection,
final String? question,
final Uint8List? questionImage,
final String? questionImage,
final String? answer,
final Uint8List? answerImage,
final String? answerImage,
final bool? needRevert,
}) = _$CreateTicketDtoImpl;
@@ -277,11 +273,11 @@ abstract class _CreateTicketDto implements CreateTicketDto {
@override
String? get question;
@override
Uint8List? get questionImage;
String? get questionImage;
@override
String? get answer;
@override
Uint8List? get answerImage;
String? get answerImage;
@override
bool? get needRevert;

View File

@@ -2,7 +2,6 @@
//
// final collectionDto = collectionDtoFromJson(jsonString);
import 'dart:convert';
import 'dart:typed_data';
import 'package:freezed_annotation/freezed_annotation.dart';
@@ -14,6 +13,6 @@ abstract class CrudCollectionDto with _$CrudCollectionDto {
required String desc,
required String title,
required bool isPublic,
Uint8List? avatar,
String? avatar,
}) = _CrudCollectionDto;
}

View File

@@ -20,7 +20,7 @@ mixin _$CrudCollectionDto {
String get desc => throw _privateConstructorUsedError;
String get title => throw _privateConstructorUsedError;
bool get isPublic => throw _privateConstructorUsedError;
Uint8List? get avatar => throw _privateConstructorUsedError;
String? get avatar => throw _privateConstructorUsedError;
/// Create a copy of CrudCollectionDto
/// with the given fields replaced by the non-null parameter values.
@@ -36,7 +36,7 @@ abstract class $CrudCollectionDtoCopyWith<$Res> {
$Res Function(CrudCollectionDto) then,
) = _$CrudCollectionDtoCopyWithImpl<$Res, CrudCollectionDto>;
@useResult
$Res call({String desc, String title, bool isPublic, Uint8List? avatar});
$Res call({String desc, String title, bool isPublic, String? avatar});
}
/// @nodoc
@@ -80,7 +80,7 @@ class _$CrudCollectionDtoCopyWithImpl<$Res, $Val extends CrudCollectionDto>
freezed == avatar
? _value.avatar
: avatar // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
)
as $Val,
);
@@ -96,7 +96,7 @@ abstract class _$$CrudCollectionDtoImplCopyWith<$Res>
) = __$$CrudCollectionDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String desc, String title, bool isPublic, Uint8List? avatar});
$Res call({String desc, String title, bool isPublic, String? avatar});
}
/// @nodoc
@@ -139,7 +139,7 @@ class __$$CrudCollectionDtoImplCopyWithImpl<$Res>
freezed == avatar
? _value.avatar
: avatar // ignore: cast_nullable_to_non_nullable
as Uint8List?,
as String?,
),
);
}
@@ -162,7 +162,7 @@ class _$CrudCollectionDtoImpl implements _CrudCollectionDto {
@override
final bool isPublic;
@override
final Uint8List? avatar;
final String? avatar;
@override
String toString() {
@@ -178,17 +178,11 @@ class _$CrudCollectionDtoImpl implements _CrudCollectionDto {
(identical(other.title, title) || other.title == title) &&
(identical(other.isPublic, isPublic) ||
other.isPublic == isPublic) &&
const DeepCollectionEquality().equals(other.avatar, avatar));
(identical(other.avatar, avatar) || other.avatar == avatar));
}
@override
int get hashCode => Object.hash(
runtimeType,
desc,
title,
isPublic,
const DeepCollectionEquality().hash(avatar),
);
int get hashCode => Object.hash(runtimeType, desc, title, isPublic, avatar);
/// Create a copy of CrudCollectionDto
/// with the given fields replaced by the non-null parameter values.
@@ -207,7 +201,7 @@ abstract class _CrudCollectionDto implements CrudCollectionDto {
required final String desc,
required final String title,
required final bool isPublic,
final Uint8List? avatar,
final String? avatar,
}) = _$CrudCollectionDtoImpl;
@override
@@ -217,7 +211,7 @@ abstract class _CrudCollectionDto implements CrudCollectionDto {
@override
bool get isPublic;
@override
Uint8List? get avatar;
String? get avatar;
/// Create a copy of CrudCollectionDto
/// with the given fields replaced by the non-null parameter values.