feat:更新页面颜色

This commit is contained in:
2026-06-17 13:24:37 +08:00
parent 021db2efac
commit 02084ada96
9 changed files with 601 additions and 341 deletions

View File

@@ -1,6 +1,7 @@
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';
void main() async {
@@ -19,6 +20,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
scaffoldBackgroundColor: const Color(0xFF120D25),
brightness: Brightness.light,
useMaterial3: true,
colorScheme: ColorScheme.light(
@@ -43,28 +45,21 @@ class _HomePageState extends State<HomePage> {
int _index = 0;
final _pages = const [
Center(child: MessagePage()),
Center(child: ContactsPage()),
Center(child: Text('⚙ Settings', style: TextStyle(fontSize: 26, color: Colors.white))),
Center(child: Text('⚙ 我的', style: TextStyle(fontSize: 26, color: Colors.white))),
MessagePage(),
ContactsPage(),
ExplorePage(),
Center(child: Text('⚙ 我的', style: TextStyle(fontSize: 26))),
];
@override
Widget build(BuildContext context) {
return GlassScaffold(
background: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xFFFFFFFF), Color(0xFFF5F5F7)],
),
),
),
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),
@@ -91,4 +86,4 @@ class _HomePageState extends State<HomePage> {
body: _pages[_index],
);
}
}
}