Questions tagged [inherited-widget]
63 questions
0
votes
1 answer
Passing data from one widget to another in the same tree
In my flutter app I need to pass on data from a widget to another widget. Both are encapsulated in a Column widget, the diagram below best describes it
I've tried using inherited widget, but that doesn't seem to help, here's the code for the…

Ayush Nanglia
- 89
- 1
- 3
- 10
0
votes
1 answer
Pass data to multiple screens with inheritedwidget
There are some confusions about InheritedWidget that I don't understand.
I have searched and read some QAs about InheritedWidget on stackoverflow, but there are still things that I don't understand.
First of all, let's create a scenario.
This is my…

Ehsan Askari
- 843
- 7
- 19
0
votes
1 answer
How to achieve Provider.select behaviour using built in InheritedWidget like MediaQuery?
In my chat app every message depends on MediaQuery (font scaling). When keyboard is appear on Android 11+ then bottom insets in MediaQuery are animated from 0 to keyboard height. It cause unwanted rebuilds of all messages, but they depends only from…

Nickolay Savchenko
- 1,474
- 16
- 28
0
votes
1 answer
Is InheritedWidget should always need to be a child of StatefulWidget?
Things that I know about InheritedWidget?
InheritedWidgets are not rebuilts instead we have to create a new InheritedWidget with a new value.
Then inside the updateShouldNotify() method will compare its old and current object and return true or…

dilshan
- 2,045
- 20
- 18
0
votes
0 answers
How to get current location and pass inside the tree via Inherited Widget in flutter?
I am trying to share the current location of an user within the app in other routes.
My widget tree is quite extensive to keep passing the value down, so I would like to get it easier and updated in a interval of 1 minute in the widgets below.
I've…

Ghilherme
- 50
- 1
- 9
0
votes
0 answers
Flutter Inherited Widget updateShouldNotify oldWidget same as the new one?
I am trying to deep dive into inherited widget and got stuck somewhere. When i debug on updateShouldNotify method, its parameter(old widget) has same data with the new one. Also the instances are same. Due to that contition always false and my…

Erkan Erkişi
- 159
- 5
- 13
0
votes
1 answer
Assigning InheritedWidget in build-Method
Let A be an InheritedWidget, that I can get throughout the whole app by calling A.of(context).
If I have a StatefulWidget, what is the better option (in terms of performance or code quality):
A)
class Test extends StatefulWidget {
@override
…

König Wey
- 151
- 1
- 7
0
votes
1 answer
Flutter Bloc A adds stream in Bloc B but this stream will not render in UI via StreamBuilder
I'm trying to make the shift to a bloc / provider architecture for a new flutter project. I've been troubleshooting a problem for a while now where one bloc's streams will render on the UI via StreamBuilder but the other bloc will not. Before I…

nejas
- 19
- 2
- 7
0
votes
1 answer
Unable to initialize an Inherited widget in Flutter
I'm trying to use an Inherited Widget to share the same service across all the screens.
This is the code of my Inherited Widget:
class GlobalValues extends InheritedWidget {
final AudioProvider audioProvider;
GlobalValues({Key key, Widget…

Matteo Zantedeschi
- 35
- 5
0
votes
1 answer
Please Explain syntax - flutter bloc provider using inherited widget
I do not understand the constructor part and static function part.
super?
dependOnInheritedWidgetOfExactType?
import 'comments_bloc.dart';
export 'comments_bloc.dart';
class CommentsProvider extends InheritedWidget {
final CommentsBloc…

techieasif
- 153
- 2
- 9
0
votes
1 answer
ListTile at Home screen is not updating with InheritedWidget
I'm getting started with flutter/dart and I'm trying to implement a simple note app using InheritedWidget and TextControllers, but when I add or edit some note it doesn't update the main screen. I printed the new notes list in console and it is…

Nathan Araujo
- 11
- 1
0
votes
0 answers
Problem showing a value contained in an InheritedWidget
I've been developing in Flutter for a few months and I'm not yet very experienced. These days I'm working on an app that I didn't create from the beginning and I'm having a strange problem, unfortunately I can't paste too much pieces of code but I…

antoniocapizzi95
- 83
- 2
- 7
0
votes
1 answer
jquery ui inherite button widget
I'm trying to create a new widget based on the button widget and would like to know how to modify the button style of an existing jquery ui button if it already is created or create a new jquery button if it doesn't. How would I check if it's…

JoMojo
- 404
- 1
- 7
- 22
0
votes
2 answers
How to call a function from another pageview class to another in Flutter?
I need help calling a method of another class in a pageview. I have an app which has a pageview consisting of two classes, Page 1 and Page 2 respectively. Both of them are stateful widgets.
I am trying to call a method from Page2 from Page1, but it…

fadhli-sulaimi
- 686
- 12
- 17
0
votes
0 answers
InheritedWidget not accessible from new Route
I'm building a basic Flutter app with Bloc pattern. This is my structure so far.
MainProvider contains the Repository, which I can pass in every Bloc of every sub page (one Bloc per page, basically).
The problem is that, if I want to access…

riciloma
- 1,456
- 2
- 16
- 31