fix profile

This commit is contained in:
2026-08-18 15:09:53 +03:00
parent 80a95ece5b
commit 6513a004d9
16 changed files with 268 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ import '../../core/app_colors.dart';
import '../../domain/entities/user_profile.dart';
import '../components/custom_app_bar.dart';
import '../components/gradient_button.dart';
import '../components/dialog/delete_account_dialog.dart';
import '../viewmodel/profile_bloc.dart';
import 'edit_profile_screen.dart';
@@ -43,7 +44,19 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
Future<void> _openEditProfile(UserProfile profile) async {
context.go("/home/profile/edit");
context.go("/home/profile/edit");
}
Future<void> _confirmDeleteAccount(BuildContext context) async {
final confirmed = await showDialog<bool>(
context: context,
barrierColor: Colors.black.withOpacity(0.6),
builder: (dialogContext) => const DeleteAccountDialog(),
);
if (confirmed == true && context.mounted) {
context.read<ProfileBloc>().add(DeleteProfilePressed());
}
}
@override
@@ -136,12 +149,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
onEditTap: () => context.go("/home/profile/edit"),
),
// const SizedBox(height: 24),
// _SettingsBlock(
// notificationsEnabled: notificationsEnabled,
// onNotificationsChanged: (v) =>
// setState(() => notificationsEnabled = v),
// ),
Padding(
padding: const EdgeInsets.all(20),
child: GradientButton(
text: 'Удалить учётную запись',
onTap: () => _confirmDeleteAccount(context),
showArrows: true,
height: 56,
width: double.infinity,
fontSize: 16,
),
),
],
),
),
@@ -370,4 +388,4 @@ class _SettingsBlock extends StatelessWidget {
),
);
}
}
}