Skip to content
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

feat: add AdaptivePrimaryButton components #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

PouriaMoradi021
Copy link
Contributor

No description provided.

- add a temporary sample button components with fluent-ui widget by using `FilledButton`
- add a temporary sample use-case for this widget
- update `main` file & add `FluentApp` to `themeBuilder` section so that we can use fluent-ui widgets
- update `main.directories.dart`
@PouriaMoradi021 PouriaMoradi021 added the enhancement New feature or request label Jan 15, 2025
@PouriaMoradi021 PouriaMoradi021 self-assigned this Jan 15, 2025
@PouriaMoradi021 PouriaMoradi021 linked an issue Jan 15, 2025 that may be closed by this pull request
- add/create `RequestStateEnum` for handling different state of components
- add/create `AdaptiveButtonContentWidget`
- update `AdaptivePrimaryButton`
- update `adaptivePrimaryButtonUseCase`
- update `AppThemeData` & add `lightAccentColors` & `darkAccentColors`
- update `main` file & add a knobs for selecting & changing accent colors
- update `main.directories.dart`
- code style
@PouriaMoradi021 PouriaMoradi021 force-pushed the feat/add-button-components-states-modes branch from 032267e to af49c74 Compare January 16, 2025 10:54
- add/create `AdaptiveSecondaryButton` widget
- add/create `adaptiveSecondaryButtonUseCase`
- add/create `AppColors`
- add some tests for different states of `AdaptivePrimaryButton`
- add some tests for different states of `AdaptiveSecondaryButton`
@PouriaMoradi021 PouriaMoradi021 force-pushed the feat/add-button-components-states-modes branch from 98aeec4 to 4f548f4 Compare January 17, 2025 11:10
@esmaeil-ahmadipour esmaeil-ahmadipour added the feature Add/Create new feature label Jan 17, 2025
Color(0xFF00B294),
Color(0xFF107C10),
Color(0xFF131440),
];
Copy link
Contributor

@phoenixit99 phoenixit99 Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider creating named constants for each color to make their purpose clearer
for example:

'primary': Color(0xFF0A4D7E),    // First blue
'warning': Color(0xFFD4540A),    // Orange
'error': Color(0xFFA7101A),      // Red 

/// TODO (by Pouria): add loading & error state after defining by UI team
case RequestStateEnum.loading:
return const SizedBox();
case RequestStateEnum.initial:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current loading state returns an empty SizedBox. This should be improved with a proper loading indicator

),
);
case RequestStateEnum.error:
return const SizedBox();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current error state returns an empty SizedBox. This should provide visual feedback

side: const BorderSide(
color: AppColors.borderColor,
width: 1,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the border 'RoundedRectangleBorder' is duplicate. Consider create a common

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature Add/Create new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ‌Button Components with different state and modes
3 participants