diff --git a/lib/screens/account.dart b/lib/screens/account.dart index 7fb55920..b3faa7c4 100644 --- a/lib/screens/account.dart +++ b/lib/screens/account.dart @@ -74,72 +74,111 @@ class AccountScreen extends HookConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (user.value?.profile.background?.id != null) - ClipRRect( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - child: AspectRatio( - aspectRatio: 16 / 7, - child: CloudImageWidget( - file: user.value?.profile.background, - fit: BoxFit.cover, + Stack( + clipBehavior: Clip.none, + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + child: AspectRatio( + aspectRatio: 16 / 7, + child: CloudImageWidget( + file: user.value?.profile.background, + fit: BoxFit.cover, + ), + ), ), - ), + Positioned( + bottom: -24, + left: 16, + child: GestureDetector( + child: ProfilePictureWidget( + file: user.value?.profile.picture, + radius: 32, + ), + onTap: () { + context.pushNamed( + 'accountProfile', + pathParameters: {'name': user.value!.name}, + ); + }, + ), + ), + ], ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - spacing: 16, - children: [ - GestureDetector( - child: ProfilePictureWidget( - file: user.value?.profile.picture, - radius: 24, - ), - onTap: () { - context.pushNamed( - 'accountProfile', - pathParameters: {'name': user.value!.name}, - ); - }, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - spacing: 4, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, + Builder( + builder: (context) { + final hasBackground = + user.value?.profile.background?.id != null; + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + spacing: hasBackground ? 0 : 16, + children: [ + if (!hasBackground) + GestureDetector( + child: ProfilePictureWidget( + file: user.value?.profile.picture, + radius: 24, + ), + onTap: () { + context.pushNamed( + 'accountProfile', + pathParameters: {'name': user.value!.name}, + ); + }, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Flexible( - child: AccountName( - account: user.value!, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, + Row( + spacing: 4, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Flexible( + child: AccountName( + account: user.value!, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), ), - ), + Flexible( + child: Text( + '@${user.value!.name}', + ).fontSize(11).padding(bottom: 2.5), + ), + ], ), - Flexible(child: Text('@${user.value!.name}')), + Text( + (user.value!.profile.bio.isNotEmpty) + ? user.value!.profile.bio + : 'descriptionNone'.tr(), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + const Gap(12), ], ), - Text( - (user.value!.profile.bio.isNotEmpty) - ? user.value!.profile.bio - : 'descriptionNone'.tr(), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ], - ), - ), - ], - ).padding(horizontal: 16, top: 16), - AccountStatusCreationWidget(uname: user.value!.name), + ), + ], + ).padding( + left: 16, + right: 16, + top: 16 + (hasBackground ? 16 : 0), + ); + }, + ), ], ), ).padding(horizontal: 8), + Card( + margin: EdgeInsets.zero, + child: AccountStatusCreationWidget(uname: user.value!.name), + ).padding(horizontal: 12, bottom: 4), LevelingProgressCard( isCompact: true, level: user.value!.profile.level, diff --git a/lib/widgets/account/status.dart b/lib/widgets/account/status.dart index 18917c36..61c571ef 100644 --- a/lib/widgets/account/status.dart +++ b/lib/widgets/account/status.dart @@ -84,21 +84,29 @@ class AccountStatusCreationWidget extends HookConsumerWidget { : Padding( padding: padding ?? - EdgeInsets.symmetric(horizontal: 27, vertical: 4), - child: Row( - spacing: 4, + EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon(Symbols.keyboard_arrow_up), - Expanded( - child: Text('statusCreateHint', maxLines: 1).tr(), + Row( + children: [ + Icon(Symbols.keyboard_arrow_up), + SizedBox(width: 4), + Text('Create Status').tr(), + ], ), + SizedBox(height: 4), + Text( + 'Tap to set your current activity and let others know what you\'re up to', + style: TextStyle(fontSize: 12), + ).tr().opacity(0.75), ], ), ).opacity(0.85), error: (error, _) => Padding( padding: - padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 4), + padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 12), child: Row( spacing: 4, children: [Icon(Symbols.close), Text('Error: $error')], @@ -107,7 +115,7 @@ class AccountStatusCreationWidget extends HookConsumerWidget { loading: () => Padding( padding: - padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 4), + padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 12), child: Row( spacing: 4, children: [Icon(Symbols.more_vert), Text('loading').tr()],