Comments (4)
Hi, could you please be more specific what would you like to achieve?
Do you want to update some widgets inside ProgramWidget
? Or do you want to update specific ProgramWidget
from the other widgets?
from dartea.
- There are 2 screens, 2 models. And 2 db-tables backstage:
- ActionScreen (
AS
), ActionModel (AM
) with its messages, ActionTable (AT
) - HistoryScreen (
HS
, HistoryModel (HM
) with its messages, HistoryTable (HT
) - Of course there are
ProgramWidget
on both of widgets, andDarteaMessagesBus
on the root one
- ActionScreen (
- In the static situation screens keep their state between switching and this is OK
- Changing Action* affects History* too, so both tables change and from
AM
i want send message or something toHM
andHT
about that
But whenHS
is hidden no messages reach it from outer modelAM
and when i switch to it i see previous unchanged state
So, the question is: is there a solution within this library to transmit messages to hidden models?
BTW, just for information )))
Earlier i used to code for Android on Java/Kotline and use Moxy library. That library was keeping messages queue with a various behaviour and lifetime depending on some key.
from dartea.
Hey, sorry for long response.
Unfortunately it's not possible to do it in that way. Communication between ProgramWidgets
is not possible if one of them is out of the tree.
I think you should reconsider your Model
and Domain
layer. Generally you shouldn't face such problems if you do it in a right way.
For example when you mutate your Actions model
, I guess, you need to persist some data somehow. And when you show History screen
you can read latest data from persistent storage.
It's not necessary to use persistent storage, it can be in memory data structure, but the idea is the same: update your data and initialize your widget with the latest changes.
I hope that helps. Any way you can ask anything if it's still unclear.
from dartea.
Hey, sorry for long response.
...
For example when you mutate yourActions model
, I guess, you need to persist some data somehow. And when you showHistory screen
you can read latest data from persistent storage.
It's not necessary to use persistent storage, it can be in memory data structure, but the idea is the same: update your data and initialize your widget with the latest changes.
...
Thanks for replying me.
Of course I could and of course i will it in this way or somehow.
But... The fact is it would be useful when View had information that something happened when it was offline. Since the Model has a long life cycle, so why not introduce the ability to store such information into it until the View appears again. I mean inside Dartea
as part of kernel.
from dartea.
Related Issues (17)
- type 'NoSuchMethodError' is not a subtype of type 'Exception' HOT 3
- DarteaMessageBus not found HOT 1
- TextFields are getting rebuild even when I use GlobalKeys. HOT 9
- How to get Scaffold context inside of _view? HOT 1
- How can i effective forward message to another model? HOT 1
- What if one need pass some parameters to _init..?
- AppLifeCycleState, no constant named suspending HOT 2
- How to do routing? HOT 2
- migrate to AndroidX fails HOT 3
- Convert to `Sound null safety`
- Dartea for a Webapp HOT 2
- Wrong information in readme HOT 4
- Awesome HOT 4
- copyWith HOT 2
- Could this package be used with AnguarDart? HOT 3
- May I use a single big model object instead of many models? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dartea.