-
-
Notifications
You must be signed in to change notification settings - Fork 310
Profile Bio Enhancement #449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for this. I'm not very fond of the underline style though. It would be better to leave just the blue color without the underline. |
| http: ^1.1.0 | ||
| intl: ^0.18.0 | ||
| json_annotation: ^4.7.0 | ||
| linkify: ^5.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this package since flutter_linkify is already handling the job alone it seems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cause flutter_linkify is depended on this library but it's not showing UserTagLinkifier which is needed to link user tags.
repo link
One way to solve that would be to create our own Linkify widget by copying it from flutter_linkify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes of the UserScreen should be reverted before merging it.
- go back to only
LightUserparam - handle user not found in the error handler
- don't try to fetch user before going to the screen in
UserProfile
lib/src/view/user/user_profile.dart
Outdated
| Linkify( | ||
| onOpen: (link) async { | ||
| if (link.originText.startsWith('@')) { | ||
| final userId = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to immediately go to the user screen with the id, and load the user while in the screen.
lib/src/view/user/user_screen.dart
Outdated
| ); | ||
|
|
||
| final LightUser user; | ||
| const factory UserScreen.fromUser({required User user, Key? key}) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change actually.
Why adding more complexity? We should always load the user from ID.
It looks like this change was made to handle the case where the user is not found in a profile link. But it is better to handle this case in the async error handler and show a "User not found" here instead.
lib/src/view/user/user_profile.dart
Outdated
| pushPlatformRoute( | ||
| context, | ||
| builder: (ctx) => UserScreen( | ||
| user: LightUser(id: userId, name: userId.value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do instead:
final username = link.originText.substring(1);
final user = LightUser(id: UserId.fromUserName(username), name: username);
pushPlatformRoute(
...
Some user have links in their bio and we should make them clickable.
Preview
Usernames will open a user screen if the user exists. Other urls will launch a window.