💄 Optimize tabs design
This commit is contained in:
@@ -48,7 +48,6 @@ class RealmListScreen extends HookConsumerWidget {
|
|||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
isNoBackground: false,
|
isNoBackground: false,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: const PageBackButton(backTo: '/account'),
|
|
||||||
title: const Text('realms').tr(),
|
title: const Text('realms').tr(),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
import 'package:collection/collection.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
@@ -83,7 +84,7 @@ class TabsScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
label: 'realms'.tr(),
|
label: 'realms'.tr(),
|
||||||
icon: const Icon(Symbols.group_rounded),
|
icon: const Icon(Symbols.groups_3),
|
||||||
),
|
),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
label: 'account'.tr(),
|
label: 'account'.tr(),
|
||||||
@@ -149,14 +150,21 @@ class TabsScreen extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
NavigationRail(
|
NavigationRail(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
destinations: destinations
|
destinations: destinations.mapIndexed((idx, d) {
|
||||||
.map(
|
if (d.icon is Icon) {
|
||||||
(e) => NavigationRailDestination(
|
return NavigationRailDestination(
|
||||||
icon: e.icon,
|
icon: Icon(
|
||||||
label: Text(e.label),
|
(d.icon as Icon).icon,
|
||||||
|
fill: currentIndex == idx ? 1 : null,
|
||||||
),
|
),
|
||||||
)
|
label: Text(d.label),
|
||||||
.toList(),
|
);
|
||||||
|
}
|
||||||
|
return NavigationRailDestination(
|
||||||
|
icon: d.icon,
|
||||||
|
label: Text(d.label),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
selectedIndex: currentIndex,
|
selectedIndex: currentIndex,
|
||||||
onDestinationSelected: onDestinationSelected,
|
onDestinationSelected: onDestinationSelected,
|
||||||
),
|
),
|
||||||
@@ -208,7 +216,18 @@ class TabsScreen extends HookConsumerWidget {
|
|||||||
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
||||||
child: NavigationBar(
|
child: NavigationBar(
|
||||||
height: 56,
|
height: 56,
|
||||||
destinations: destinations,
|
destinations: destinations.mapIndexed((idx, d) {
|
||||||
|
if (d.icon is Icon) {
|
||||||
|
return NavigationDestination(
|
||||||
|
icon: Icon(
|
||||||
|
(d.icon as Icon).icon,
|
||||||
|
fill: currentIndex == idx ? 1 : null,
|
||||||
|
),
|
||||||
|
label: d.label,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}).toList(),
|
||||||
selectedIndex: currentIndex,
|
selectedIndex: currentIndex,
|
||||||
onDestinationSelected: onDestinationSelected,
|
onDestinationSelected: onDestinationSelected,
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
|
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
|
||||||
|
|||||||
Reference in New Issue
Block a user