Flutter : RenderPadding object was given an infinite size during layout

Viewed 14

I was trying to have another widget in my flutter page so I get this error because of RadarChart.light :

════════ Exception caught by rendering library ═════════════════════════════════ RenderPadding object was given an infinite size during layout. The relevant error-causing widget was Padding ════════════════════════════════════════════════════════════════════════════════

how I can solve this problem

Code

SafeArea(
 child: Scaffold(
   body: AppBackground(
    child: SingleChildScrollView(              
     child: Padding(
      padding: const EdgeInsets.symmetric(horizontal: 9.0),
      child: Column(
          // crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const HeadWidget(title: "Computer Science"),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                RadarChart.light(
                  ticks: ticks,
                  features: features,
                  data: data,
                ),
                Text(
                  "PERFORMANCE BY COURSE",
                  style: GoogleFonts.roboto(
                      color: Kwhite, fontWeight: FontWeight.w700),
                ),
                const PerformanceByCourseCard(),
                SizedBox(
                  height: MediaQuery.of(context).size.height / 20,
                ),
                Text(
                  "PERFORMANCE SUMMARY",
                  style: GoogleFonts.roboto(
                      color: KRedOrange, fontWeight: FontWeight.w700),
                ),
                const PerformanceSummaryCards(),
                Text(
                  "PERFORMANCE BY PLO",
                  style: GoogleFonts.roboto(
                      color: KRedOrange, fontWeight: FontWeight.w700),
                ),
                const PerformanceByPLOCard(),
                Text(
                  "PERFORMANCE BY GA",
                  style: GoogleFonts.roboto(
                      color: KRedOrange, fontWeight: FontWeight.w700),
                ),
                const PerformanceByGACard(),
              ],
            ),
            RoundedButton(
              text: "DOWNLOAD YOUR TRANSCRIPT",
              press: (context) {},
              fontSize: 12,
              margin: 0,
              paddingHorizontal: 0,
              paddingVertical: 0,
              borderRadius: 5,
            ),
          ]),
    )))));
1 Answers

Your Can't place Column widget inside column, It Means A parent of unbounded height can't hold a child which is given unbounded height. Also at top level where you place singleChildScrollView, don't use it or wrap your Columns with fixed height sizedBox. It will solve your problem.

Related