812148658d
* add web support and remove all tabs except chat * Update README.md * feat: setup project for xcode builds + add other tabs back * chore: update macos podfile * chore: update packages + update build config + add audio playback on iOS/macOS + swap downloader library * chore: remove ide-specific files * chore: update readme * chore: update build.gradle to reflect correct minSdkVersion * chore: remove generated ic_launcher png files * chore: update formatting to use 120 char line length * chore: address use of then method on awaited future * chore: update app icons for macOS & iOS * Fix file move not waiting for download finish --------- Co-authored-by: lumey <lumey@lumey.dev> Co-authored-by: Garrett <toast@isota.ch>
83 lines
2.4 KiB
Dart
83 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:recon/widgets/friends/friends_list.dart';
|
|
import 'package:recon/widgets/friends/friends_list_app_bar.dart';
|
|
import 'package:recon/widgets/inventory/inventory_browser.dart';
|
|
import 'package:recon/widgets/inventory/inventory_browser_app_bar.dart';
|
|
import 'package:recon/widgets/sessions/session_list.dart';
|
|
import 'package:recon/widgets/sessions/session_list_app_bar.dart';
|
|
import 'package:recon/widgets/settings_app_bar.dart';
|
|
import 'package:recon/widgets/settings_page.dart';
|
|
|
|
class Home extends StatefulWidget {
|
|
const Home({super.key});
|
|
|
|
@override
|
|
State<Home> createState() => _HomeState();
|
|
}
|
|
|
|
class _HomeState extends State<Home> {
|
|
static const List<Widget> _appBars = [
|
|
FriendsListAppBar(),
|
|
SessionListAppBar(),
|
|
InventoryBrowserAppBar(),
|
|
SettingsAppBar()
|
|
];
|
|
final PageController _pageController = PageController();
|
|
|
|
int _selectedPage = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
|
appBar: PreferredSize(
|
|
preferredSize: const Size.fromHeight(kToolbarHeight),
|
|
child: AnimatedSwitcher(
|
|
duration: const Duration(milliseconds: 200),
|
|
child: _appBars[_selectedPage],
|
|
),
|
|
),
|
|
body: PageView(
|
|
controller: _pageController,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
children: const [
|
|
FriendsList(),
|
|
SessionList(),
|
|
InventoryBrowser(),
|
|
SettingsPage(),
|
|
],
|
|
),
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: _selectedPage,
|
|
onDestinationSelected: (index) {
|
|
_pageController.animateToPage(
|
|
index,
|
|
duration: const Duration(milliseconds: 200),
|
|
curve: Curves.easeOut,
|
|
);
|
|
setState(() {
|
|
_selectedPage = index;
|
|
});
|
|
},
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.message),
|
|
label: "Chat",
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.public),
|
|
label: "Sessions",
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.inventory),
|
|
label: "Inventory",
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.settings),
|
|
label: "Settings",
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|