1

Can a child widget (MaterialApp) inherit from 2 separate inherited widgets? Like I need one inherited widget for translation (LocalizationProvider) and another for navigation (AppStateProvider). They work fine separately but unable to make them work together... :(

// 1st one
Widget build(BuildContext context) {
    return LocalizationProvider(
        state: LocalizationProvider.of(context).state,
        child: FlavorBanner(
          child: MaterialApp(
              // Other code
          ),
        ),
   );
  }


// 2nd one
Widget build(BuildContext context) {
        return AppStateProvider(
           state: this,
             child: FlavorBanner(
               child: MaterialApp(
                      // Other code
               ),
             ),
        );
    }
fida1989
  • 3,234
  • 1
  • 27
  • 30

0 Answers0