1

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.

w461
  • 2,168
  • 4
  • 14
  • 40
  • I don't think you will get an answer here. Yes, if you can reproduce that in your project, file a bug report including your code. – nvoigt Sep 16 '20 at 06:49

1 Answers1

1

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: () => {},
            ),
Amon C
  • 1,710
  • 9
  • 17
  • 1
    Indeed, whith the padding the button shows up also as a CupertinoButton. This is funny, because those buttons worked just some lines below without the padding, which is why I did not consider changing internal layout options. – w461 Sep 16 '20 at 07:04
  • Haha! I also suffered the same. It took me hours to fix. Happy Coding! – Amon C Sep 16 '20 at 07:05