-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/UI enhacement #140
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
Merged
Merged
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
6e62296
feat(l10n): add localization for user promotion and demotion dialogs
fulleni b9c5e78
build(l10n): sync
fulleni bd9deb2
feat(ui): add AppUserRoleUI extension for premium user helpers
fulleni 89efeb9
feat(shared): add ConfirmationDialog widget
fulleni 0add089
feat(user_management): enhance user filtering functionality
fulleni 9acfce0
refactor(user_management): update UserFilterState for enhanced user f…
fulleni 585bad8
refactor(user_management): update UserFilterEvent properties and remo…
fulleni 788d1dc
refactor(user_management): update user filter logic and enums
fulleni f3c10c5
feat(user_management): add authentication filter enum and localization
fulleni 4c8a0f0
feat(user_management): add subscription filter enum and localization
fulleni faeb855
feat(user_management): add UI-related helper for dashboard user roles
fulleni 1cc7917
feat(user_management): add confirmation dialogs for promote and demot…
fulleni d50c2bb
refactor(user_filter_dialog): update state to use filter enums
fulleni 288e6db
refactor(user_management): update user filter dialog events
fulleni 30ae36f
refactor(user_management): update UserFilterDialogBloc with new filters
fulleni 855d14b
refactor(user_management): revamp user filter dialog
fulleni 8c2d001
chore: barrels
fulleni 84a4143
feat(l10n): add tooltips for premium and privileged users
fulleni 2f8d681
build(l10n): sync.
fulleni 09122de
refactor(user_management): replace indicator dots with tooltip icons
fulleni 20c84ca
feat(l10n): improve user role tooltips and translations
fulleni 18ec2c1
build(l10n): sync
fulleni 6385ec4
feat(user_management): add dashboard role filter functionality
fulleni 3f8f9df
fix(user-management): wrap user email in SingleChildScrollView for sc…
fulleni 2f01319
fix(user_management): remove redundant role filter check
fulleni ca35dd9
fix(user_management): update user filter dialog
fulleni 81ff7a2
refactor(user-management): improve code readability in UserFilterDial…
fulleni 9028e5a
fix(user-management): adjust role selection logic in user filter dialog
fulleni df5f1e9
feat(ui): wrap premium icon with tooltip for screen readers
fulleni 6153f23
refactor(user_management): remove unused buildFilterMap function
fulleni a60e33b
refactor(users): improve email display and role icon logic
fulleni 6efae19
style: format
fulleni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import 'package:core/core.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| /// An extension on [AppUserRole] to provide UI-related helpers. | ||
| extension AppUserRoleUI on AppUserRole { | ||
| /// A convenience getter to check if the user role is premium. | ||
| bool get isPremium => this == AppUserRole.premiumUser; | ||
|
|
||
| /// Returns a premium indicator icon if the user is a premium user. | ||
| /// | ||
| /// Returns a gold star icon for premium users, otherwise returns null. | ||
| Widget? get premiumIcon { | ||
| if (isPremium) { | ||
| return const Padding( | ||
| padding: EdgeInsets.only(left: 8), | ||
| child: Icon(Icons.star, color: Colors.amber, size: 16), | ||
| ); | ||
| } | ||
| return null; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart'; | ||
|
|
||
| /// {@template confirmation_dialog} | ||
| /// A reusable dialog to confirm a user action. | ||
| /// | ||
| /// This dialog displays a title, content, and two buttons: a cancel button | ||
| /// and a confirm button. The text for these buttons and the action to be | ||
| /// performed on confirmation are customizable. | ||
| /// {@endtemplate} | ||
| class ConfirmationDialog extends StatelessWidget { | ||
| /// {@macro confirmation_dialog} | ||
| const ConfirmationDialog({ | ||
| required this.title, | ||
| required this.content, | ||
| required this.onConfirm, | ||
| this.confirmText, | ||
| super.key, | ||
| }); | ||
|
|
||
| /// The title of the dialog. | ||
| final String title; | ||
|
|
||
| /// The main content or question of the dialog. | ||
| final String content; | ||
|
|
||
| /// The callback to be executed when the user confirms the action. | ||
| final VoidCallback onConfirm; | ||
|
|
||
| /// The text for the confirmation button. Defaults to 'Confirm'. | ||
| final String? confirmText; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| final l10n = AppLocalizationsX(context).l10n; | ||
|
|
||
| return AlertDialog( | ||
| title: Text(title), | ||
| content: Text(content), | ||
| actions: <Widget>[ | ||
| TextButton( | ||
| onPressed: () => Navigator.of(context).pop(), | ||
| child: Text(l10n.cancelButton), | ||
| ), | ||
| ElevatedButton( | ||
| onPressed: () { | ||
| Navigator.of(context).pop(); | ||
| onConfirm(); | ||
| }, | ||
| child: Text(confirmText ?? l10n.confirmSaveButton), | ||
| ), | ||
| ], | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export 'searchable_selection_page.dart'; | ||
| export 'selection_page_arguments.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| export 'package:flutter_news_app_web_dashboard_full_source_code/shared/widgets/about_icon.dart'; | ||
| export 'package:flutter_news_app_web_dashboard_full_source_code/shared/widgets/searchable_selection_input.dart'; | ||
| export 'about_icon.dart'; | ||
| export 'confirmation_dialog.dart'; | ||
| export 'searchable_selection_input.dart'; | ||
| export 'selection_page/selection_page.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.