-
Notifications
You must be signed in to change notification settings - Fork 13
Consolidate avatar components #510
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| import 'package:flutter_svg/svg.dart'; | ||
| import 'package:gap/gap.dart'; | ||
| import 'package:whitenoise/config/providers/account_provider.dart'; | ||
| import 'package:whitenoise/ui/chat/widgets/chat_contact_avatar.dart'; | ||
| import 'package:whitenoise/ui/core/themes/assets.dart'; | ||
| import 'package:whitenoise/ui/core/themes/src/extensions.dart'; | ||
| import 'package:whitenoise/ui/core/ui/wn_avatar.dart'; | ||
| import 'package:whitenoise/ui/core/ui/wn_button.dart'; | ||
| import 'package:whitenoise/ui/core/ui/wn_text_form_field.dart'; | ||
|
|
||
|
|
@@ -94,11 +94,9 @@ class _CreateProfileScreenState extends ConsumerState<CreateProfileScreen> { | |
| valueListenable: _displayNameController, | ||
| builder: (context, value, child) { | ||
| final displayText = value.text.trim(); | ||
| final firstLetter = | ||
| displayText.isNotEmpty ? displayText[0].toUpperCase() : ''; | ||
| return ContactAvatar( | ||
| return WnAvatar( | ||
| imageUrl: ref.watch(accountProvider).selectedImagePath ?? '', | ||
| displayName: firstLetter, | ||
| displayName: displayText, | ||
| size: 96.w, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to size prop, but not for the scope of this PR... what do you think about
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd seen that in some places no size is needed (so default is used, in others is passed a size with .w and in others with .r |
||
| showBorder: ref.watch(accountProvider).selectedImagePath == null, | ||
| ); | ||
|
|
||
This file was deleted.
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 change was a bit confusing to me, but it seems to be working fine!
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.
We can now pass the full string to WnAvatar. the naming here has changed because WnAvatar does the trimming.
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.
Thanks for the explanation @untreu2 🫶