🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / FLUTTER / dynamic height grid view gridview veya listview de son satırda boşluk oluşturma Floating action button için boşluk bırakma bir satır fazla bırakma margin bottom

1-) FLUTTER - dynamic height grid view gridview veya listview de son satırda boşluk oluşturma Floating action button için boşluk bırakma bir satır fazla bırakma margin bottom

 

 

https://pub.dev/packages/dynamic_height_grid_view/install

flutter pub add dynamic_height_grid_view

 

 


child: DynamicHeightGridView(
        itemCount: getUrunListFilter.length,
        crossAxisCount: dizayncount,
        crossAxisSpacing:
0,
        mainAxisSpacing:
0,
        builder: (BuildContext contex,
int index) {
    GetUrun
urun = getUrunListFilter[index];

    
if(index == getUrunListFilter.length-1){ // son satıra boşluk atar floatingactionbuttonu kurtarır
        
return Column(
                
children: [
                        itemContent(
urun),
                        SizedBox(
height: 70,)
                ],
        );
    }
    
return itemContent(urun);
},

 

 

Widget itemContent( Model urun){
  
return Card(
    shape:
RoundedRectangleBorder(
        borderRadius:
BorderRadius.circular(10)),
    elevation:
12,
    child:
ListTile(
      leading:
Icon(Icons.add),
      title:
Text(urun.depAd!),
      subtitle:
Text(urun.sikayet!),
      trailing:
Icon(Icons.real_estate_agent),
    ),
  );
}

 

 

 

sonuna boşluk koyma 1. yol

 

DynamicHeightGridView(
  
itemCount: models.length + 1, // Add one extra item for the padding
  
crossAxisCount: 1,
  
crossAxisSpacing: 0,
  
mainAxisSpacing: 0,
  
builder: (BuildContext context, int index) {
    
if (index == models.length) {
      
// This is the extra item, used to create the padding at the end
      
return SizedBox(height: 70);
    }
    
var urun = models[index];
    
return ilanContent(urun);
  },
)

 

 

 2024 Temmuz 24 Çarşamba
 580