'A RenderFlex overflowed by 99639 pixels on the right
I'm trying to make a sentence in the center of the page and an icon button at the top left to go back to the main page but it showed this. Would appreciate your help :) (using a Pixel 4 XL API 30)
here's the full code for this page
import 'package:flutter/material.dart';
class ShoppingCart extends StatefulWidget {
@override
_ShoppingCartState createState() => _ShoppingCartState();
}
class _ShoppingCartState extends State<ShoppingCart> {
@override
Widget build(BuildContext context) {
return Container(
child: Stack(
children: [
Flexible(
flex: 1,
child: Center(
child: Text('No orders yet...',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: Colors.grey.withOpacity(0.4)
),
),
),
),
Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top,
left: 25,
right: 25
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: () {
Navigator.pop(context);
},
color: Colors.black.withOpacity(0.7),
iconSize: 19,
),
)
],
),
)
],
),
);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

