bug fixes
This commit is contained in:
@@ -116,13 +116,19 @@ class _SendPhotoViewState extends State<SendPhotoView> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isUploading = context.select(
|
||||
(SendPhotoBloc bloc) => bloc.state.status == SendPhotoStatus.loading,
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(gradient: AppColors.phoneScreenBg),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(gradient: AppColors.phoneScreenBg),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
@@ -190,7 +196,8 @@ class _SendPhotoViewState extends State<SendPhotoView> {
|
||||
},
|
||||
builder: (context, state) {
|
||||
final photoCount = state.selectedImages.length;
|
||||
final isEnabled = photoCount >= 2;
|
||||
final isEnabled = photoCount >= 2 &&
|
||||
state.status != SendPhotoStatus.loading;
|
||||
|
||||
return GradientButton(
|
||||
text: 'Отправить',
|
||||
@@ -210,9 +217,40 @@ class _SendPhotoViewState extends State<SendPhotoView> {
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Оверлей загрузки: показывается, пока фото отправляются на сервер
|
||||
if (isUploading)
|
||||
Positioned.fill(
|
||||
child: AbsorbPointer(
|
||||
absorbing: true,
|
||||
child: Container(
|
||||
color: Colors.black.withOpacity(0.45),
|
||||
child: const Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xFF8BFFAA),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'Загружаем фото...',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user