Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fab transparency and exit fade #1357

Merged
merged 3 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions lib/feed/view/feed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ class _FeedViewState extends State<FeedView> {
@override
Widget build(BuildContext context) {
ThunderBloc thunderBloc = context.watch<ThunderBloc>();
final l10n = AppLocalizations.of(context)!;

bool tabletMode = thunderBloc.state.tabletMode;
bool markPostReadOnScroll = thunderBloc.state.markPostReadOnScroll;
Expand Down Expand Up @@ -490,14 +489,22 @@ class _FeedViewState extends State<FeedView> {
// Widget to host the feed FAB when navigating to new page
AnimatedOpacity(
opacity: thunderBloc.state.isFabOpen ? 1.0 : 0.0,
duration: const Duration(milliseconds: 150),
child: thunderBloc.state.isFabOpen
? ModalBarrier(
color: theme.colorScheme.background.withOpacity(0.95),
curve: Curves.easeInOut,
duration: const Duration(milliseconds: 250),
child: Stack(
children: [
IgnorePointer(
child: Container(
color: theme.colorScheme.background.withOpacity(0.95),
)),
if (thunderBloc.state.isFabOpen)
ModalBarrier(
color: null,
dismissible: true,
onDismiss: () => context.read<ThunderBloc>().add(const OnFabToggle(false)),
)
: null,
),
],
),
),
if (Navigator.of(context).canPop() &&
(state.communityId != null || state.communityName != null || state.userId != null || state.username != null) &&
Expand Down
27 changes: 6 additions & 21 deletions lib/thunder/pages/thunder_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,27 +634,12 @@ class _ThunderState extends State<Thunder> {
onPageChanged: (index) => setState(() => selectedPageIndex = index),
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
Stack(
children: [
FeedPage(
useGlobalFeedBloc: true,
feedType: FeedType.general,
postListingType: thunderBlocState.defaultListingType,
sortType: thunderBlocState.sortTypeForInstance,
scaffoldStateKey: scaffoldStateKey,
),
AnimatedOpacity(
opacity: _isFabOpen ? 1.0 : 0.0,
duration: const Duration(milliseconds: 150),
child: _isFabOpen
? ModalBarrier(
color: theme.colorScheme.background.withOpacity(0.95),
dismissible: true,
onDismiss: () => context.read<ThunderBloc>().add(const OnFabToggle(false)),
)
: null,
),
],
FeedPage(
useGlobalFeedBloc: true,
feedType: FeedType.general,
postListingType: thunderBlocState.defaultListingType,
sortType: thunderBlocState.sortTypeForInstance,
scaffoldStateKey: scaffoldStateKey,
),
const SearchPage(),
const AccountPage(),
Expand Down
Loading