started new navigation bar
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
import 'package:refilc/helpers/quick_actions.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
@@ -234,6 +236,9 @@ class NavigationScreenState extends State<NavigationScreen>
|
||||
_navigatorState.currentState?.pushReplacementNamed(page);
|
||||
});
|
||||
|
||||
// SvgTheme navIcTheme =
|
||||
// SvgTheme(currentColor: Theme.of(context).colorScheme.primary);
|
||||
|
||||
// ignore: deprecated_member_use
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
@@ -255,6 +260,7 @@ class NavigationScreenState extends State<NavigationScreen>
|
||||
child: Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
// actual page
|
||||
Expanded(
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomCenter,
|
||||
@@ -269,49 +275,121 @@ class NavigationScreenState extends State<NavigationScreen>
|
||||
),
|
||||
),
|
||||
|
||||
// Status bar
|
||||
Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: const StatusBar(),
|
||||
),
|
||||
// navbar
|
||||
Container(
|
||||
decoration: settings.navShadow
|
||||
? BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
offset: const Offset(0, -4),
|
||||
blurRadius: 14,
|
||||
spreadRadius: 18,
|
||||
),
|
||||
],
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0.0, 0.175],
|
||||
colors: [
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
],
|
||||
),
|
||||
)
|
||||
: null,
|
||||
child: Column(
|
||||
children: [
|
||||
// Status bar
|
||||
Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: const StatusBar(),
|
||||
),
|
||||
|
||||
// Bottom Navigaton Bar
|
||||
Material(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeTop: true,
|
||||
child: Navbar(
|
||||
selectedIndex: selected.index,
|
||||
onSelected: onPageSelected,
|
||||
items: [
|
||||
NavItem(
|
||||
title: "home".i18n,
|
||||
icon: const Icon(FilcIcons.home),
|
||||
activeIcon: const Icon(FilcIcons.homefill),
|
||||
// Bottom Navigaton Bar
|
||||
Material(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeTop: true,
|
||||
child: Navbar(
|
||||
selectedIndex: selected.index,
|
||||
onSelected: onPageSelected,
|
||||
items: [
|
||||
NavItem(
|
||||
title: "home".i18n,
|
||||
icon: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/svg/menu_icons/today.svg',
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
height: 24,
|
||||
),
|
||||
Transform.translate(
|
||||
offset: const Offset(0, 1.6),
|
||||
child: Text(
|
||||
DateTime.now().day.toString(),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
activeIcon: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/svg/menu_icons/today_selected.svg',
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
height: 24,
|
||||
),
|
||||
Transform.translate(
|
||||
offset: const Offset(0, 1.8),
|
||||
child: Text(
|
||||
DateTime.now().day.toString(),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.background,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
NavItem(
|
||||
title: "grades".i18n,
|
||||
icon: const Icon(FeatherIcons.bookmark),
|
||||
activeIcon: const Icon(FilcIcons.gradesfill),
|
||||
),
|
||||
NavItem(
|
||||
title: "timetable".i18n,
|
||||
icon: const Icon(FeatherIcons.calendar),
|
||||
activeIcon: const Icon(FilcIcons.timetablefill),
|
||||
),
|
||||
NavItem(
|
||||
title: "messages".i18n,
|
||||
icon: const Icon(FeatherIcons.messageSquare),
|
||||
activeIcon: const Icon(FilcIcons.messagesfill),
|
||||
),
|
||||
NavItem(
|
||||
title: "absences".i18n,
|
||||
icon: const Icon(FeatherIcons.clock),
|
||||
activeIcon: const Icon(FilcIcons.absencesfill),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
NavItem(
|
||||
title: "grades".i18n,
|
||||
icon: const Icon(FeatherIcons.bookmark),
|
||||
activeIcon: const Icon(FilcIcons.gradesfill),
|
||||
),
|
||||
NavItem(
|
||||
title: "timetable".i18n,
|
||||
icon: const Icon(FeatherIcons.calendar),
|
||||
activeIcon: const Icon(FilcIcons.timetablefill),
|
||||
),
|
||||
NavItem(
|
||||
title: "messages".i18n,
|
||||
icon: const Icon(FeatherIcons.messageSquare),
|
||||
activeIcon: const Icon(FilcIcons.messagesfill),
|
||||
),
|
||||
NavItem(
|
||||
title: "absences".i18n,
|
||||
icon: const Icon(FeatherIcons.clock),
|
||||
activeIcon: const Icon(FilcIcons.absencesfill),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user