You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Gaddlord, according to the Default Value for Optionals in Dart you need to associate your int? to OrDefault extension that is a nullable T?, but in your code you bind to a generic T which is non-nullable, so nullable int keeps the null value because the extension waiting for a non-nullable variable. You just need to change this: extension OrDefault<T> on T {
As suggested at https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/default-value-for-optionals-in-dart/default-value-for-optionals-in-dart.md
I declared:
The text was updated successfully, but these errors were encountered: