How to use a provider inside of another provider in Flutter

Thanks for your answer. In the meanwhile, I solved it with another solution: In the main.dart file I now use ChangeNotifierProxyProvider instead of ChangeNotifierProvider for the depending provider: // main.dart return MultiProvider( providers: [ ChangeNotifierProvider(builder: (_) => Auth()), ChangeNotifierProxyProvider<Auth, Messages>( builder: (context, auth, previousMessages) => Messages(auth), initialBuilder: (BuildContext context) => Messages(null), ), ], child: MaterialApp( … Read more

How to make GestureDetector also work when touch empty space in Flutter

You can use behavior: HitTestBehavior.opaque property of GestureDetector widget, that helps to tap on the placeholder inside Container even if Container widget doesn’t have any child. GestureDetector( behavior: HitTestBehavior.opaque, child: Container( child: Hero( tag: ‘test’, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text(‘Very very very long long long long text view’), SizedBox(height: 10), Text(‘Short text’) ], … Read more

Transparent bottom navigation bar in flutter

None of the given answers worked for me and I figured out something very important: you have to add the property extendBody: true If true, and bottomNavigationBar or persistentFooterButtons is specified, then the body extends to the bottom of the Scaffold, instead of only extending to the top of the bottomNavigationBar or the persistentFooterButtons. This … Read more