mirror of
https://github.com/block/buzz.git
synced 2026-11-10 11:21:05 +00:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
51 lines
1.5 KiB
Dart
51 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
|
|
import '../activity/activity_page.dart';
|
|
import '../channels/channels_page.dart';
|
|
import '../pulse/pulse_page.dart';
|
|
import '../search/search_page.dart';
|
|
|
|
class HomePage extends HookConsumerWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final tabIndex = useState(0);
|
|
|
|
const pages = [ChannelsPage(), PulsePage(), ActivityPage(), SearchPage()];
|
|
|
|
return Scaffold(
|
|
body: IndexedStack(index: tabIndex.value, children: pages),
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: tabIndex.value,
|
|
onDestinationSelected: (i) => tabIndex.value = i,
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(LucideIcons.house),
|
|
selectedIcon: Icon(LucideIcons.house),
|
|
label: 'Home',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(LucideIcons.activity),
|
|
selectedIcon: Icon(LucideIcons.activity),
|
|
label: 'Pulse',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(LucideIcons.bell),
|
|
selectedIcon: Icon(LucideIcons.bell),
|
|
label: 'Activity',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(LucideIcons.search),
|
|
selectedIcon: Icon(LucideIcons.search),
|
|
label: 'Search',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|