♻️ Optimized large screen display post effect
✨ Push notification
This commit is contained in:
@ -30,7 +30,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
final nav = context.watch<NavigationProvider>();
|
||||
|
||||
final backgroundColor = ResponsiveBreakpoints.of(context).largerThan(MOBILE)
|
||||
? Theme.of(context).colorScheme.surface
|
||||
? Colors.transparent
|
||||
: null;
|
||||
|
||||
return ListenableBuilder(
|
||||
@ -57,7 +57,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
).padding(
|
||||
horizontal: 32,
|
||||
top: MediaQuery.of(context).padding.top > 16 ? 8 : 16,
|
||||
bottom: 16,
|
||||
bottom: 8,
|
||||
),
|
||||
...destinations.where((ele) => ele.isPinned).map((ele) {
|
||||
return NavigationDrawerDestination(
|
||||
|
@ -95,12 +95,10 @@ class PostCommentSliverListState extends State<PostCommentSliverList> {
|
||||
onFetchData: _fetchPosts,
|
||||
itemBuilder: (context, idx) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: widget.maxWidth ?? double.infinity,
|
||||
),
|
||||
child: PostItem(data: _posts[idx]),
|
||||
).center(),
|
||||
child: PostItem(
|
||||
data: _posts[idx],
|
||||
maxWidth: widget.maxWidth,
|
||||
),
|
||||
onTap: () {
|
||||
GoRouter.of(context).pushNamed(
|
||||
'postDetail',
|
||||
|
@ -18,12 +18,14 @@ class PostItem extends StatelessWidget {
|
||||
final SnPost data;
|
||||
final bool showReactions;
|
||||
final bool showComments;
|
||||
final double? maxWidth;
|
||||
final Function(SnPost data)? onChanged;
|
||||
const PostItem({
|
||||
super.key,
|
||||
required this.data,
|
||||
this.showReactions = true,
|
||||
this.showComments = true,
|
||||
this.maxWidth,
|
||||
this.onChanged,
|
||||
});
|
||||
|
||||
@ -34,14 +36,23 @@ class PostItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
_PostContentHeader(data: data).padding(horizontal: 12, vertical: 8),
|
||||
_PostContentBody(data: data.body).padding(horizontal: 16, bottom: 6),
|
||||
if (data.repostTo != null)
|
||||
_PostQuoteContent(child: data.repostTo!).padding(
|
||||
horizontal: 12,
|
||||
Container(
|
||||
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
|
||||
child: Column(
|
||||
children: [
|
||||
_PostContentHeader(data: data)
|
||||
.padding(horizontal: 12, vertical: 8),
|
||||
_PostContentBody(data: data.body)
|
||||
.padding(horizontal: 16, bottom: 6),
|
||||
if (data.repostTo != null)
|
||||
_PostQuoteContent(child: data.repostTo!).padding(
|
||||
horizontal: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (data.preload?.attachments?.isNotEmpty ?? true)
|
||||
AttachmentList(
|
||||
data: data.preload!.attachments!,
|
||||
@ -49,12 +60,19 @@ class PostItem extends StatelessWidget {
|
||||
maxHeight: 520,
|
||||
listPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
),
|
||||
_PostBottomAction(
|
||||
data: data,
|
||||
showComments: showComments,
|
||||
showReactions: showReactions,
|
||||
onChanged: _onChanged,
|
||||
).padding(left: 12, right: 18),
|
||||
Container(
|
||||
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
|
||||
child: Column(
|
||||
children: [
|
||||
_PostBottomAction(
|
||||
data: data,
|
||||
showComments: showComments,
|
||||
showReactions: showReactions,
|
||||
onChanged: _onChanged,
|
||||
).padding(left: 12, right: 18),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user