fix functional bugs

This commit is contained in:
2026-05-29 11:40:55 +03:00
parent 591265a7fc
commit 134ffdde60
50 changed files with 1086 additions and 771 deletions

View File

@@ -50,7 +50,9 @@ 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) {
@@ -70,56 +72,82 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
final profile = state.profile!;
return SingleChildScrollView(
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,
), GestureDetector(
onTap: _pickImage,
child: Container(
margin: const EdgeInsets.only(top: 0, right: 0),
child: Image.asset(
'assets/icons/edit.png',
width: 24,
height: 24,
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),
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,
),
),
),
],
),
),
const SizedBox(height: 32),
_ProfileInfoBlock(
profile: profile,
onEditTap: () => context.go("/home/profile/edit"),
),
// const SizedBox(height: 24),
// _SettingsBlock(
// notificationsEnabled: notificationsEnabled,
// onNotificationsChanged: (v) =>
// setState(() => notificationsEnabled = v),
// ),
],
),
],
),
),
const SizedBox(height: 32),
_ProfileInfoBlock(
profile: profile,
onEditTap: () => context.go("/home/profile/edit"),
),
const SizedBox(height: 24),
_SettingsBlock(
notificationsEnabled: notificationsEnabled,
onNotificationsChanged: (v) =>
setState(() => notificationsEnabled = v),
),
const SizedBox(height: 24),
],
),
);
},
);
},
),