Slider value doesn't update even if state is changing - flutter

I'm getting mad to understand why the slider inside a statefulBuilder won't update its value even if the state is continually changed by an audioPlayer listener function. Other values inside the same builder updates (the button icons for instance), but the slider keeps staying in its initial position even if it remains draggable.
I've searched the web and this site for two full days. I'm adding the link to the file on git to avoid pasting the entire file here
https://github.com/Adriano72/wccm/blob/master/lib/pages/john_main_talks.dart

Related

How to render a webview that will still running even though the parent widget screen is popped out in Flutter?

So in my app, I create an additional page. When that page is opened, it will guide a user through a series of steps, that ultimately open a webview pointing to a URL in backend, that generates an image to be saved to the server. The user doesn't need to know what's being drawn in the webview, so the webview can be set invisible (opacity = 0.0).
The image can only be generated by that web page (which is why I have to open it with webview). This is a client-side javascript and HTML5 canvas process that can't be done by server-side code alone. There's actually a web page that has to be opened. And all the Flutter code need to do is to open the webview component long enough for the image to be created and automatically saved into the server.
The problem is, the process may take dozens of seconds. In my case, it takes like 7-12 seconds. And the user may press back on the page that unfortunately will close the webview too and cancel the image generation and submission. I already added an infinite circular progress indicator, but apparently, from the early user tests, some users weren't patient enough to wait that long and already pressed back before the image is finished rendering.
My question is, how can I create a webview detached from the current screen, so that even after the current screen is closed, the webview will still be running in the background?
Currently, I use flutter_webview_plugin: ^0.3.11 for this. It allows for launching webview popup that's hidden. But when I close the page, the invisible webview popup also gets closed too.
Combine Offstage widget with custom pop logic (instead of popping back, just hide the webview by setting bool offstage to true).
As per Offstage docs:
A widget that lays the child out as if it was in the tree, but without
painting anything, without making the child available for hit testing,
and without taking any room in the parent.
Offstage children are still active: they can receive focus and have
keyboard input directed to them.
Animations continue to run in offstage children, and therefore use
battery and CPU time, regardless of whether the animations end up
being visible.
https://api.flutter.dev/flutter/widgets/Offstage-class.html

Unity - Animator Controller - Store previous state

I have a locker with 4 drawers. Every drawer is an individual object. Every drawer has its own animation for opening it. I have a problem with transition. If I open the first drawer and then open the second (or third), the first drawer will automatically close.
The next picture shows the object after the first animation (ThirdDrawer_Open)
The next picture shows the object after the second animation (SecondDrawer_Open)
I want to store the previous state of animation so when I open the second drawer, the previous one doesn't close/end.
From the Animation States docs, there are various exposed properties on states that you can edit. One property is called Write Defaults. From the docs, it is described as
Whether or not the AnimatorStates writes back the default values for
properties that are not animated by its Motion.
In your case, if this is enabled whenever you change your states for drawers, it will write the defaults back to the other drawers causing them to close. A solution would be to un-toggle this property so defaults are not written, or you can forcibly overwrite these values at runtime using WriteDefaultValues. I generally prefer the prior solution as WriteDefaults can be a headache to figure out and work with at times.

Why does clicking on a TextFormField trigger didUpdateWidget()?

I've ran into a problem. In one section of my page I have a date with today's date. If the user clicks on an arrow to the right it goes forward a date and if they person clicks an arrow to the left it goes back a date. On the arrow buttons I am using setState. The date changes perfectly fine.
I also have a form below on a separate card. To each textFormField I h ave a controller set up. I had to set these up because initialvalue: only gets called once so the fields were never changing with the date.
Anyway the fields now change with the date and it is correct. But the moment I click on the form, The top widget date shoots back to the initial value it was at?
I checked this by setting up a didUpdateWidget override and this is firing every time I click on the form field??? Why is this happening. I am not updating anything yet.
When I used a controller for the date value displayed between the two arrows it doesn't change but when I hit submit the value it's supposed to be assigned to is the wrong (very first date that appears). So it seems like when didUpdate fires it is setting that field which I have set in my extends StatefulWidget class{}.
EDIT: Wow typing that last sentence made me realize I needed to set the value in my bottom class that extends State<>. I was using it with widget.activeDay.
I guess I'm still curious as to why this is happening with the text form field though?
Clicking on a text-field opens the keyboard.
This changes the screen dimensions and leads to MaterialApp rebuilding the route.
The route rebuilding ultimately calls didUpdateWidget on that specific widget.

Ionic New Slides - Swiper SlideTo bug

I'm using the latest ionic 1 version 1.3.3.
I've a list of items. On click any of them, it opens the ion-slides with few left and right items (which I'm letting it to control dynamic). The issue is when the slider gets ready, it shows the correct index for the first or couple of time. But shows the first index afterwards when we come back to the list and click on another item.
I've used $scope.slider.slideTo to update the index. I also destroy slides instance before leaving but didn't get success.
Looks like it was not .slideTo() bug. But I think they should provide callbacks for the update methods.
Actually I've binded ng-hide on the slider for the loading.
So the slider was unable to render until the list is prepared. I was updating the index and then toggling the loading.
Resulting conflicts with update slide and index.
I placed style visibility: hidden with ngclass instead of ng-hide. It works perfect.

Dynamically update install4j screen content

We have a screen which displays only if we detect a problem with the environment. The screen has a button which retries the environment check. Each time the user retries the error can change and so I'd like to update my Multi-line HTML label accordingly. The content of the label needs to contain information produced during the environment check so even if we get the same type of error twice we may need a different message.
Is there a way to dynamically update the content of a screen? In other answers I've seen that it's usually recommended to set the content of the screen to a variable, and then updating the variable, but since I'm not moving between screens I don't believe the content will be updated. I've seen that calling context.gotoScreen(currentScreen) will refresh the content, but I'm worries this is not standard, and may change in the future in a way that if the provided screen is the current screen, nothing happens.
So the question is, what's the best approach to dynamically update the content of a screen based on user interaction without moving between screens.
Cheers
Each time a form screen is shown, all form components will be reinitialized. For a multi-line HTML label component, this means that the label text will be refreshed.
To update all components from within the screen, call
formEnvironment.reinitializeFormComponents();