forked from eatvio/eatvio_app
review: fixed review issues
This commit is contained in:
@@ -199,11 +199,17 @@ class CreateDietCubit extends Cubit<CreateDietState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const int _maxImageBytesForBase64 = 5 * 1024 * 1024;
|
||||
|
||||
Future<Diet?> getDietForPreview() async {
|
||||
if (!_isFormValidForDraft()) return null;
|
||||
final authorProfile = await profileRepository.getMyProfile();
|
||||
final imageBytes = (await state.dietData.image?.readAsBytes()) ?? <int>[];
|
||||
String image = base64.encode(imageBytes);
|
||||
String image = '';
|
||||
if (imageBytes.isNotEmpty && imageBytes.length <= _maxImageBytesForBase64) {
|
||||
image = base64.encode(imageBytes);
|
||||
}
|
||||
if (image.isEmpty && state.dietData.imageUrl != null) {
|
||||
image = state.dietData.imageUrl ?? '';
|
||||
}
|
||||
|
||||
@@ -44,6 +44,12 @@ class _DietPreviewScreenState extends State<DietPreviewScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
scrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
|
||||
Reference in New Issue
Block a user