Reapply "починил выход, наконец-то. Сделал недо жесты, добавил эксперементалбные функции замены цвета у боковой панели и списка чатов, добавил настройку отступа сообщений на андроедах а то может у кого то ломаться"

This reverts commit c0834eaa39.
This commit is contained in:
jganenok
2025-12-05 16:20:35 +07:00
parent c0834eaa39
commit ceeab44b7b
4 changed files with 1334 additions and 589 deletions

View File

@@ -535,6 +535,37 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
),
),
const SizedBox(height: 8),
_ExpandableSection(
title: "Отступ внизу чата",
initiallyExpanded: false,
children: [
_SliderTile(
icon: Icons.vertical_align_bottom,
label: "Доп. отступ снизу (мобилы)",
value: theme.mobileChatBottomPadding,
min: 60,
max: 240,
divisions: 18,
onChanged: (value) =>
theme.setMobileChatBottomPadding(value),
displayValue:
"${theme.mobileChatBottomPadding.toStringAsFixed(0)} px",
),
const SizedBox(height: 8),
_CustomSettingTile(
icon: Icons.keyboard,
title: "Убирать отступ при открытой клавиатуре",
subtitle:
"Только Android. Когда вводите текст — отступ снизу не добавляется",
child: Switch(
value: theme.ignoreMobileBottomPaddingWhenKeyboard,
onChanged: (value) => theme
.setIgnoreMobileBottomPaddingWhenKeyboard(value),
),
),
],
),
// Развернуть настройки
_ExpandableSection(
@@ -582,6 +613,296 @@ class _CustomizationScreenState extends State<CustomizationScreen> {
),
],
),
const SizedBox(height: 24),
_ModernSection(
title: "Экспериментальные настройки фона",
children: [
Container(
padding: const EdgeInsets.all(12),
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: colors.errorContainer.withOpacity(0.3),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: colors.error.withOpacity(0.5),
width: 1,
),
),
child: Row(
children: [
Icon(Icons.science, color: colors.error, size: 20),
const SizedBox(width: 8),
Expanded(
child: Text(
"Экспериментальные функции. Могут работать нестабильно.",
style: TextStyle(
fontSize: 12,
color: colors.onErrorContainer,
),
),
),
],
),
),
_ExpandableSection(
title: "Фон списка чатов",
initiallyExpanded: false,
children: [
_CustomSettingTile(
icon: Icons.science,
title: "Использовать экспериментальный фон",
subtitle: "Фон для экрана со списком чатов",
child: Switch(
value: theme.useExperimentalChatsListBackground,
onChanged: (value) =>
theme.setUseExperimentalChatsListBackground(value),
),
),
if (theme.useExperimentalChatsListBackground) ...[
const Divider(height: 24),
_CustomSettingTile(
icon: Icons.image,
title: "Тип фона",
child: DropdownButton<ChatWallpaperType>(
value: theme.experimentalChatsListBackgroundType,
onChanged: (value) {
if (value != null) {
theme.setExperimentalChatsListBackgroundType(value);
}
},
items: [
ChatWallpaperType.solid,
ChatWallpaperType.gradient,
ChatWallpaperType.image,
].map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.experimentalChatsListBackgroundType ==
ChatWallpaperType.solid ||
theme.experimentalChatsListBackgroundType ==
ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Основной цвет",
color: theme.experimentalChatsListBackgroundColor1,
onColorChanged: (color) =>
theme.setExperimentalChatsListBackgroundColor1(color),
),
],
if (theme.experimentalChatsListBackgroundType ==
ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Дополнительный цвет для градиента",
color: theme.experimentalChatsListBackgroundColor2,
onColorChanged: (color) =>
theme.setExperimentalChatsListBackgroundColor2(color),
),
],
if (theme.experimentalChatsListBackgroundType ==
ChatWallpaperType.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.setExperimentalChatsListBackgroundImagePath(
image.path,
);
}
},
),
if (theme.experimentalChatsListBackgroundImagePath
?.isNotEmpty ==
true) ...[
const SizedBox(height: 8),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.delete_outline),
title: const Text("Удалить изображение"),
onTap: () {
theme.setExperimentalChatsListBackgroundImagePath(null);
},
),
],
],
],
],
),
const SizedBox(height: 16),
_ExpandableSection(
title: "Фон боковой панели - верхняя часть (профиль)",
initiallyExpanded: false,
children: [
_CustomSettingTile(
icon: Icons.image,
title: "Тип фона",
child: DropdownButton<ChatWallpaperType>(
value: theme.drawerTopBackgroundType,
onChanged: (value) {
if (value != null) {
theme.setDrawerTopBackgroundType(value);
}
},
items: [
ChatWallpaperType.solid,
ChatWallpaperType.gradient,
ChatWallpaperType.image,
].map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.drawerTopBackgroundType == ChatWallpaperType.solid ||
theme.drawerTopBackgroundType == ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Основной цвет",
color: theme.drawerTopBackgroundColor1,
onColorChanged: (color) =>
theme.setDrawerTopBackgroundColor1(color),
),
],
if (theme.drawerTopBackgroundType == ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Дополнительный цвет для градиента",
color: theme.drawerTopBackgroundColor2,
onColorChanged: (color) =>
theme.setDrawerTopBackgroundColor2(color),
),
],
if (theme.drawerTopBackgroundType == ChatWallpaperType.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.setDrawerTopBackgroundImagePath(image.path);
}
},
),
if (theme.drawerTopBackgroundImagePath?.isNotEmpty == true) ...[
const SizedBox(height: 8),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.delete_outline),
title: const Text("Удалить изображение"),
onTap: () {
theme.setDrawerTopBackgroundImagePath(null);
},
),
],
],
],
),
const SizedBox(height: 16),
_ExpandableSection(
title: "Фон боковой панели - нижняя часть (меню)",
initiallyExpanded: false,
children: [
_CustomSettingTile(
icon: Icons.image,
title: "Тип фона",
child: DropdownButton<ChatWallpaperType>(
value: theme.drawerBottomBackgroundType,
onChanged: (value) {
if (value != null) {
theme.setDrawerBottomBackgroundType(value);
}
},
items: [
ChatWallpaperType.solid,
ChatWallpaperType.gradient,
ChatWallpaperType.image,
].map((type) {
return DropdownMenuItem(
value: type,
child: Text(type.displayName),
);
}).toList(),
),
),
if (theme.drawerBottomBackgroundType == ChatWallpaperType.solid ||
theme.drawerBottomBackgroundType == ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 1",
subtitle: "Основной цвет",
color: theme.drawerBottomBackgroundColor1,
onColorChanged: (color) =>
theme.setDrawerBottomBackgroundColor1(color),
),
],
if (theme.drawerBottomBackgroundType == ChatWallpaperType.gradient) ...[
const SizedBox(height: 16),
_ColorPickerTile(
title: "Цвет 2",
subtitle: "Дополнительный цвет для градиента",
color: theme.drawerBottomBackgroundColor2,
onColorChanged: (color) =>
theme.setDrawerBottomBackgroundColor2(color),
),
],
if (theme.drawerBottomBackgroundType == ChatWallpaperType.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.setDrawerBottomBackgroundImagePath(image.path);
}
},
),
if (theme.drawerBottomBackgroundImagePath?.isNotEmpty == true) ...[
const SizedBox(height: 8),
ListTile(
contentPadding: EdgeInsets.zero,
leading: const Icon(Icons.delete_outline),
title: const Text("Удалить изображение"),
onTap: () {
theme.setDrawerBottomBackgroundImagePath(null);
},
),
],
],
],
),
],
),
],
),
);