feat:增加登录页
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:liquid_glass_widgets/liquid_glass_widgets.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';
|
||||
import 'package:sweet_chat_app/pages/login.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -29,61 +27,7 @@ class MyApp extends StatelessWidget {
|
||||
surface: Colors.white,
|
||||
),
|
||||
),
|
||||
home: const HomePage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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(),
|
||||
ContactsPage(),
|
||||
ExplorePage(),
|
||||
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],
|
||||
home: const LoginPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user