Search code examples
flutterdartflame

Is it possible to insert GameWidget(game: SpaceShooterGame()) in a column Widget. (Flutter Flame)


              Column(
                children: [
                  GameWidget(game: SpaceShooterGame()),

I got following message The following assertion was thrown during performLayout(): RenderConstrainedBox object was given an infinite size during layout.

How to do ?

I try may widget around GameWidget (row ,column ..) none is working


Solution

  • You can use Expanded widget inside Column.

      Column(
            children: [
                 Expanded(
                   child: GameWidget(
                        game: SpaceShooterGame(),
                           ),
                         ),
                       ],
                     )