keepOldArtwork property Null safety

bool? keepOldArtwork
final

Used to define if artwork should keep old art even when Flutter State change.

Flutter Docs:

Why is the default value of gaplessPlayback false?

Having the default value of gaplessPlayback be false helps prevent situations where stale or misleading information might be presented. Consider the following case:

We have constructed a 'Person' widget that displays an avatar Image of the currently loaded person along with their name. We could request for a new person to be loaded into the widget at any time. Suppose we have a person currently loaded and the widget loads a new person. What happens if the Image fails to load?

  • Option A (gaplessPlayback = false): The new person's name is coupled with a blank image.

  • Option B (gaplessPlayback = true): The widget displays the avatar of the previous person and the name of the newly loaded person.

Important:

Implementation

final bool? keepOldArtwork;