I have a bigger app named X and I have another smaller one named Y. they are right now separate from each other and they are working fine. I want to integrate app Y in X. I want to put codes of Y in X project but they should have a different Main so I can set different themes and routes. Is there any way to do that?
I am using GetMaterialApp from GetX instead of MaterialApp, and it returns error:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 5334 pos 14: '_dependents.isEmpty': is not true.
How can I fix this?
You can use multiple MaterialApp()
in your project, combine the code/file like that the app is on another screen, and you will result in apps that have different references to their InheritedWidget
s like Theme
, Navigator
, MediaQuery
...
/*...*/
MaterialApp(
/*...*/
home: AppXHome(),
),
/*...*/
class AppXHome extends StatelessWidegt {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Container(),
Container(),
MaterialApp(
home: AppYHome(),
),
],
),}}