Hello im new in dart language, is someone can help me to write this condition better, it works but it's a lot repetitive and i feel theres a better ways to write it :
if (var1 != null || var2 != null || var3 != null || var4 != null || var5 != null){ ShowMyWidget }
thank you.
Rather than checking all those variables, I'd make them optional parameters to the widget. If you do that, you can just check if they're null using null-safety inside it, whenever you actually need them.
Keep in mind that your way of doing it isn't wrong.