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
As you can see, all this does is attempts reading the value, and returns null if it fails. This is extremely useful in building web sites with Dart Frog as many routes are accessible for both authenticated and unauthenticated users, they just render differently. This supports a much nicer flow to access that data.
final user = context.tryRead<User>();
if (user ==null) {
print('unauthenticated');
} else {
print('authenticated');
}
Requirements
All CI/CD checks are passing.
There is no drop in the test coverage percentage.
Change is documented in the dependency injection docs