0

How can I achieve this where a nested Navigator widget in a Column wraps the child content.

enter image description here

This crashes the app

 Column(
    children: [
       Text("First Text"),
       Navigator(
         key: _navigatorKey,
         initialRoute: widget.setupPageRoute,
         onGenerateRoute: _onGenerateRoute,
     ),
       Text("Second Text"),
    ],
 ),

with error

'package:flutter/src/widgets/overlay.dart': Failed assertion: line 720 pos 12: 'constraints.biggest.isFinite': is not true.

but adding a Flexible around the Navigator doesnt respect the flex and it just expands.

    Column(
            children: [
               Text("First Text"),
               Flexible(
                child: Navigator(
                  key: _navigatorKey,
               initialRoute:widget.setupPageRoute,
                 onGenerateRoute: _onGenerateRoute,
             ),
),
               Text("Second Text"),
            ],
         ),

enter image description here

Any ideas on how this can be solved? Thanks in advance

Bolaji
  • 476
  • 1
  • 4
  • 11
  • may be this help https://stackoverflow.com/questions/48098085/nesting-routes-with-flutter – Abhijith Aug 28 '21 at 13:47
  • Thanks @Abhijith I dont have a problem with the way the navigation route works, only how it fits with the rest of widget around it. Which is not what the link asnwered. – Bolaji Aug 28 '21 at 13:52
  • try this https://stackoverflow.com/questions/55716230/how-to-do-nested-navigation-in-flutter – Abhijith Aug 28 '21 at 13:56
  • Still not, unfortunately. That link talks about how to do multiple nested navigation with bottom bar. Still more about how to do navigator routing, not about how the Navigator itself sits in the layout. – Bolaji Aug 28 '21 at 14:07

0 Answers0