import 'package:flutter/material.dart'; class FeedScreen04 extends StatefulWidget { const FeedScreen04({super.key}); @override State createState() => _FeedScreen04State(); } class _FeedScreen04State extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: const Text("Feed"), ), body: LayoutBuilder( builder: (context, constraints) => Center( child: Column( children: [ Expanded( child: MediaQuery.removePadding( context: context, removeTop: true, child: SizedBox( width: (constraints.maxWidth > 412) ? (constraints.maxWidth * 0.5) : constraints.maxWidth, child: ListView.builder( shrinkWrap: true, itemCount: 10, itemBuilder: (context, index) { return const PostItem(); }, ), ), ), ), ], ), ), ), ); } } class PostItem extends StatelessWidget { const PostItem({ super.key, }); @override Widget build(BuildContext context) { return LayoutBuilder( builder: (context, constraints) => Container( padding: const EdgeInsets.only(bottom: 2.0), child: Column( children: [ Stack( children: [ SizedBox( height: constraints.maxWidth * 0.8, // replace image child: Image.asset( 'assets/images/placeholder.png', fit: BoxFit.cover, ), ), Positioned( bottom: 10, child: Container( width: constraints.maxWidth, padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( "Esse laboris consectetur commodo do nulla amet eiusmod elit proident reprehenderit culpa dolor. ", maxLines: 2, style: Theme.of(context).textTheme.bodyLarge, ), ), Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( "By Display Name", style: Theme.of(context).textTheme.bodySmall, ), ), ], ), ), ) ], ), ], ), ), ); } }