Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
33cd9df
patch: updated WnFilledButton to have prefixIcon and suffixIcon inste…
Quwaysim Aug 17, 2025
0aa97d5
Merge branch 'master' of https://github.com/parres-hq/whitenoise_flut…
Quwaysim Aug 17, 2025
623579f
chore: remove duplicate imports and add missing dependencies
Quwaysim Aug 17, 2025
5bbd0ff
refactor: rename button title prop to label across all UI components
Quwaysim Aug 18, 2025
4c4f6c9
Update lib/ui/contact_list/start_chat_bottom_sheet.dart
Quwaysim Aug 18, 2025
4d75390
Update lib/ui/contact_list/start_chat_bottom_sheet.dart
Quwaysim Aug 18, 2025
7510b12
refactor: rename titleTextStyle to labelTextStyle in WnFilledButton a…
Quwaysim Aug 18, 2025
97697e5
refactor: remove redundant large button size from WnFilledButtons
Quwaysim Aug 18, 2025
91b5bd8
Merge branch 'master' of https://github.com/parres-hq/whitenoise_flut…
Quwaysim Aug 19, 2025
faa3975
patch: updated WnFilledButton to have prefixIcon and suffixIcon inste…
Quwaysim Aug 17, 2025
a76ad5b
chore: remove duplicate imports and add missing dependencies
Quwaysim Aug 17, 2025
76fe477
refactor: rename button title prop to label across all UI components
Quwaysim Aug 18, 2025
b9c2237
Update lib/ui/contact_list/start_chat_bottom_sheet.dart
Quwaysim Aug 18, 2025
1b1deb1
Update lib/ui/contact_list/start_chat_bottom_sheet.dart
Quwaysim Aug 18, 2025
6dcfab5
refactor: rename titleTextStyle to labelTextStyle in WnFilledButton a…
Quwaysim Aug 18, 2025
294596b
refactor: remove redundant large button size from WnFilledButtons
Quwaysim Aug 18, 2025
161496f
Merge branch '395-add-icon-position-arg-to-buttons' of https://github…
Quwaysim Aug 20, 2025
3bb28f2
Merge branch 'master' into 395-add-icon-position-arg-to-buttons
Quwaysim Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/svgs/ic_arrows_vertical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/ui/auth_flow/create_profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class _CreateProfileScreenState extends ConsumerState<CreateProfileScreen> {
final isButtonDisabled = accountState.isLoading || _isLoadingDisplayName;

return WnFilledButton(
title: 'Finish',
label: 'Finish',
loading: isButtonDisabled,
onPressed:
isButtonDisabled
Expand Down
29 changes: 8 additions & 21 deletions lib/ui/auth_flow/info_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,29 +117,16 @@ class _InfoScreenState extends ConsumerState<InfoScreen> {
final accountState = ref.watch(accountProvider);
final isButtonDisabled = _isLoading || accountState.isLoading;

return WnFilledButton.child(
return WnFilledButton(
loading: isButtonDisabled,
onPressed: isButtonDisabled ? null : () => _onContinuePressed(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Setup Profile',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w600,
color: context.colors.primaryForeground,
),
),
Gap(14.w),
SvgPicture.asset(
AssetsPaths.icArrowRight,
colorFilter: ColorFilter.mode(
context.colors.primaryForeground,
BlendMode.srcIn,
),
),
],
label: 'Setup Profile',
suffixIcon: SvgPicture.asset(
AssetsPaths.icArrowRight,
colorFilter: ColorFilter.mode(
context.colors.primaryForeground,
BlendMode.srcIn,
),
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/auth_flow/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> with WidgetsBindingOb
return WnFilledButton(
loading: authState.isLoading,
onPressed: _keyController.text.isEmpty ? null : _onContinuePressed,
title: 'Login',
label: 'Login',
);
},
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/auth_flow/welcome_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ class _WelcomeScreenState extends ConsumerState<WelcomeScreen> {
mainAxisSize: MainAxisSize.min,
children: [
WnFilledButton(
title: 'Login',
label: 'Login',
visualState: WnButtonVisualState.secondary,
onPressed: _isCreatingAccount ? null : () => context.go('/login'),
),
Gap(12.h),
WnFilledButton(
title: 'Sign Up',
label: 'Sign Up',
loading: _isCreatingAccount,
onPressed: _isCreatingAccount ? null : () => _handleCreateAccount(context),
),
Expand Down
50 changes: 19 additions & 31 deletions lib/ui/chat/chat_info/dm_chat_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ class _DMChatInfoState extends ConsumerState<DMChatInfo> {
],
),
Gap(32.h),
WnFilledButton.icon(
WnFilledButton(
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondary,
icon: const Text('Search Chat'),
label: SvgPicture.asset(
label: 'Search Chat',
suffixIcon: SvgPicture.asset(
AssetsPaths.icSearch,
width: 14.w,
colorFilter: ColorFilter.mode(
Expand All @@ -213,34 +213,22 @@ class _DMChatInfoState extends ConsumerState<DMChatInfo> {
},
),
Gap(12.h),
WnFilledButton.icon(
WnFilledButton(
size: WnButtonSize.small,
visualState:
isContact ? WnButtonVisualState.secondary : WnButtonVisualState.primary,
icon: Text(isContact ? 'Remove Contact' : 'Add Contact'),
label:
isContactLoading
? SizedBox(
width: 14.w,
height: 14.w,
child: CircularProgressIndicator(
strokeWidth: 2,
color:
isContact
? context.colors.secondaryForeground
: context.colors.primaryForeground,
),
)
: SvgPicture.asset(
isContact ? AssetsPaths.icRemoveUser : AssetsPaths.icAddUser,
width: 14.w,
colorFilter: ColorFilter.mode(
isContact
? context.colors.secondaryForeground
: context.colors.primaryForeground,
BlendMode.srcIn,
),
),
label: isContact ? 'Remove Contact' : 'Add Contact',
loading: isContactLoading,
suffixIcon: SvgPicture.asset(
isContact ? AssetsPaths.icRemoveUser : AssetsPaths.icAddUser,
width: 14.w,
colorFilter: ColorFilter.mode(
isContact
? context.colors.secondaryForeground
: context.colors.primaryForeground,
BlendMode.srcIn,
),
),
onPressed:
isContactLoading
? null
Expand All @@ -253,11 +241,11 @@ class _DMChatInfoState extends ConsumerState<DMChatInfo> {
},
),
Gap(12.h),
WnFilledButton.icon(
WnFilledButton(
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondary,
icon: const Text('Add to Group'),
label: SvgPicture.asset(
label: 'Add to Group',
suffixIcon: SvgPicture.asset(
AssetsPaths.icAdd,
width: 14.w,
colorFilter: ColorFilter.mode(
Expand Down
75 changes: 27 additions & 48 deletions lib/ui/chat/chat_info/widgets/group_member_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ class _GroupMemberBottomSheetState extends ConsumerState<GroupMemberBottomSheet>
size: WnButtonSize.small,
onPressed: () => Navigator.pop(context),
visualState: WnButtonVisualState.secondary,
title: 'Cancel',
label: 'Cancel',
),
Gap(8.h),
WnFilledButton(
size: WnButtonSize.small,
loading: _isRemoving,
onPressed: _isRemoving ? null : _removeFromGroup,
visualState: WnButtonVisualState.destructive,
title: 'Remove From Group',
label: 'Remove From Group',
),
],
),
Expand Down Expand Up @@ -272,37 +272,24 @@ class _GroupMemberBottomSheetState extends ConsumerState<GroupMemberBottomSheet>
else
SendMessageButton(widget.member),
Gap(8.h),
WnFilledButton.child(
WnFilledButton(
onPressed: _openAddToGroup,
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondary,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Add to Another Group',
style: context.textTheme.bodyMedium?.copyWith(
color: context.colors.primary,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
),
Gap(8.w),
SvgPicture.asset(
AssetsPaths.icChatInvite,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
],
label: 'Add to Another Group',
suffixIcon: SvgPicture.asset(
AssetsPaths.icChatInvite,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
),
if (currentUserIsAdmin) ...[
Gap(8.h),
WnFilledButton.child(
WnFilledButton(
onPressed: () async {
final result = await _openRemoveFromGroupDialog();
if (result == true && context.mounted) {
Expand All @@ -311,28 +298,20 @@ class _GroupMemberBottomSheetState extends ConsumerState<GroupMemberBottomSheet>
},
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondaryWarning,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Remove From Group',
style: context.textTheme.bodyMedium?.copyWith(
color: context.colors.destructive,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
),
Gap(8.w),
SvgPicture.asset(
AssetsPaths.icRemoveOutlined,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.destructive,
BlendMode.srcIn,
),
),
],
label: 'Remove From Group',
labelTextStyle: context.textTheme.bodyMedium?.copyWith(
color: context.colors.destructive,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
suffixIcon: SvgPicture.asset(
AssetsPaths.icRemoveOutlined,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.destructive,
BlendMode.srcIn,
),
),
),
] else ...[
Expand Down
67 changes: 20 additions & 47 deletions lib/ui/chat/chat_info/widgets/member_action_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gap/gap.dart';
import 'package:logging/logging.dart';
import 'package:whitenoise/config/extensions/toast_extension.dart';
import 'package:whitenoise/config/providers/contacts_provider.dart';
Expand Down Expand Up @@ -78,33 +77,20 @@ class _SendMessageButtonState extends ConsumerState<SendMessageButton> {

@override
Widget build(BuildContext context) {
return WnFilledButton.child(
return WnFilledButton(
onPressed: _createOrOpenDirectMessageGroup,
loading: _isLoading,
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondary,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Send Message',
style: context.textTheme.bodyMedium?.copyWith(
color: context.colors.primary,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
),
Gap(8.w),
SvgPicture.asset(
AssetsPaths.icMessage,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
],
label: 'Send Message',
suffixIcon: SvgPicture.asset(
AssetsPaths.icMessage,
width: 14.w,
height: 13.h,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
);
}
Expand Down Expand Up @@ -167,33 +153,20 @@ class _AddToContactButtonState extends ConsumerState<AddToContactButton> {
@override
Widget build(BuildContext context) {
final isContact = _isContact();
return WnFilledButton.child(
return WnFilledButton(
onPressed: _toggleContact,
loading: _isLoading,
size: WnButtonSize.small,
visualState: WnButtonVisualState.secondary,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
isContact ? 'Remove Contact' : 'Add Contact',
style: context.textTheme.bodyMedium?.copyWith(
color: context.colors.primary,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
),
Gap(8.w),
SvgPicture.asset(
isContact ? AssetsPaths.icRemoveUser : AssetsPaths.icAddUser,
width: 11.w,
height: 11.w,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
],
label: isContact ? 'Remove Contact' : 'Add Contact',
suffixIcon: SvgPicture.asset(
isContact ? AssetsPaths.icRemoveUser : AssetsPaths.icAddUser,
width: 11.w,
height: 11.w,
colorFilter: ColorFilter.mode(
context.colors.primary,
BlendMode.srcIn,
),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/chat/chat_management/add_to_group_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class _AddToGroupScreenState extends ConsumerState<AddToGroupScreen> {
bottom: 16.h,
),
child: WnFilledButton(
title: 'Add to Group',
label: 'Add to Group',
loading: _isLoading,
onPressed: _groupsToAddUserTo.isEmpty ? null : _addUserToGroups,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/chat/invite/chat_invite_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _ChatInviteScreenState extends ConsumerState<ChatInviteScreen> {
child: Column(
children: [
WnFilledButton(
title: 'Decline',
label: 'Decline',
visualState: WnButtonVisualState.secondary,
onPressed: () async {
await welcomesNotifier.declineWelcomeInvitation(widget.inviteId);
Expand All @@ -82,7 +82,7 @@ class _ChatInviteScreenState extends ConsumerState<ChatInviteScreen> {
),
Gap(8.h),
WnFilledButton(
title: 'Accept',
label: 'Accept',
loading: _isAccepting,
onPressed:
_isAccepting
Expand Down
Loading