fix : Différentes erreurs
This commit is contained in:
@@ -18,7 +18,7 @@ class PostCardWidget extends StatefulWidget {
|
||||
final double? aspectRatio; // Nouveau paramètre pour le ratio (largeur/hauteur)
|
||||
|
||||
const PostCardWidget({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.content,
|
||||
required this.authorName,
|
||||
@@ -32,7 +32,7 @@ class PostCardWidget extends StatefulWidget {
|
||||
this.onComment,
|
||||
this.onShare,
|
||||
this.aspectRatio, // null = ratio naturel de l'image, ex: 16/9, 4/3, 1/1
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<PostCardWidget> createState() => _PostCardWidgetState();
|
||||
@@ -129,7 +129,7 @@ class _PostCardWidgetState extends State<PostCardWidget> {
|
||||
builder: (context, snapshot) {
|
||||
final imageHeight = snapshot.data ?? 200.0; // Hauteur par défaut si pas encore calculée
|
||||
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: imageHeight,
|
||||
child: Stack(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user