|
|
@ -122,9 +122,7 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
itemCount: stories.length,
|
|
|
|
itemCount: stories.length,
|
|
|
|
itemBuilder: (context, i) {
|
|
|
|
itemBuilder: (context, i) {
|
|
|
|
final room = stories[i];
|
|
|
|
final room = stories[i];
|
|
|
|
return Opacity(
|
|
|
|
return FutureBuilder<Profile>(
|
|
|
|
opacity: room.hasPosts ? 1 : 0.75,
|
|
|
|
|
|
|
|
child: FutureBuilder<Profile>(
|
|
|
|
|
|
|
|
future: room.getCreatorProfile(),
|
|
|
|
future: room.getCreatorProfile(),
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
final userId = room.creatorId;
|
|
|
|
final userId = room.creatorId;
|
|
|
@ -138,6 +136,7 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
avatarUrl: avatarUrl,
|
|
|
|
avatarUrl: avatarUrl,
|
|
|
|
userId: userId ?? 'Unknown',
|
|
|
|
userId: userId ?? 'Unknown',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
hasPosts: room.hasPosts || room == ownStoryRoom,
|
|
|
|
showEditFab: userId == client.userID,
|
|
|
|
showEditFab: userId == client.userID,
|
|
|
|
unread: room.membership == Membership.invite ||
|
|
|
|
unread: room.membership == Membership.invite ||
|
|
|
|
room.hasNewMessages,
|
|
|
|
room.hasNewMessages,
|
|
|
@ -145,8 +144,7 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
onLongPressed: () =>
|
|
|
|
onLongPressed: () =>
|
|
|
|
_contextualActions(context, room),
|
|
|
|
_contextualActions(context, room),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -176,6 +174,7 @@ class _StoryButton extends StatelessWidget {
|
|
|
|
final Profile profile;
|
|
|
|
final Profile profile;
|
|
|
|
final bool showEditFab;
|
|
|
|
final bool showEditFab;
|
|
|
|
final bool unread;
|
|
|
|
final bool unread;
|
|
|
|
|
|
|
|
final bool hasPosts;
|
|
|
|
final void Function() onPressed;
|
|
|
|
final void Function() onPressed;
|
|
|
|
final void Function()? onLongPressed;
|
|
|
|
final void Function()? onLongPressed;
|
|
|
|
|
|
|
|
|
|
|
@ -183,6 +182,7 @@ class _StoryButton extends StatelessWidget {
|
|
|
|
required this.profile,
|
|
|
|
required this.profile,
|
|
|
|
required this.onPressed,
|
|
|
|
required this.onPressed,
|
|
|
|
this.showEditFab = false,
|
|
|
|
this.showEditFab = false,
|
|
|
|
|
|
|
|
this.hasPosts = true,
|
|
|
|
this.unread = false,
|
|
|
|
this.unread = false,
|
|
|
|
this.onLongPressed,
|
|
|
|
this.onLongPressed,
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
@ -196,17 +196,18 @@ class _StoryButton extends StatelessWidget {
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
onTap: onPressed,
|
|
|
|
onTap: onPressed,
|
|
|
|
onLongPress: onLongPressed,
|
|
|
|
onLongPress: onLongPressed,
|
|
|
|
|
|
|
|
child: Opacity(
|
|
|
|
|
|
|
|
opacity: hasPosts ? 1 : 0.4,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
Material(
|
|
|
|
Material(
|
|
|
|
elevation: Theme.of(context).appBarTheme.elevation ?? 7,
|
|
|
|
|
|
|
|
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
|
|
|
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
|
|
|
borderRadius: BorderRadius.circular(Avatar.defaultSize),
|
|
|
|
borderRadius: BorderRadius.circular(Avatar.defaultSize),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(2),
|
|
|
|
padding: const EdgeInsets.all(3),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: unread
|
|
|
|
gradient: unread
|
|
|
|
? const LinearGradient(
|
|
|
|
? const LinearGradient(
|
|
|
@ -226,7 +227,8 @@ class _StoryButton extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Material(
|
|
|
|
Material(
|
|
|
|
color: Theme.of(context).colorScheme.surface,
|
|
|
|
color: Theme.of(context).colorScheme.surface,
|
|
|
|
borderRadius: BorderRadius.circular(Avatar.defaultSize),
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.circular(Avatar.defaultSize),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(2.0),
|
|
|
|
padding: const EdgeInsets.all(2.0),
|
|
|
|
child: CircleAvatar(
|
|
|
|
child: CircleAvatar(
|
|
|
@ -281,6 +283,7 @@ class _StoryButton extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|