chore: Follow up width

This commit is contained in:
Krille 2023-08-16 07:30:48 +02:00
parent f051fc1851
commit 8ed54497f9
No known key found for this signature in database

View file

@ -194,89 +194,92 @@ class _StoryButtonState extends State<_StoryButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return SizedBox(
onHover: _onHover, width: 82,
borderRadius: BorderRadius.circular(7), child: InkWell(
onTap: widget.onPressed, onHover: _onHover,
onLongPress: widget.onLongPressed, borderRadius: BorderRadius.circular(7),
child: Opacity( onTap: widget.onPressed,
opacity: widget.hasPosts ? 1 : 0.4, onLongPress: widget.onLongPressed,
child: Padding( child: Opacity(
padding: const EdgeInsets.symmetric(horizontal: 4), opacity: widget.hasPosts ? 1 : 0.4,
child: Column( child: Padding(
children: [ padding: const EdgeInsets.symmetric(horizontal: 4),
const SizedBox(height: 8), child: Column(
AnimatedScale( children: [
scale: _hovered ? 1.15 : 1.0, const SizedBox(height: 8),
duration: FluffyThemes.animationDuration, AnimatedScale(
curve: FluffyThemes.animationCurve, scale: _hovered ? 1.15 : 1.0,
child: Material( duration: FluffyThemes.animationDuration,
borderRadius: BorderRadius.circular(Avatar.defaultSize), curve: FluffyThemes.animationCurve,
child: Container( child: Material(
padding: const EdgeInsets.all(3), borderRadius: BorderRadius.circular(Avatar.defaultSize),
decoration: BoxDecoration( child: Container(
gradient: widget.unread padding: const EdgeInsets.all(3),
? const LinearGradient( decoration: BoxDecoration(
colors: [ gradient: widget.unread
Colors.red, ? const LinearGradient(
Colors.purple, colors: [
Colors.orange, Colors.red,
], Colors.purple,
begin: Alignment.topLeft, Colors.orange,
end: Alignment.bottomRight, ],
) begin: Alignment.topLeft,
: null, end: Alignment.bottomRight,
color: widget.unread )
? null : null,
: Theme.of(context).colorScheme.surfaceVariant, color: widget.unread
borderRadius: BorderRadius.circular(Avatar.defaultSize), ? null
), : Theme.of(context).colorScheme.surfaceVariant,
child: Stack( borderRadius: BorderRadius.circular(Avatar.defaultSize),
children: [ ),
Hero( child: Stack(
tag: widget.heroTag, children: [
child: Avatar( Hero(
mxContent: widget.profile.avatarUrl, tag: widget.heroTag,
name: widget.profile.displayName, child: Avatar(
size: 72, mxContent: widget.profile.avatarUrl,
fontSize: 26, name: widget.profile.displayName,
size: 72,
fontSize: 26,
),
), ),
), if (widget.showEditFab)
if (widget.showEditFab) Positioned(
Positioned( right: 0,
right: 0, bottom: 0,
bottom: 0, child: SizedBox(
child: SizedBox( width: 24,
width: 24, height: 24,
height: 24, child: FloatingActionButton.small(
child: FloatingActionButton.small( heroTag: null,
heroTag: null, onPressed: () =>
onPressed: () => context.go('/rooms/stories/create'),
context.go('/rooms/stories/create'), child: const Icon(
child: const Icon( Icons.add_outlined,
Icons.add_outlined, size: 16,
size: 16, ),
), ),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
), Center(
Center( child: Text(
child: Text( widget.profile.displayName ?? '',
widget.profile.displayName ?? '', maxLines: 1,
maxLines: 1, textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, fontWeight: widget.unread ? FontWeight.bold : null,
fontWeight: widget.unread ? FontWeight.bold : null, ),
), ),
), ),
), ],
], ),
), ),
), ),
), ),