One possible solution would be to create a new MaterialApp on that portion of the screen and handle everything from there like a regular app (just with different screen size) like so:
Column(
children: <Widget>[
Container(
height: constraints.maxHeight * 0.5,
width: constraints.maxWidth,
),
Container(
height: constraints.maxHeight * 0.5,
width: constraints.maxWidth,
child: MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Color.fromRGBO(86, 86, 86, 1.00),
),
initialRoute: '/W1',
routes: {
'/W1': (context) => WidgetOne(),
'/W2': (context) => WidgetTwo(),
})),
],
),
Then handle the routing from withing the widgets like so:
class WidgetOne extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/W2');
},
child: Container(color: Colors.green));
}
}
}
class WidgetTwo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/W1');
},
child: Container(color: Colors.pink));
}
}
}
Result:
https://i.sstatic.net/qyJ5N.gif
Container
? – Paprika