use mediaquerri to set width in flutter code example Example: media query width flutter width: MediaQuery.of(context).size.width