···
/// Load feed - business logic is now in FeedProvider
-
final feedProvider = Provider.of<FeedProvider>(context, listen: false);
-
feedProvider.loadFeed(refresh: true);
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
-
final feedProvider = Provider.of<FeedProvider>(context, listen: false);
-
feedProvider.loadMore();
···
required bool isLoadingMore,
required bool isAuthenticated,
-
// Loading state (only show full-screen loader for initial load, not refresh)
if (isLoading && posts.isEmpty) {
child: CircularProgressIndicator(color: Color(0xFFFF6B35)),
-
// Error state (only show full-screen error when no posts loaded yet)
-
// If we have posts but pagination failed, we'll show the error at the bottom
if (error != null && posts.isEmpty) {
···
const SizedBox(height: 24),
-
final feedProvider = Provider.of<FeedProvider>(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFFF6B35),
···
controller: _scrollController,
// Add extra item for loading indicator or pagination error
-
itemCount: posts.length + (isLoadingMore || error != null ? 1 : 0),
itemBuilder: (context, index) {
// Footer: loading indicator or error message
if (index == posts.length) {
···
const SizedBox(height: 12),
-
final feedProvider = Provider.of<FeedProvider>(
-
feedProvider.clearError();
-
feedProvider.loadMore();
style: TextButton.styleFrom(
foregroundColor: const Color(0xFFFF6B35),
···
final post = posts[index];
-
'Feed post in ${post.post.community.name} by ${post.post.author.displayName ?? post.post.author.handle}. ${post.post.title ?? ""}',
child: _PostCard(post: post),
···
-
'Posted by ${post.post.author.displayName ?? post.post.author.handle}',
color: Color(0xFFB6C2D2),
···
Widget build(BuildContext context) {
// Only show image if thumbnail exists
-
if (embed.thumb == null) return const SizedBox.shrink();
decoration: BoxDecoration(
···
-
(context, url) => Container(
color: const Color(0xFF1A1F26),
···
/// Load feed - business logic is now in FeedProvider
+
Provider.of<FeedProvider>(context, listen: false).loadFeed(refresh: true);
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
+
Provider.of<FeedProvider>(context, listen: false).loadMore();
···
required bool isLoadingMore,
required bool isAuthenticated,
+
// Loading state (only show full-screen loader for initial load,
if (isLoading && posts.isEmpty) {
child: CircularProgressIndicator(color: Color(0xFFFF6B35)),
+
// Error state (only show full-screen error when no posts loaded
+
// yet). If we have posts but pagination failed, we'll show the error
if (error != null && posts.isEmpty) {
···
const SizedBox(height: 24),
+
Provider.of<FeedProvider>(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFFF6B35),
···
controller: _scrollController,
// Add extra item for loading indicator or pagination error
+
posts.length + (isLoadingMore || error != null ? 1 : 0),
itemBuilder: (context, index) {
// Footer: loading indicator or error message
if (index == posts.length) {
···
const SizedBox(height: 12),
+
Provider.of<FeedProvider>(
style: TextButton.styleFrom(
foregroundColor: const Color(0xFFFF6B35),
···
final post = posts[index];
+
label: 'Feed post in ${post.post.community.name} by '
+
'${post.post.author.displayName ?? post.post.author.handle}. '
+
'${post.post.title ?? ""}',
child: _PostCard(post: post),
···
+
'Posted by ${post.post.author.displayName ?? ''
+
'${post.post.author.handle}'}',
color: Color(0xFFB6C2D2),
···
Widget build(BuildContext context) {
// Only show image if thumbnail exists
+
if (embed.thumb == null) {
+
return const SizedBox.shrink();
decoration: BoxDecoration(
···
+
placeholder: (context, url) => Container(
color: const Color(0xFF1A1F26),