CNSidebarItem class
A row of a CNSidebar: a title, an icon and an optional badge.
The icon is, by priority, imageAsset, then customIcon, then
sfSymbol, as in CNTabBarItem. The active variants are drawn while
the row is selected and default to the plain ones.
- Annotations
Constructors
- CNSidebarItem({required String title, CNSymbol? sfSymbol, CNSymbol? activeSfSymbol, IconData? customIcon, IconData? activeCustomIcon, CNImageAsset? imageAsset, CNImageAsset? activeImageAsset, String? badge})
-
Creates a sidebar row.
const
Properties
- activeCustomIcon → IconData?
-
customIcon while the row is selected. Defaults to customIcon.
final
- activeImageAsset → CNImageAsset?
-
imageAsset while the row is selected. Defaults to imageAsset.
final
- activeSfSymbol → CNSymbol?
-
The SF Symbol while the row is selected. Defaults to sfSymbol.
final
- badge → String?
-
A count or short text at the trailing end of the row, such as an unread
count, read by VoiceOver as the row's value. dotBadge shows a dot.
final
- customIcon → IconData?
-
A Flutter icon (
CupertinoIcons,Icons…) drawn as a template image, tinted like a symbol. Takes precedence over sfSymbol.final - hashCode → int
-
The hash code for this object.
no setteroverride
- imageAsset → CNImageAsset?
-
An image asset (PNG, JPG or SVG, or raw bytes) before the title. A
single-coloured image is tinted like a symbol. Takes precedence over
customIcon and sfSymbol.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sfSymbol → CNSymbol?
-
The SF Symbol before the title.
final
- title → String
-
The row's text, and its VoiceOver label.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override