Fluent2Account class
Who the app belongs to, as its chrome shows them: their name and
initials (or image) in the avatar, the quiet meta line under the
name at the nav pane's foot, the unread count the bell wears, and
where the avatar (onProfile) and the bell (onNotifications) lead.
The app mounts one Fluent2AccountScope above its router; the top bars
and the nav pane read it, so no page passes the person around.
profileLocation is the profile page's path: the pane's foot is
current there (a :name segment stands for any one, so
'/:root/profile' is the profile pushed on any root).
notificationsLocation is the bell's page.
Fluent2Account(name: 'Ines Duarte', initials: 'ID', meta: 'ines@northwind.example', unread: 3, onProfile: (context) => Navigator.of(context).pushNamed('/profile'))
- Annotations
Constructors
-
Fluent2Account({required String name, required String initials, String? meta, ImageProvider<
Object> ? image, int unread = 0, void onProfile(BuildContext context)?, void onNotifications(BuildContext context)?, String? profileLocation, String? notificationsLocation}) -
An account called
name.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
image
→ ImageProvider<
Object> ? -
Their picture; null draws the initials.
final
- initials → String
-
One or two letters, the avatar's face.
final
- meta → String?
-
The quiet line under the name (their address, their role).
final
- name → String
-
The person's name.
final
- notificationsLocation → String?
-
The notifications page's path, read as profileLocation is.
final
- onNotifications → void Function(BuildContext context)?
-
Opens the notifications.
final
- onProfile → void Function(BuildContext context)?
-
Opens the profile; run with the tapped control's context.
final
- profileLocation → String?
-
The profile page's path ('/home/profile', or '/:root/profile').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unread → int
-
How many notifications are unread: the bell wears the count while
more than none.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
showsNotifications(
String path) → bool -
Whether the page at
pathis the notifications, or a page under it. -
showsProfile(
String path) → bool -
Whether the page at
pathis the profile, or a page under it. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited