Add custom toast alignment support#821
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for custom toast alignment by converting FToastAlignment from an enum to a final class, allowing users to specify arbitrary positioning beyond the predefined alignment options.
Changes:
- Changed
FToastAlignmentfrom an enum to a final class with a public constructor for custom alignments - Updated golden tests to use named alignment strings instead of enum values
- Added example demonstrating custom alignment usage
Reviewed changes
Copilot reviewed 6 out of 132 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| forui/lib/src/widgets/toast/toaster.dart | Converted FToastAlignment from enum to final class with custom constructor |
| forui/lib/src/widgets/toast/animated_toaster.dart | Fixed switch case ordering for alignment transforms |
| forui/test/src/widgets/toast/toaster_golden_test.dart | Updated tests to use named strings and added custom alignment test case |
| forui/CHANGELOG.md | Documented the breaking change from enum to final class |
| docs_snippets/lib/main.dart | Added route for custom alignment example |
| docs_snippets/lib/examples/widgets/toast.dart | Added example page demonstrating custom alignment |
Comments suppressed due to low confidence (1)
forui/test/src/widgets/toast/toaster_golden_test.dart:1
- The custom alignment test case uses
FToastAlignment(const Alignment(-0.5, -0.5), 1)but there's no verification that this custom alignment actually positions the toast correctly. Consider adding a specific test that validates the custom alignment behavior beyond golden file comparison, particularly testing edge cases for thetoastAlignmentparameter bounds (e.g., -1, 0, 1).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Documentation Preview
You're seeing this because the docs/samples were updated. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe the changes
Fixes #743
Checklist