简体   繁体   中英

About the flutter (A RenderFlex overflowed by 1.3 pixels on the right)

Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( Cart().freeDeliveryString, style: Theme.of(context).textTheme.headline4, ), ElevatedButton( onPressed: () { Navigator.pushNamed(context, '/'); }, style: ElevatedButton.styleFrom( primary: Colors.black, shape: RoundedRectangleBorder(), elevation: 0, ), child: Text( 'Add More İtems', style: Theme.of(context).textTheme.headline4.:copyWith( color. Colors,white, ), ), ), ], ),

Try wrapping any or both children of your row with an Expanded widget

Wrapping only your Text widget with an Expanded widget will be enough to solve your error.

   Column(
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Expanded(
              child: Text(
                'Cart().freeDeliveryString',
                style: Theme.of(context).textTheme.headline4,
              ),
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/');
              },
              style: ElevatedButton.styleFrom(
                primary: Colors.black,
                shape: RoundedRectangleBorder(),
                elevation: 0,
              ),
              child: Text(
                'Add More İtems',
                style: Theme.of(context).textTheme.headline4!.copyWith(
                      color: Colors.white,
                    ),
              ),
            ),
          ],
        ),
      ],
    );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM