'How do I handle two packages that require MaterialApp as child in flutter?

I am using this screen util package that helps handle the responsiveness of the app on different screen size and I am also using provider both of them require MaterialApp as child but I don't know how to go about it instead I did this and now I'm having some issues navigating in the app.

  class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

  return MultiProvider(providers: [
  ChangeNotifierProvider(create: (_)=>
  TestimonyVeiwModel()
  ),
  ],
  child:  ScreenUtilInit(
  builder:() => MaterialApp(
  title: 'Stea app',
  theme: ThemeData();


Solution 1:[1]

I prefer using this way

return ScreenUtilInit(
  builder: () => MultiProvider(
    providers: [...],
    child: MaterialApp(
    //...
    ),
  ),
);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yeasin Sheikh