[imp]: Use username for navigation label

This commit is contained in:
nahnah
2026-02-14 23:25:15 +00:00
parent 27b898f858
commit c3106cd341
3 changed files with 75 additions and 45 deletions
+18 -4
View File
@@ -255,7 +255,11 @@ class _FloridAppState extends State<FloridApp> {
FloridNavBarItem(
icon: userIcon,
selectedIcon: userSelectedIcon,
label: "User",
label: settings.userName.isNotEmpty
? (settings.userName.length > 10
? '${settings.userName.substring(0, 10)}...'
: settings.userName)
: 'User',
),
];
@@ -273,7 +277,13 @@ class _FloridAppState extends State<FloridApp> {
NavigationRailDestination(
icon: userIcon,
selectedIcon: userSelectedIcon,
label: const Text('Me'),
label: Text(
settings.userName.isNotEmpty
? (settings.userName.length > 10
? '${settings.userName.substring(0, 10)}...'
: settings.userName)
: 'User',
),
),
];
@@ -501,14 +511,18 @@ class _FloridAppState extends State<FloridApp> {
),
label: localizations.device,
),
const NavigationDestination(
NavigationDestination(
icon: Icon(Symbols.person_rounded),
selectedIcon: Icon(
Symbols.person_rounded,
fill: 1,
weight: 600,
),
label: 'User',
label: settings.userName.isNotEmpty
? (settings.userName.length > 10
? '${settings.userName.substring(0, 10)}...'
: settings.userName)
: 'User',
),
];
+8 -4
View File
@@ -282,10 +282,14 @@ class _UserScreenState extends State<UserScreen>
: const Icon(Symbols.person),
),
const SizedBox(width: 12),
Text(
settingsProvider.userName.isNotEmpty
? settingsProvider.userName
: 'User',
Flexible(
child: Text(
settingsProvider.userName.isNotEmpty
? settingsProvider.userName
: 'User',
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
+49 -37
View File
@@ -74,47 +74,59 @@ class FNavBar extends StatelessWidget {
spacing: 16.0,
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconTheme(
data: IconThemeData(
color: selected
? selectedColor
: unselectedColor,
Flexible(
child: IconTheme(
data: IconThemeData(
color: selected
? selectedColor
: unselectedColor,
),
child: selected
? item.selectedIcon
: item.icon,
),
child: selected
? item.selectedIcon
: item.icon,
),
if (selected)
AnimatedDefaultTextStyle(
duration: const Duration(
milliseconds: 180,
),
curve: Curves.easeOut,
style: isFlorid
? TextStyle(
color: selected
? selectedColor
: unselectedColor,
fontSize: 14,
fontVariations: [
FontVariation(
'ROND',
100,
),
],
)
: TextStyle(inherit: true),
child: Text(item.label),
)
.animate()
.fadeIn(duration: 180.ms)
.slideX(
begin: 0.5,
end: 0,
duration: 180.ms,
curve: Curves.easeOut,
),
Flexible(
child:
AnimatedDefaultTextStyle(
duration: const Duration(
milliseconds: 180,
),
curve: Curves.easeOut,
style: isFlorid
? TextStyle(
color: selected
? selectedColor
: unselectedColor,
fontSize: 14,
fontVariations: [
FontVariation(
'ROND',
100,
),
],
)
: TextStyle(
inherit: true,
),
child: Text(
item.label,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
),
)
.animate()
.fadeIn(duration: 180.ms)
.slideX(
begin: 0.5,
end: 0,
duration: 180.ms,
curve: Curves.easeOut,
),
),
],
),
),