Правки + иконка

This commit is contained in:
2025-04-01 22:38:36 +03:00
parent b1aefa9f11
commit fb7ff84087
87 changed files with 1653 additions and 1720 deletions

View File

@@ -12,14 +12,59 @@ import 'package:remever/screens/dialogs/alert_dialog.dart';
import 'package:remever/screens/dialogs/dialog_header.dart';
import 'package:remever/screens/dialogs/dialog_item.dart';
import 'package:remever/services/collection/collections_interface.dart';
import 'package:share_plus/share_plus.dart';
class ActionDialog extends StatelessWidget {
const ActionDialog({super.key, required this.collection});
final Collection collection;
void _onTrainingTap(BuildContext context) {
showInfoToast('Все скоро будет. Рим не сразу строился');
Navigator.pop(context);
}
void _onEditTap(BuildContext context) {
Navigator.pop(context);
context.pushRoute(CrudCollectionRoute(editedCollection: collection));
}
void _onStatistickTap(BuildContext context) {
showInfoToast('Ты серьезно?');
Navigator.pop(context);
}
void _onDownloadTap(BuildContext context) {
showInfoToast('Ты серьезно?');
Navigator.pop(context);
}
void _onShareTap(BuildContext context) async {
await Share.share('View my collection ${collection.id}');
}
void _onDeleteTap(BuildContext context) async {
final bool? res = await showCuperModalBottomSheet(
context: context,
height: 262.h,
builder:
(BuildContext context) => const AlertInfoDialog(
title: 'Вы хотите удалить коллекцию?\nЭто действие необратимо',
acceptTitle: 'Да, удалить',
declineTitle: 'Нет, оставить',
),
);
if (res != null && res) {
await getIt<CollectionsInterface>().deleteCollection(collection.id);
Navigator.pop(context);
}
}
void _makePublic(BuildContext context, bool public) {
if (public) {
if (!public) {
showCuperModalBottomSheet(
context: context,
height: 282.h,
@@ -55,65 +100,32 @@ class ActionDialog extends StatelessWidget {
DialogItem(
title: 'Исключена из тренировки',
child: Assets.icons.typeHide.image(color: AppColors.primary),
onTap: () {
Navigator.pop(context);
},
onTap: () => _onTrainingTap(context),
),
DialogItem(
title: 'Редактировать',
child: Assets.icons.typeEdit.image(color: AppColors.primary),
onTap: () {
// context.back();
context.pushRoute(
CrudCollectionRoute(editedCollection: collection),
);
},
onTap: () => _onEditTap(context),
),
DialogItem(
title: 'Статистика',
child: Assets.icons.typeStat.image(color: AppColors.primary),
onTap: () {
Navigator.pop(context);
},
onTap: () => _onStatistickTap(context),
),
DialogItem(
title: 'Скачать',
child: Assets.icons.typeDownload.image(color: AppColors.primary),
onTap: () {
Navigator.pop(context);
},
onTap: () => _onDownloadTap(context),
),
DialogItem(
title: 'Поделиться',
child: Assets.icons.typeShare.image(color: AppColors.primary),
onTap: () {
Navigator.pop(context);
},
onTap: () => _onShareTap(context),
),
DialogItem(
title: 'Удалить',
color: AppColors.danger,
onTap: () async {
final bool? res = await showCuperModalBottomSheet(
context: context,
height: 262.h,
builder:
(BuildContext context) => const AlertInfoDialog(
title:
'Вы хотите удалить коллекцию?\nЭто действие необратимо',
acceptTitle: 'Да, удалить',
declineTitle: 'Нет, оставить',
),
);
if (true) {
await getIt<CollectionsInterface>().deleteCollection(
collection.id,
);
Navigator.pop(context);
}
},
onTap: () => _onDeleteTap(context),
child: Assets.icons.typeTrash.image(color: AppColors.danger),
),
const BottomSafeSpace(),