feat(diary): fix analzye

This commit is contained in:
mso7nueh
2024-10-30 15:50:58 +03:00
parent c7707c0919
commit b0c687e5fe

View File

@@ -5,11 +5,12 @@ import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
import 'package:eatvio_app/locator_service.dart';
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:image_picker/image_picker.dart';
// import 'package:image_picker/image_picker.dart';
import 'package:rive/rive.dart';
import 'package:table_calendar/table_calendar.dart';
@@ -172,10 +173,7 @@ class _DiaryScreenState extends State<DiaryScreen> {
_addProductButton(diaryDay),
const SizedBox(height: 24),
GestureDetector(
onTap: () async {
final picker = ImagePicker();
List<XFile>? images = await picker.pickMultiImage();
},
onTap: () => showCupertinoActionSheet(),
child: SvgPicture.asset(
width: MediaQuery.of(context).size.width - 32,
'assets/no_one_image_was_added.svg',
@@ -187,6 +185,47 @@ class _DiaryScreenState extends State<DiaryScreen> {
);
}
showCupertinoActionSheet() {
showCupertinoModalPopup(
context: context,
builder: (_) => CupertinoActionSheet(
actions: [
CupertinoActionSheetAction(
onPressed: () async {
// final picker = ImagePicker();
// List<XFile>? images = await picker.pickMultiImage();
},
child: Row(
children: [
const Icon(Icons.photo),
const SizedBox(width: 8),
const Text('Галерея'),
],
),
),
CupertinoActionSheetAction(
onPressed: () async {
// final picker = ImagePicker();
// XFile? image = await picker.pickImage(source: ImageSource.camera);
},
child: Row(
children: [
const Icon(Icons.photo_camera),
const SizedBox(width: 8),
const Text('Фото'),
],
),
),
],
cancelButton: CupertinoActionSheetAction(
onPressed: () => Navigator.of(context).pop(),
isDestructiveAction: true,
child: const Text('Отмена'),
),
),
);
}
_mealButton(int mealNumber) {
bool isActive = currentSelectedMealNumber == mealNumber;