import 'package:ltx_flutter/pages/account_page.dart'; import 'package:ltx_flutter/pages/categories_page.dart'; import 'package:ltx_flutter/pages/today_page.dart'; import 'package:flutter/material.dart'; import 'package:ltx_flutter/pages/today_views/infinity_view.dart'; import '../app_properties_bloc.dart'; class TabsPage extends StatefulWidget { const TabsPage({Key? key}) : super(key: key); @override _TabsPageState createState() => _TabsPageState(); } class _TabsPageState extends State { int _selectedIndex = 0; static const _widgets = [TodayPage(), InfinityView(), CategoriesPage(), AccountPage()]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( // appBar: AppBar( // title: StreamBuilder( // stream: appBloc.titleStream, // initialData: "Flutter", // builder: (context, snapshot) { // return Text(snapshot.data.toString()); // }), // ), body: _widgets.elementAt(_selectedIndex), bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, items: const [ BottomNavigationBarItem( icon: Icon(Icons.today_outlined), label: "Today"), BottomNavigationBarItem( icon: Icon(Icons.all_inclusive), label: "Grid"), BottomNavigationBarItem( icon: Icon(Icons.category_outlined), label: "Categories"), BottomNavigationBarItem( icon: Icon(Icons.account_circle_outlined), label: "Account") ], currentIndex: _selectedIndex, onTap: _onItemTapped, ), ); } }