gustav.b
gustav.b

Reputation: 55

Why my texts are not being displayed in my column?

I'm a begginer in Flutter and Dart, I have made a simple basic code but it doens't work, someone can help me ? The app doesn't display the texts of the column. Here is the code :

return CupertinoPageScaffold(
  navigationBar: CupertinoNavigationBar(
    middle: Text('Page 1 of tab $index'),
  ),
  child: Column(
    children: const <Widget>[
      Text("ligne 1"),
      Text("ligne 2"),
    ],
  ),
);

Upvotes: 2

Views: 374

Answers (2)

Ravindra S. Patil
Ravindra S. Patil

Reputation: 14775

Try below code hope its help to you.

Refer CupertinoPageScaffold here

return CupertinoPageScaffold(
       navigationBar: const CupertinoNavigationBar(
        middle: Text('Page 1 of tab  index'),
      ),
      child: ListView(
        children: <Widget>[
          Text("ligne 1"),
          Text("ligne 2"),
        ],
      ),
    );

Result screen-> enter image description here

Upvotes: 2

Diwyansh
Diwyansh

Reputation: 3514

You text is already there but it's hiding behind the navigationBar. Just wrap your Column into SafeArea and your text will appear properly.

SafeArea(
              child: Column(
            children: const <Widget>[
              Text("ligne 1"),
              Text("ligne 2"),
            ],
          ))

enter image description here

Upvotes: 1

Related Questions