FrostedAccount class
Who the app belongs to, as its chrome shows them: the initials in the
avatar, the name and the quiet meta line ("Profile and settings")
at the sidebar's foot, the unread count the bell wears, and where the
avatar (onProfile) and the bell (onNotifications) lead. The app
mounts one FrostedAccountScope above its router; the top bars and the
sidebar read it, so no page passes the person around. profileLocation
is the profile page's path: the sidebar'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, where
the sidebar marks nothing current, as the source's notifications do.
FrostedAccount(name: 'Maren Holt', initials: 'MH', meta: 'Profile and settings', unread: 1, onProfile: (context) => Navigator.of(context).pushNamed('/profile'))
- Annotations
Constructors
- FrostedAccount({required String name, required String initials, String? meta, int unread = 0, void onProfile(BuildContext context)?, void onNotifications(BuildContext context)?, String? profileLocation, String? notificationsLocation})
-
Creates a FrostedAccount.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initials → String
-
One or two letters, the avatar's face.
final
- meta → String?
-
The quiet line under the name.
final
- name → String
-
The person's name, as the sidebar's foot prints it.
final
- notificationsLocation → String?
-
The notifications page's path, read as profileLocation is
('/:root/notifications'): while it is shown the sidebar marks no
destination current, as the source's notifications light none.
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 (under the
router).
final
- profileLocation → String?
-
The profile page's path, where the sidebar's foot is current: read as
written ('/home/profile'), or with go_router's
:namesegments standing for any one segment ('/:root/profile', the profile pushed on any root, as a router that nests it under every branch has it).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unread → int
-
How many notifications are unread: the bell wears its dot 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, by notificationsLocation. -
showsProfile(
String path) → bool -
Whether the page at
pathis the profile, or a page under it, by profileLocation. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited