bug fixes
This commit is contained in:
@@ -37,7 +37,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
context.read<ProfileBloc>().add(
|
||||
ProfilePhotoUpdated(File(pickedImage.path)),
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
print("Error picking or uploading image: $e");
|
||||
}
|
||||
@@ -63,9 +62,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: AppColors.phoneScreenBg,
|
||||
),
|
||||
decoration: const BoxDecoration(gradient: AppColors.phoneScreenBg),
|
||||
child: SafeArea(
|
||||
child: BlocBuilder<ProfileBloc, ProfileState>(
|
||||
builder: (context, state) {
|
||||
@@ -88,82 +85,91 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: constraints.maxHeight,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
CustomAppBar(title: 'Профиль'),
|
||||
const SizedBox(height: 32),
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: constraints.maxHeight,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
CustomAppBar(title: 'Профиль'),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 60,
|
||||
backgroundColor: AppColors.checkboxFill,
|
||||
backgroundImage:
|
||||
(profile.avatarUrl != null &&
|
||||
profile.avatarUrl!.isNotEmpty)
|
||||
? NetworkImage(
|
||||
"${profile.avatarUrl!}?v=${DateTime.now().minute}",
|
||||
)
|
||||
: null,
|
||||
child:
|
||||
(profile.avatarUrl == null ||
|
||||
profile.avatarUrl!.isEmpty)
|
||||
? Text(
|
||||
profile.name.isNotEmpty
|
||||
? profile.name[0].toUpperCase()
|
||||
: '',
|
||||
style: const TextStyle(
|
||||
fontSize: 50,
|
||||
color: AppColors.darkBlue,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 60,
|
||||
backgroundColor: AppColors.checkboxFill,
|
||||
backgroundImage:
|
||||
(profile.avatarUrl != null &&
|
||||
profile.avatarUrl!.isNotEmpty)
|
||||
? NetworkImage(
|
||||
"${profile.avatarUrl!}?v=${DateTime.now().minute}",
|
||||
)
|
||||
: null,
|
||||
child:
|
||||
(profile.avatarUrl == null ||
|
||||
profile.avatarUrl!.isEmpty)
|
||||
? Text(
|
||||
profile.name.isNotEmpty
|
||||
? profile.name[0]
|
||||
.toUpperCase()
|
||||
: '',
|
||||
style: const TextStyle(
|
||||
fontSize: 50,
|
||||
color: AppColors.darkBlue,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
|
||||
GestureDetector(
|
||||
onTap: _pickImage,
|
||||
child: Container(
|
||||
child: Image.asset(
|
||||
'assets/icons/edit.png',
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: _pickImage,
|
||||
child: Container(
|
||||
child: Image.asset(
|
||||
'assets/icons/edit.png',
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 32),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
_ProfileInfoBlock(
|
||||
profile: profile,
|
||||
onEditTap: () => context.go("/home/profile/edit"),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: GradientButton(
|
||||
text: 'Удалить учётную запись',
|
||||
onTap: () => _confirmDeleteAccount(context),
|
||||
showArrows: true,
|
||||
height: 56,
|
||||
width: double.infinity,
|
||||
fontSize: 16,
|
||||
_ProfileInfoBlock(
|
||||
profile: profile,
|
||||
onEditTap: () =>
|
||||
context.go("/home/profile/edit"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: GradientButton(
|
||||
text: 'Удалить учётную запись',
|
||||
onTap: () => _confirmDeleteAccount(context),
|
||||
showArrows: true,
|
||||
height: 56,
|
||||
width: double.infinity,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -388,4 +394,4 @@ class _SettingsBlock extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user