bottom overflowed by 39px entre chaque cardannonce: parent: Padding( padding:…
- User
bottom overflowed by 39px entre chaque cardannonce:
parent:
Padding( padding: EdgeInsets.only(bottom: 0), // adjust this value to fit your needs child: SingleChildScrollView( child: Container( height: 480 , decoration: BoxDecoration(), child: GridView.builder( padding: EdgeInsets.fromLTRB(10,0,10,0), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, // number of items per row childAspectRatio: 1, mainAxisSpacing: 45 // adjust this value to fit your needs ), itemCount: annonces.length, itemBuilder: (context, index) { Annonce annonce = annonces[index]; return Padding( padding: EdgeInsets.only(right: 12, left:12), // adjust this padding to fit your needs child: CardAnnonce( titre: annonce.titre, imagePath: annonce.imageLink, isSaved: annonce.isSaved, prix: annonce.prix, niveauUrgence: annonce.niveauUrgence, ), ); }, ), ), ), ),
enfant:
import 'dart:ffi';
import 'package:allo/constants/app_colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; // Import your color file
class CardAnnonce extends StatelessWidget { final String titre; final String imagePath; final bool isSaved; final double prix; final int niveauUrgence;
CardAnnonce( {required this.titre, required this.imagePath, required this.isSaved, required this.prix, required this.niveauUrgence});
@override Widget build(BuildContext context) { return Card( color: Colors.transparent, elevation: 0, child: IntrinsicWidth( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Stack( children: [ Container( width: 150, // définir la largeur height: 150, // définir la hauteur decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), // arrondir les bords image: DecorationImage( image: AssetImage(imagePath), fit: BoxFit .cover, // pour s'assurer que l'image couvre tout le rectangle ), ), ), Positioned( right: 10, bottom: 10, child: Container( padding: EdgeInsets.symmetric(horizontal: 15, vertical: 7), decoration: BoxDecoration( color: AppColors.danger, borderRadius: BorderRadius.circular(500000), ), child: Text( 'Urgence: prix \€', style: TextStyle( fontSize: 14, fontFamily: "NeueRegrade", fontWeight: FontWeight.w700 ) ), ], ), ), ], ), ), ); } }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.