简体   繁体   中英

flutter: Bug? only FlatButton but not CupertinoButton showing Text

Did you ever experience this? Does it make sense to register this as a bug and how would I do this?

For one of my screens I have now this situation for the 2nd time: I insert a CupertinoButton with Text as a child, however, the text does not show up. In the 1st occurrence, 2 pixels of text appeared to be rendered (I saw 2 dots). I have also copied a CupertinoButton from another line and left it unchanged. No change, text does not appear. If I then only change the widget name from CupertinoButton to FlatButton (leaving everything else untouched), the text appears.

Since CupertinoButtons are typically working for me, I guess I would have to submit the whole project for a bug report, since isolating the issue does not to be appear like a straight forward job.

Please consider adding padding like this:

         CupertinoButton(
              padding: EdgeInsets.symmetric(vertical: 0, horizontal: 5),
              color: Colors.blue,
              borderRadius: BorderRadius.all(Radius.circular(12)),
              child: Text(
                'Login',
                style: TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                    color: Colors.white),
              ),
              onPressed: () => {},
            ),

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