research.package icon indicating copy to clipboard operation
research.package copied to clipboard

"Null check operator used on a null value" in RPUITaskState

Open bardram opened this issue 1 month ago • 3 comments

I get a "Null check operator used on a null value" in line 351 in RPUITaskState:

Image

I come from pushing an RPUITask on the navigator like this:

Image

bardram avatar Dec 18 '25 13:12 bardram

I can see that the construct Theme.of(context).extension<RPColors>()!.... is used in many places in RP, so maybe a more general problem?

bardram avatar Dec 18 '25 13:12 bardram

Ok - I solved it by using the RP themes in my app, like this:

Image

The problem occurs when I use the default ThemeData.dark() theme.

BUT - the RP should be able to work also with other themes than the RP themes, and especially the default ones.....

bardram avatar Dec 18 '25 13:12 bardram

It can work with any theme, but it you're using the Research Package's names for colors then you must somehow define them in your project. You cant try to get a Color from the RP and expect to find it in the default themes. The way to override the color name in any theme is with the .copyWith command i think.

Panosfunk avatar Dec 20 '25 10:12 Panosfunk