feat(feed): subscribe button + remove diary photo loading delay

This commit is contained in:
mso7nueh
2024-11-20 16:10:54 +03:00
parent c0fc3d9f33
commit f805505cb3
2 changed files with 25 additions and 4 deletions

View File

@@ -586,6 +586,7 @@ class _DiaryScreenState extends State<DiaryScreen> {
actions: [
CupertinoActionSheetAction(
onPressed: () async {
Navigator.of(context).pop();
final picker = ImagePicker();
XFile? image = await picker.pickImage(source: ImageSource.camera);
if (image != null)
@@ -595,7 +596,6 @@ class _DiaryScreenState extends State<DiaryScreen> {
mealId: diaryDay.meals[currentSelectedMealNumber - 1].id,
date: _selectedDay.toString(),
);
Navigator.of(context).pop();
},
child: const Row(
children: const [
@@ -607,6 +607,7 @@ class _DiaryScreenState extends State<DiaryScreen> {
),
CupertinoActionSheetAction(
onPressed: () async {
Navigator.of(context).pop();
final picker = ImagePicker();
List<XFile>? images = await picker.pickMultiImage();
if (images.isNotEmpty)
@@ -616,7 +617,6 @@ class _DiaryScreenState extends State<DiaryScreen> {
mealId: diaryDay.meals[currentSelectedMealNumber - 1].id,
date: _selectedDay.toString(),
);
Navigator.of(context).pop();
},
child: const Row(
children: const [
@@ -898,7 +898,7 @@ class _DiaryScreenState extends State<DiaryScreen> {
);
},
itemSeparatorBuilder: (context, index) => _divider(context),
onSelected: (newSelectedGlossary) {
onSelected: (newSelectedGlossary) async {
setState(() {
selectedGlossary = newSelectedGlossary;
productNameController.text = selectedGlossary!.name;
@@ -946,7 +946,6 @@ class _DiaryScreenState extends State<DiaryScreen> {
: selectedGlossary!.grInPortion == 0
? '100'
: '1',
autofocus: true,
suffixText: selectedGlossary == null
? 'гр'
: selectedGlossary?.grInPortion == 0