-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,44 @@ | ||
# The Banner Widget | ||
|
||
Did you know? | ||
|
||
You can use the `Banner` widget to place a small diagonal banner over a child widget. | ||
|
||
Note that `Banner` only offers limited customization options. If you need more custom styling, consider building your own using a custom painter. | ||
|
||
![](215.png) | ||
|
||
<!-- | ||
// Use Banner to place a small diagonal banner over a child widget | ||
Banner( | ||
message: 'TOP START', | ||
location: BannerLocation.topStart, | ||
color: Colors.red, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(20), | ||
child: Image.asset( | ||
'assets/common/app-icon.png', | ||
height: 160, | ||
), | ||
), | ||
) | ||
// Location, color, and text style are configurable, but the banner size is fixed, and this can cause the text to wrap. | ||
--> | ||
|
||
--- | ||
|
||
Note: `Banner` is very closely related to `CheckedModeBanner`, which shows inside your MaterialApp in debug mode. | ||
|
||
For more info, check the official docs: | ||
|
||
- [Banner class](https://api.flutter.dev/flutter/widgets/Banner-class.html) | ||
|
||
--- | ||
|
||
| Previous | Next | | ||
| -------- | ---- | | ||
| [Improve your code with Cursor Edit Mode](../0214-cursor-edit-mode/index.md) | | | ||
|
||
<!-- TWITTER|https://x.com/biz84/status/1866482324105490628 --> | ||
<!-- LINKEDIN|https://www.linkedin.com/posts/andreabizzotto_did-you-know-you-can-use-the-banner-widget-activity-7272248288236519424-tfzF- --> | ||
<!-- BLUESKY|https://bsky.app/profile/codewithandrea.com/post/3lcxfixclys2f --> |