63 lines
1.9 KiB
Dart
63 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:liquid_glass_widgets/widgets/shared/glass_page.dart';
|
|
import 'package:liquid_glass_widgets/widgets/surfaces/glass_bottom_bar.dart';
|
|
import 'package:liquid_glass_widgets/widgets/surfaces/glass_scaffold.dart';
|
|
import 'package:sweet_chat_app/pages/contacts_page.dart';
|
|
import 'package:sweet_chat_app/pages/explore_page.dart';
|
|
import 'package:sweet_chat_app/pages/messages_page.dart';
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
State<HomePage> createState() => _HomePageState();
|
|
}
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
int _index = 0;
|
|
|
|
final _pages = [
|
|
const MessagePage(),
|
|
const ContactsPage(),
|
|
const ExplorePage(),
|
|
const Center(child: Text('⚙ 我的', style: TextStyle(fontSize: 26))),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GlassScaffold(
|
|
statusBarStyle: GlassStatusBarStyle.auto,
|
|
bottomBar: GlassBottomBar(
|
|
selectedIndex: _index,
|
|
onTabSelected: (i) => setState(() => _index = i),
|
|
selectedIconColor: Colors.purple.shade200,
|
|
unselectedIconColor: Colors.white,
|
|
tabs: const [
|
|
GlassBottomBarTab(
|
|
icon: Icon(Icons.chat_bubble_outline),
|
|
activeIcon: Icon(Icons.chat_bubble),
|
|
label: '消息',
|
|
),
|
|
GlassBottomBarTab(
|
|
icon: Icon(Icons.contacts_outlined),
|
|
activeIcon: Icon(Icons.contacts),
|
|
label: '通讯录',
|
|
),
|
|
GlassBottomBarTab(
|
|
icon: Icon(Icons.explore_outlined),
|
|
activeIcon: Icon(Icons.explore),
|
|
label: '发现',
|
|
),
|
|
GlassBottomBarTab(
|
|
icon: Icon(Icons.person_outline),
|
|
activeIcon: Icon(Icons.person),
|
|
label: '我的',
|
|
),
|
|
],
|
|
),
|
|
body: _pages[_index],
|
|
);
|
|
}
|
|
}
|