57 lines
1.7 KiB
Dart
57 lines
1.7 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:please_pay_me/features/budgets/budgets_screen.dart';
|
|
import 'package:please_pay_me/features/journal/journal_screen.dart';
|
|
import 'package:please_pay_me/features/overview/overview_screen.dart';
|
|
import 'package:please_pay_me/features/profile/profile_screen.dart';
|
|
import 'package:please_pay_me/features/work/work_screen.dart';
|
|
import 'package:please_pay_me/ui/ui.dart';
|
|
|
|
/// Root tab bar. Each tab keeps its own navigator so modal sheets and alerts
|
|
/// stay inside the tab, as iOS expects.
|
|
class HomeTabs extends StatelessWidget {
|
|
const HomeTabs({super.key});
|
|
|
|
static const _tabs = [
|
|
AppTabItem(
|
|
icon: CupertinoIcons.chart_pie,
|
|
activeIcon: CupertinoIcons.chart_pie_fill,
|
|
label: 'Обзор',
|
|
),
|
|
AppTabItem(
|
|
icon: CupertinoIcons.list_bullet,
|
|
label: 'Журнал',
|
|
),
|
|
AppTabItem(
|
|
icon: CupertinoIcons.money_rubl_circle,
|
|
activeIcon: CupertinoIcons.money_rubl_circle_fill,
|
|
label: 'Бюджеты',
|
|
),
|
|
AppTabItem(
|
|
icon: CupertinoIcons.briefcase,
|
|
activeIcon: CupertinoIcons.briefcase_fill,
|
|
label: 'Работа',
|
|
),
|
|
AppTabItem(
|
|
icon: CupertinoIcons.person,
|
|
activeIcon: CupertinoIcons.person_fill,
|
|
label: 'Профиль',
|
|
),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CupertinoTabScaffold(
|
|
tabBar: AppTabBar(items: _tabs, currentIndex: 0, onTap: (_) {}),
|
|
tabBuilder: (context, index) => CupertinoTabView(
|
|
builder: (context) => switch (index) {
|
|
0 => const OverviewScreen(),
|
|
1 => const JournalScreen(),
|
|
2 => const BudgetsScreen(),
|
|
3 => const WorkScreen(),
|
|
_ => const ProfileScreen(),
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|