Revert "Добавил кастомизацию+, убрал жесты потому что они мне жизнь сломали"

This reverts commit 9ca9f0c2d4.
This commit is contained in:
jganenok
2025-12-05 18:44:22 +07:00
parent dd6e9107f4
commit ca8fd20796
7 changed files with 261 additions and 1235 deletions

View File

@@ -2000,40 +2000,10 @@ class _ChatsScreenState extends State<ChatsScreen>
if (widget.hasScaffold) {
return Builder(
builder: (context) {
final theme = context.watch<ThemeProvider>();
BoxDecoration? chatsListDecoration;
if (theme.chatsListBackgroundType == ChatsListBackgroundType.gradient) {
chatsListDecoration = BoxDecoration(
gradient: LinearGradient(
colors: [
theme.chatsListGradientColor1,
theme.chatsListGradientColor2,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
);
} else if (theme.chatsListBackgroundType == ChatsListBackgroundType.image &&
theme.chatsListImagePath != null &&
theme.chatsListImagePath!.isNotEmpty) {
chatsListDecoration = BoxDecoration(
image: DecorationImage(
image: FileImage(File(theme.chatsListImagePath!)),
fit: BoxFit.cover,
),
);
}
return Scaffold(
appBar: _buildAppBar(context),
drawer: _buildAppDrawer(context),
body: chatsListDecoration != null
? Container(
decoration: chatsListDecoration,
child: Row(children: [Expanded(child: bodyContent)]),
)
: Row(children: [Expanded(child: bodyContent)]),
body: Row(children: [Expanded(child: bodyContent)]),
floatingActionButton: FloatingActionButton(
onPressed: () {
_showAddMenu(context);
@@ -2078,30 +2048,7 @@ class _ChatsScreenState extends State<ChatsScreen>
right: 16.0,
bottom: 16.0,
),
decoration: () {
if (themeProvider.drawerBackgroundType == DrawerBackgroundType.gradient) {
return BoxDecoration(
gradient: LinearGradient(
colors: [
themeProvider.drawerGradientColor1,
themeProvider.drawerGradientColor2,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
);
} else if (themeProvider.drawerBackgroundType == DrawerBackgroundType.image &&
themeProvider.drawerImagePath != null &&
themeProvider.drawerImagePath!.isNotEmpty) {
return BoxDecoration(
image: DecorationImage(
image: FileImage(File(themeProvider.drawerImagePath!)),
fit: BoxFit.cover,
),
);
}
return BoxDecoration(color: colors.primaryContainer);
}(),
decoration: BoxDecoration(color: colors.primaryContainer),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -2326,32 +2273,18 @@ class _ChatsScreenState extends State<ChatsScreen>
);
}).toList(),
Container(
decoration: themeProvider.useGradientForAddAccountButton
? BoxDecoration(
gradient: LinearGradient(
colors: [
themeProvider.addAccountButtonGradientColor1,
themeProvider.addAccountButtonGradientColor2,
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
)
: null,
child: ListTile(
leading: const Icon(Icons.add_circle_outline),
title: const Text('Добавить аккаунт'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const PhoneEntryScreen(),
),
);
},
),
ListTile(
leading: const Icon(Icons.add_circle_outline),
title: const Text('Добавить аккаунт'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const PhoneEntryScreen(),
),
);
},
),
],
)
@@ -2363,90 +2296,89 @@ class _ChatsScreenState extends State<ChatsScreen>
},
),
Expanded(
child: () {
final menuColumn = Column(
children: [
_buildAccountsSection(context, colors),
ListTile(
leading: const Icon(Icons.person_outline),
title: const Text('Мой профиль'),
onTap: () {
Navigator.pop(context);
_navigateToProfileEdit();
},
),
ListTile(
leading: const Icon(Icons.call_outlined),
title: const Text('Звонки'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const CallsScreen(),
),
);
},
),
ListTile(
leading: const Icon(Icons.music_note),
title: const Text('Музыка'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const MusicLibraryScreen(),
),
);
},
),
ListTile(
leading: _isReconnecting
? SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
colors.primary,
),
child: Column(
children: [
_buildAccountsSection(context, colors),
ListTile(
leading: const Icon(Icons.person_outline),
title: const Text('Мой профиль'),
onTap: () {
Navigator.pop(context); // Закрыть Drawer
_navigateToProfileEdit(); // Этот метод у вас уже есть
},
),
ListTile(
leading: const Icon(Icons.call_outlined),
title: const Text('Звонки'),
onTap: () {
Navigator.pop(context); // Закрыть Drawer
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const CallsScreen(),
),
);
},
),
ListTile(
leading: const Icon(Icons.music_note),
title: const Text('Музыка'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const MusicLibraryScreen(),
),
);
},
),
ListTile(
leading: _isReconnecting
? SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
colors.primary,
),
)
: const Icon(Icons.refresh),
title: const Text('Переподключиться'),
enabled: !_isReconnecting,
onTap: () async {
if (_isReconnecting) return;
),
)
: const Icon(Icons.refresh),
title: const Text('Переподключиться'),
enabled: !_isReconnecting,
onTap: () async {
if (_isReconnecting) return;
setState(() {
_isReconnecting = true;
});
setState(() {
_isReconnecting = true;
});
try {
await ApiService.instance.performFullReconnection();
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text(
'Переподключение выполнено успешно',
),
backgroundColor: colors.primaryContainer,
duration: const Duration(seconds: 2),
try {
await ApiService.instance.performFullReconnection();
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text(
'Переподключение выполнено успешно',
),
);
Navigator.pop(context);
}
} catch (e) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Ошибка переподключения: $e'),
backgroundColor: colors.error,
duration: const Duration(seconds: 3),
),
);
}
} finally {
if (mounted) {
backgroundColor: colors.primaryContainer,
duration: const Duration(seconds: 2),
),
);
Navigator.pop(context);
}
} catch (e) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Ошибка переподключения: $e'),
backgroundColor: colors.error,
duration: const Duration(seconds: 3),
),
);
}
} finally {
if (mounted) {
setState(() {
_isReconnecting = false;
});
@@ -2496,49 +2428,21 @@ class _ChatsScreenState extends State<ChatsScreen>
}
},
),
const Spacer(),
const Divider(height: 1, indent: 16, endIndent: 16),
ListTile(
leading: Icon(Icons.logout, color: colors.error),
title: Text('Выйти', style: TextStyle(color: colors.error)),
onTap: () {
Navigator.pop(context);
Navigator.pop(context); // Закрыть Drawer
_showLogoutDialog();
},
),
const SizedBox(height: 8),
const SizedBox(height: 8), // Небольшой отступ снизу
],
);
if (themeProvider.drawerBackgroundType == DrawerBackgroundType.gradient) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
themeProvider.drawerGradientColor2,
themeProvider.drawerGradientColor1,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: menuColumn,
);
} else if (themeProvider.drawerBackgroundType == DrawerBackgroundType.image &&
themeProvider.drawerImagePath != null &&
themeProvider.drawerImagePath!.isNotEmpty) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: FileImage(File(themeProvider.drawerImagePath!)),
fit: BoxFit.cover,
),
),
child: menuColumn,
);
}
return menuColumn;
}(),
),
),
],
),
@@ -3131,46 +3035,14 @@ class _ChatsScreenState extends State<ChatsScreen>
),
];
final themeProvider = context.watch<ThemeProvider>();
BoxDecoration? folderTabsDecoration;
if (themeProvider.folderTabsBackgroundType == FolderTabsBackgroundType.gradient) {
folderTabsDecoration = BoxDecoration(
gradient: LinearGradient(
colors: [
themeProvider.folderTabsGradientColor1,
themeProvider.folderTabsGradientColor2,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
border: Border(
bottom: BorderSide(color: colors.outline.withOpacity(0.2), width: 1),
),
);
} else if (themeProvider.folderTabsBackgroundType == FolderTabsBackgroundType.image &&
themeProvider.folderTabsImagePath != null &&
themeProvider.folderTabsImagePath!.isNotEmpty) {
folderTabsDecoration = BoxDecoration(
image: DecorationImage(
image: FileImage(File(themeProvider.folderTabsImagePath!)),
fit: BoxFit.cover,
),
border: Border(
bottom: BorderSide(color: colors.outline.withOpacity(0.2), width: 1),
),
);
}
return Container(
height: 48,
decoration: folderTabsDecoration ??
BoxDecoration(
color: colors.surface,
border: Border(
bottom: BorderSide(color: colors.outline.withOpacity(0.2), width: 1),
),
),
decoration: BoxDecoration(
color: colors.surface,
border: Border(
bottom: BorderSide(color: colors.outline.withOpacity(0.2), width: 1),
),
),
child: Stack(
children: [
Row(
@@ -3879,36 +3751,9 @@ class _ChatsScreenState extends State<ChatsScreen>
AppBar _buildAppBar(BuildContext context) {
final colors = Theme.of(context).colorScheme;
final themeProvider = context.watch<ThemeProvider>();
BoxDecoration? appBarDecoration;
if (themeProvider.appBarBackgroundType == AppBarBackgroundType.gradient) {
appBarDecoration = BoxDecoration(
gradient: LinearGradient(
colors: [
themeProvider.appBarGradientColor1,
themeProvider.appBarGradientColor2,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
);
} else if (themeProvider.appBarBackgroundType == AppBarBackgroundType.image &&
themeProvider.appBarImagePath != null &&
themeProvider.appBarImagePath!.isNotEmpty) {
appBarDecoration = BoxDecoration(
image: DecorationImage(
image: FileImage(File(themeProvider.appBarImagePath!)),
fit: BoxFit.cover,
),
);
}
return AppBar(
titleSpacing: 4.0,
flexibleSpace: appBarDecoration != null
? Container(decoration: appBarDecoration)
: null,
leading: _isSearchExpanded
? IconButton(

View File

@@ -6,7 +6,6 @@ import 'package:gwid/screens/settings/settings_screen.dart';
import 'package:gwid/screens/phone_entry_screen.dart';
import 'package:provider/provider.dart';
import 'package:gwid/utils/theme_provider.dart';
import 'package:gwid/api/api_service.dart';
class ProfileMenuDialog extends StatefulWidget {
final Profile? myProfile;
@@ -196,26 +195,12 @@ class _ProfileMenuDialogState extends State<ProfileMenuDialog> {
onTap: () async {
if (context.mounted) {
Navigator.of(context).pop();
try {
await ApiService.instance.logout();
if (context.mounted) {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (_) => const PhoneEntryScreen(),
),
(route) => false,
);
}
} catch (e) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Ошибка при выходе: $e'),
backgroundColor: Theme.of(context).colorScheme.error,
),
);
}
}
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (_) => const PhoneEntryScreen(),
),
(route) => false,
);
}
},
),

View File

@@ -242,6 +242,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
title: const Text("Выбрать видео"),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final result = await FilePicker.platform.pickFiles(
type: FileType.video,
);
@@ -277,7 +278,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
// Предпросмотр баблов
const _MessageBubblesPreview(),
const SizedBox(height: 16),
// Прозрачность (сворачиваемый, по умолчанию свернут)
_ExpandableSection(
title: "Прозрачность",
@@ -291,8 +292,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
max: 1.0,
divisions: 18,
onChanged: (value) => theme.setMessageTextOpacity(value),
displayValue:
"${(theme.messageTextOpacity * 100).round()}%",
displayValue: "${(theme.messageTextOpacity * 100).round()}%",
),
_SliderTile(
icon: Icons.blur_circular,
@@ -301,8 +301,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
min: 0.0,
max: 0.5,
divisions: 10,
onChanged: (value) =>
theme.setMessageShadowIntensity(value),
onChanged: (value) => theme.setMessageShadowIntensity(value),
displayValue:
"${(theme.messageShadowIntensity * 100).round()}%",
),
@@ -314,8 +313,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
max: 1.0,
divisions: 18,
onChanged: (value) => theme.setMessageMenuOpacity(value),
displayValue:
"${(theme.messageMenuOpacity * 100).round()}%",
displayValue: "${(theme.messageMenuOpacity * 100).round()}%",
),
_SliderTile(
icon: Icons.blur_on,
@@ -342,7 +340,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
],
),
const SizedBox(height: 8),
// Вид (сворачиваемый)
_ExpandableSection(
title: "Вид",
@@ -370,8 +368,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
value: theme.messageBubbleType,
underline: const SizedBox.shrink(),
onChanged: (value) {
if (value != null)
theme.setMessageBubbleType(value);
if (value != null) theme.setMessageBubbleType(value);
},
items: MessageBubbleType.values.map((type) {
return DropdownMenuItem(
@@ -393,8 +390,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
opacity: isSystemTheme ? 0.5 : 1.0,
child: GestureDetector(
onTap: () async {
final initial =
myBubbleColorToShow ?? myBubbleFallback;
final initial = myBubbleColorToShow ?? myBubbleFallback;
_showColorPicker(
context,
initialColor: initial,
@@ -429,16 +425,14 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
_showColorPicker(
context,
initialColor: initial,
onColorChanged: (color) =>
theirBubbleSetter(color),
onColorChanged: (color) => theirBubbleSetter(color),
);
},
child: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
color:
theirBubbleColorToShow ?? theirBubbleFallback,
color: theirBubbleColorToShow ?? theirBubbleFallback,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey),
),
@@ -463,8 +457,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
title: "Цвет панели ответа",
subtitle: "Фиксированный цвет",
color: theme.customReplyColor ?? Colors.blue,
onColorChanged: (color) =>
theme.setCustomReplyColor(color),
onColorChanged: (color) => theme.setCustomReplyColor(color),
),
],
],
@@ -478,7 +471,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
// Предпросмотр всплывающего окна
_DialogPreview(),
const SizedBox(height: 16),
// Развернуть настройки
_ExpandableSection(
title: "Настройки",
@@ -492,8 +485,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
max: 1.0,
divisions: 20,
onChanged: (value) => theme.setProfileDialogOpacity(value),
displayValue:
"${(theme.profileDialogOpacity * 100).round()}%",
displayValue: "${(theme.profileDialogOpacity * 100).round()}%",
),
_SliderTile(
icon: Icons.blur_on,
@@ -525,330 +517,13 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
],
),
const SizedBox(height: 24),
_ExpandableSection(
title: "Кастомизация+",
initiallyExpanded: false,
children: [
_CustomSettingTile(
icon: Icons.format_color_fill,
title: "Фон списка чатов",
subtitle: "Выберите тип фона для списка чатов",
child: DropdownButton<ChatsListBackgroundType>(
value: theme.chatsListBackgroundType,
underline: const SizedBox.shrink(),
onChanged: (value) {
if (value != null) theme.setChatsListBackgroundType(value);
},
items: ChatsListBackgroundType.values.map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.chatsListBackgroundType ==
ChatsListBackgroundType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Начальный цвет градиента",
color: theme.chatsListGradientColor1,
onColorChanged: (color) =>
theme.setChatsListGradientColor1(color),
),
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Конечный цвет градиента",
color: theme.chatsListGradientColor2,
onColorChanged: (color) =>
theme.setChatsListGradientColor2(color),
),
],
if (theme.chatsListBackgroundType ==
ChatsListBackgroundType.image) ...[
const Divider(height: 24),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.photo_library_outlined),
title: const Text("Выбрать изображение"),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final picker = ImagePicker();
final image = await picker.pickImage(
source: ImageSource.gallery,
);
if (image != null) {
theme.setChatsListImagePath(image.path);
}
},
),
if (theme.chatsListImagePath?.isNotEmpty == true) ...[
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(
Icons.delete_outline,
color: Colors.redAccent,
),
title: const Text(
"Удалить изображение",
style: TextStyle(color: Colors.redAccent),
),
onTap: () => theme.setChatsListImagePath(null),
),
],
],
const Divider(height: 24),
_CustomSettingTile(
icon: Icons.view_sidebar,
title: "Фон боковой панели",
subtitle: "Выберите тип фона для боковой панели",
child: DropdownButton<DrawerBackgroundType>(
value: theme.drawerBackgroundType,
underline: const SizedBox.shrink(),
onChanged: (value) {
if (value != null) theme.setDrawerBackgroundType(value);
},
items: DrawerBackgroundType.values.map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.drawerBackgroundType ==
DrawerBackgroundType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Начальный цвет градиента",
color: theme.drawerGradientColor1,
onColorChanged: (color) =>
theme.setDrawerGradientColor1(color),
),
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Конечный цвет градиента",
color: theme.drawerGradientColor2,
onColorChanged: (color) =>
theme.setDrawerGradientColor2(color),
),
],
if (theme.drawerBackgroundType == DrawerBackgroundType.image) ...[
const Divider(height: 24),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.photo_library_outlined),
title: const Text("Выбрать изображение"),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final picker = ImagePicker();
final image = await picker.pickImage(
source: ImageSource.gallery,
);
if (image != null) {
theme.setDrawerImagePath(image.path);
}
},
),
if (theme.drawerImagePath?.isNotEmpty == true) ...[
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(
Icons.delete_outline,
color: Colors.redAccent,
),
title: const Text(
"Удалить изображение",
style: TextStyle(color: Colors.redAccent),
),
onTap: () => theme.setDrawerImagePath(null),
),
],
],
const Divider(height: 24),
_CustomSettingTile(
icon: Icons.person_add,
title: "Градиент для кнопки добавления аккаунта",
subtitle: "Применить градиент к кнопке в drawer",
child: Switch(
value: theme.useGradientForAddAccountButton,
onChanged: (value) =>
theme.setUseGradientForAddAccountButton(value),
),
),
if (theme.useGradientForAddAccountButton) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Начальный цвет градиента",
color: theme.addAccountButtonGradientColor1,
onColorChanged: (color) =>
theme.setAddAccountButtonGradientColor1(color),
),
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Конечный цвет градиента",
color: theme.addAccountButtonGradientColor2,
onColorChanged: (color) =>
theme.setAddAccountButtonGradientColor2(color),
),
],
const Divider(height: 24),
_CustomSettingTile(
icon: Icons.view_headline,
title: "Фон верхней панели",
subtitle: "Выберите тип фона для AppBar (поиск, Сферум и т.д.)",
child: DropdownButton<AppBarBackgroundType>(
value: theme.appBarBackgroundType,
underline: const SizedBox.shrink(),
onChanged: (value) {
if (value != null) theme.setAppBarBackgroundType(value);
},
items: AppBarBackgroundType.values.map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.appBarBackgroundType ==
AppBarBackgroundType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Начальный цвет градиента",
color: theme.appBarGradientColor1,
onColorChanged: (color) =>
theme.setAppBarGradientColor1(color),
),
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Конечный цвет градиента",
color: theme.appBarGradientColor2,
onColorChanged: (color) =>
theme.setAppBarGradientColor2(color),
),
],
if (theme.appBarBackgroundType == AppBarBackgroundType.image) ...[
const Divider(height: 24),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.photo_library_outlined),
title: const Text("Выбрать изображение"),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final picker = ImagePicker();
final image = await picker.pickImage(
source: ImageSource.gallery,
);
if (image != null) {
theme.setAppBarImagePath(image.path);
}
},
),
if (theme.appBarImagePath?.isNotEmpty == true) ...[
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(
Icons.delete_outline,
color: Colors.redAccent,
),
title: const Text(
"Удалить изображение",
style: TextStyle(color: Colors.redAccent),
),
onTap: () => theme.setAppBarImagePath(null),
),
],
],
const Divider(height: 24),
_CustomSettingTile(
icon: Icons.folder,
title: "Фон панели папок",
subtitle: "Выберите тип фона для панели с именами папок",
child: DropdownButton<FolderTabsBackgroundType>(
value: theme.folderTabsBackgroundType,
underline: const SizedBox.shrink(),
onChanged: (value) {
if (value != null) theme.setFolderTabsBackgroundType(value);
},
items: FolderTabsBackgroundType.values.map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.folderTabsBackgroundType ==
FolderTabsBackgroundType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Начальный цвет градиента",
color: theme.folderTabsGradientColor1,
onColorChanged: (color) =>
theme.setFolderTabsGradientColor1(color),
),
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Конечный цвет градиента",
color: theme.folderTabsGradientColor2,
onColorChanged: (color) =>
theme.setFolderTabsGradientColor2(color),
),
],
if (theme.folderTabsBackgroundType ==
FolderTabsBackgroundType.image) ...[
const Divider(height: 24),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.photo_library_outlined),
title: const Text("Выбрать изображение"),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final picker = ImagePicker();
final image = await picker.pickImage(
source: ImageSource.gallery,
);
if (image != null) {
theme.setFolderTabsImagePath(image.path);
}
},
),
if (theme.folderTabsImagePath?.isNotEmpty == true) ...[
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(
Icons.delete_outline,
color: Colors.redAccent,
),
title: const Text(
"Удалить изображение",
style: TextStyle(color: Colors.redAccent),
),
onTap: () => theme.setFolderTabsImagePath(null),
),
],
],
],
),
const SizedBox(height: 24),
_ModernSection(
title: "Панели чата",
children: [
// Предпросмотр панелей
_PanelsPreview(),
const SizedBox(height: 16),
// Галочка включения эффекта стекла
_CustomSettingTile(
icon: Icons.tune,
@@ -860,7 +535,7 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
),
),
const SizedBox(height: 8),
// Развернуть настройки
_ExpandableSection(
title: "Настройки",
@@ -1713,6 +1388,7 @@ class _ChatWallpaperPreview extends StatelessWidget {
);
}
case ChatWallpaperType.video:
if (Platform.isWindows) {
return Container(
color: isDarkTheme ? Colors.grey[850] : Colors.grey[200],
@@ -1896,10 +1572,7 @@ class _ExpandableSectionState extends State<_ExpandableSection> {
onTap: () => setState(() => _isExpanded = !_isExpanded),
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 12.0,
horizontal: 4.0,
),
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 4.0),
child: Row(
children: [
Text(
@@ -1918,7 +1591,10 @@ class _ExpandableSectionState extends State<_ExpandableSection> {
),
),
),
if (_isExpanded) ...[const SizedBox(height: 8), ...widget.children],
if (_isExpanded) ...[
const SizedBox(height: 8),
...widget.children,
],
],
);
}
@@ -1970,7 +1646,10 @@ class _MessageBubblesPreview extends StatelessWidget {
children: [
const Spacer(),
Expanded(
child: ChatMessageBubble(message: mockMyMessage, isMe: true),
child: ChatMessageBubble(
message: mockMyMessage,
isMe: true,
),
),
],
),
@@ -2029,10 +1708,16 @@ class _DialogPreview extends StatelessWidget {
decoration: BoxDecoration(
color: colors.surface.withOpacity(theme.profileDialogOpacity),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: colors.outline.withOpacity(0.2)),
border: Border.all(
color: colors.outline.withOpacity(0.2),
),
),
child: Center(
child: Icon(Icons.person, color: colors.onSurface, size: 32),
child: Icon(
Icons.person,
color: colors.onSurface,
size: 32,
),
),
),
),
@@ -2146,9 +1831,7 @@ class _PanelsPreview extends StatelessWidget {
),
child: Container(
height: 30,
color: colors.surface.withOpacity(
theme.bottomBarOpacity,
),
color: colors.surface.withOpacity(theme.bottomBarOpacity),
child: Row(
children: [
const SizedBox(width: 12),