responsive_scaffold icon indicating copy to clipboard operation
responsive_scaffold copied to clipboard

initState not called in the Widget used in DetailScreen

Open Shajeel-Afzal opened this issue 5 years ago • 1 comments

Hi,

I am using ResponsiveListScaffold.builder to show lists on the left and once the user selects a list item on the left I show the Video View on the right.

I am facing a problem right now with that the initState function. It is not being called once I select a different list item from the left.

Since we initialize the Video Player inside the initState, the detail screen keep playing the old video, however, the other content (Text Widgets etc) is changed since they are being used in the build function.

Is there any solution to manually call initState of the detail screen once user select the item from the itemBuilder

Thanks.

Shajeel-Afzal avatar Apr 19 '20 01:04 Shajeel-Afzal

I may have had a similar issue and resolved it by ensuring that the Detail screen had a different Key specified so that Flutter knows that the Details changed and needs to be rebuilt.

awhitford avatar Jun 27 '20 17:06 awhitford