mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-06 11:15:48 -06:00
42 lines
1.0 KiB
Dart
42 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class RouteDescription {
|
|
final String label;
|
|
final Icon icon;
|
|
final Icon selectedIcon;
|
|
final Widget Function(Widget icon)? badgeBuilder;
|
|
final bool enabled;
|
|
|
|
RouteDescription({
|
|
required this.label,
|
|
required this.icon,
|
|
required this.selectedIcon,
|
|
this.badgeBuilder,
|
|
this.enabled = true,
|
|
});
|
|
|
|
NavigationDestination toNavigationDestination() {
|
|
return NavigationDestination(
|
|
label: label,
|
|
icon: badgeBuilder?.call(icon) ?? icon,
|
|
selectedIcon: badgeBuilder?.call(selectedIcon) ?? selectedIcon,
|
|
);
|
|
}
|
|
|
|
NavigationRailDestination toNavigationRailDestination() {
|
|
return NavigationRailDestination(
|
|
label: Text(label),
|
|
icon: icon,
|
|
selectedIcon: selectedIcon,
|
|
);
|
|
}
|
|
|
|
BottomNavigationBarItem toBottomNavigationBarItem() {
|
|
return BottomNavigationBarItem(
|
|
label: label,
|
|
icon: badgeBuilder?.call(icon) ?? icon,
|
|
activeIcon: badgeBuilder?.call(selectedIcon) ?? selectedIcon,
|
|
);
|
|
}
|
|
}
|