💄 Optimize design
This commit is contained in:
@ -4,9 +4,9 @@ import 'package:get/utils.dart';
|
||||
abstract class AppNavigation {
|
||||
static List<AppNavigationDestination> destinations = [
|
||||
AppNavigationDestination(
|
||||
icon: const Icon(Icons.home),
|
||||
label: 'home'.tr,
|
||||
page: 'home',
|
||||
icon: const Icon(Icons.public),
|
||||
label: 'social'.tr,
|
||||
page: 'social',
|
||||
),
|
||||
AppNavigationDestination(
|
||||
icon: const Icon(Icons.account_circle),
|
||||
@ -21,5 +21,6 @@ class AppNavigationDestination {
|
||||
final String label;
|
||||
final String page;
|
||||
|
||||
AppNavigationDestination({required this.icon, required this.label, required this.page});
|
||||
AppNavigationDestination(
|
||||
{required this.icon, required this.label, required this.page});
|
||||
}
|
||||
|
@ -15,13 +15,15 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return NavigationRail(
|
||||
destinations: AppNavigation.destinations.map(
|
||||
(e) => NavigationRailDestination(
|
||||
icon: e.icon,
|
||||
label: Text(e.label),
|
||||
),
|
||||
).toList(),
|
||||
labelType: NavigationRailLabelType.selected,
|
||||
destinations: AppNavigation.destinations
|
||||
.map(
|
||||
(e) => NavigationRailDestination(
|
||||
icon: e.icon,
|
||||
label: Text(e.label),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
labelType: NavigationRailLabelType.all,
|
||||
selectedIndex: _selectedIndex,
|
||||
onDestinationSelected: (idx) {
|
||||
setState(() => _selectedIndex = idx);
|
||||
|
Reference in New Issue
Block a user