0

enter image description here

 /*Grid layout*/

              Container(
                height: 225.h,
                width: double.infinity,
                padding: EdgeInsets.zero,
                child: GridView.builder(
                  scrollDirection: Axis.horizontal,
                  primary: false,
                  shrinkWrap: true,
                  padding: EdgeInsets.only(left: 16.w,top: 8.h,right: 16.w),
                  gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                      crossAxisCount: 2,
                      childAspectRatio: 0.5,
                      mainAxisSpacing: 16.0,
                      crossAxisSpacing: 0.0),
                  itemCount: drConsultationModelList.length,
                  itemBuilder: (context, i) {
                    return Container(
                      width: 210.w,
                      margin: EdgeInsets.only(bottom: 15.h),
                      padding: EdgeInsets.only(left: 16.w,bottom: 10.h,right: 20.h,top: 10.h),
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(12.r),
                        color: Colors.white,
                        boxShadow: [
                          BoxShadow(
                            color:
                            Color(0x14000000),
                            offset: const Offset(
                              0.0,
                              4.0,
                            ),
                            blurRadius: 14.0,
                            spreadRadius: 0.0,
                          ), //BoxShadow
                        ],
                      ),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.start,
                        mainAxisSize: MainAxisSize.max,
                        children: [
                          Expanded(
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text(drConsultationModelList[i].tvTitle,style: TextStyle(fontFamily: fontInterSemibold,fontSize: 15.sp,color: blackes_1a1b25),),
                                SizedBox(height: 6.h,),
                                Text(drConsultationModelList[i].tvSubTitle,style: TextStyle(fontFamily: fontInterRegular,fontSize: 11.sp,color: dark_silver_6a7382),)
                              ],
                            ),
                          ),

                          Stack(
                            alignment: Alignment.center,
                            children: [
                              Container(
                                height: 50.h,width: 50.w,
                                decoration: BoxDecoration(
                                  color: Color(0xffe7f5f0),
                                  borderRadius: BorderRadius.circular(8.r),
                                ),
                              ),
                              SvgPicture.asset(drConsultationModelList[i].imgLogo,width: 34.w,height: 34.h,fit: BoxFit.fill,),
                            ],
                          )
                        ],
                      ),
                    );
                  },
                ),
              ),

I used container fixed height but I am trying to set dynamic height so please give me proper suggestion.

Now the problem is that, to show layout in listview I have to pass fixed height in sizebox. If I remove height then layout will be gone. So, How do I display item layout without giving fixed height in sizebox.

Fixed height problem issued when we increased device default font size. So, cant fixed layout height. Plz give solution, Thanks in advance

0 Answers0