0

I'm learning Flutter and right now I'm calling _buildStackCardsList widget in the body but I'm trying to add additional text right above _buildStackedCardsList method but I'm not really sure how to implement that. every time I tried to wrap with containers or columns the stackedCard got to disappear.

  body: _buildStackedCardsList()
}


  Widget _buildStackedCardsList() {
  }

so this is what I trying to do

enter image description here

any suggestion, thanks

1 Answers1

0

Flutters widget reference is a nice place to start when looking what widgets you can use and how you can implement your layout with it: https://flutter.dev/docs/reference/widgets

Judging from your wireframe I would add a Column widget https://api.flutter.dev/flutter/widgets/Column-class.html

body: Column(
  children: <Widget>[
    Text('Your Text'),
    Expanded(child: _buildStackedCardsList()),
  ],
)

Update: Due to size calculation you can not render a ListView as a direct child of Column. It can be for example wrapped in a Expanded widget. The answer to a similar question can be found here: https://stackoverflow.com/a/57132247/4668136

Dimitri L.
  • 4,499
  • 1
  • 15
  • 19
  • Hi.. I have tried that and the stackedcards or Text is not showing anymore. I'm not really sure if something wrong with _buildStackedCardList() but if you don't mind can you look into it. I just added the code. thanks –  Apr 27 '20 at 20:43
  • I have updated my answer with a code that should work and a reference question/answer – Dimitri L. Apr 27 '20 at 20:49