mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 17:39:42 +00:00
feat(ui): Try out iOS bottom navbar
This commit is contained in:
parent
e9538a4a84
commit
f1c5fa7d82
|
@ -1,4 +1,7 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/ui/components/drawers/support_drawer.dart';
|
import 'package:selfprivacy/ui/components/drawers/support_drawer.dart';
|
||||||
import 'package:selfprivacy/ui/components/pre_styled_buttons/flash_fab.dart';
|
import 'package:selfprivacy/ui/components/pre_styled_buttons/flash_fab.dart';
|
||||||
|
@ -199,7 +202,22 @@ class _BottomBar extends StatelessWidget {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
),
|
),
|
||||||
child: NavigationBar(
|
child: Platform.isIOS
|
||||||
|
? CupertinoTabBar(
|
||||||
|
currentIndex: prevActiveIndex == -1 ? 0 : prevActiveIndex,
|
||||||
|
onTap: (final index) {
|
||||||
|
context.router.replaceAll([destinations[index].route]);
|
||||||
|
},
|
||||||
|
items: destinations
|
||||||
|
.map(
|
||||||
|
(final destination) => BottomNavigationBarItem(
|
||||||
|
icon: Icon(destination.icon),
|
||||||
|
label: destination.label,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
)
|
||||||
|
: NavigationBar(
|
||||||
selectedIndex: prevActiveIndex == -1 ? 0 : prevActiveIndex,
|
selectedIndex: prevActiveIndex == -1 ? 0 : prevActiveIndex,
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
||||||
onDestinationSelected: (final index) {
|
onDestinationSelected: (final index) {
|
||||||
|
|
Loading…
Reference in a new issue