londonappbrewery / BMI-Calculator-Flutter-Completed

The completed code for the BMI Project - The Complete Flutter Development Bootcamp
https://www.appbrewery.co/
102 stars 146 forks source link

Overflow in the Height card #7

Open aitrenI opened 4 years ago

aitrenI commented 4 years ago

After many trials I ran the given code for the complete app and have the same problem.

There is overflow in the middle card which contains the slider and height.

mohitnakum commented 4 years ago

@aitrenI you can overcome it by using SingleChildScrollView

mohitnakum commented 4 years ago

Expanded( child: ReusableCard( colour: kActiveCardColour, cardChild: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'HEIGHT', style: kLabelTextStyle, ), Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: TextBaseline.alphabetic, children: [ Text( height.toString(), style: kNumberTextStyle, ), Text( 'cm', style: kLabelTextStyle, ) ], ), SliderTheme( data: SliderTheme.of(context).copyWith( inactiveTrackColor: Color(0xFF8D8E98), activeTrackColor: Colors.white, thumbColor: Color(0xFFEB1555), overlayColor: Color(0x29EB1555), thumbShape: RoundSliderThumbShape(enabledThumbRadius: 15.0), overlayShape: RoundSliderOverlayShape(overlayRadius: 30.0), ), child: Slider( value: height.toDouble(), min: 120.0, max: 220.0, onChanged: (double newValue) { setState(() { height = newValue.round(); }); }, ), ), ], ), ), ), ),