From 0961683b59e4fd086096bc8ee4d37279054ca3c1 Mon Sep 17 00:00:00 2001 From: panazoid Date: Thu, 14 Nov 2024 02:18:07 +0400 Subject: [PATCH] lab4 --- lib/presentation/home_page/home_page.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/presentation/home_page/home_page.dart b/lib/presentation/home_page/home_page.dart index b08d703..21e4e5e 100644 --- a/lib/presentation/home_page/home_page.dart +++ b/lib/presentation/home_page/home_page.dart @@ -38,17 +38,14 @@ class Body extends StatelessWidget { final data = [ CardData('Arc Warden', discriptionText: 'Ловкость', - icon: Icons.account_circle, imageUrl: 'https://yt3.googleusercontent.com/VnqOJt9iHkwXonTzNfenydf4hTD2ilYcmiZv-RP8-3eifX16A64eZyV4z43LBL4EhPWAhTN2lJE=s900-c-k-c0x00ffffff-no-rj', ), CardData('Void Spirit', discriptionText: 'Универсальный', - icon: Icons.account_circle, imageUrl: 'https://cdna.artstation.com/p/assets/covers/images/024/245/520/large/maxime-lebled-voidspirit.jpg?1581789586', ), CardData('Invoker', discriptionText: 'Универсальный', - icon: Icons.account_circle, imageUrl: 'https://steamuserimages-a.akamaihd.net/ugc/1010400569445271177/6D5FF0CF2C48F8351C9AAC98363DEC31386678AB/?imw=5000&imh=5000&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false', ), ]; @@ -78,9 +75,11 @@ class Body extends StatelessWidget { void _showSnackBar(BuildContext context, String title, bool isLiked) { WidgetsBinding.instance.addPostFrameCallback((_) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text( - 'Вы ${isLiked ? 'добавили в избранное' : 'убрали из избраных'} $title', - style: Theme.of(context).textTheme.bodyLarge, + content: Center( + child: Text( + '${isLiked ? 'Добавлено в избранное' : 'Убрано из избраных'} $title', + style: Theme.of(context).textTheme.bodyLarge, + ), ), backgroundColor: Color(0xFF7BA05B), duration: const Duration(seconds: 1),