Dark mode

This commit is contained in:
LittleSheep 2024-05-01 22:35:58 +08:00
parent 7c4427e84a
commit fceb3edbc6
5 changed files with 13 additions and 6 deletions

View File

@ -30,9 +30,16 @@ class SolianApp extends StatelessWidget {
return MaterialApp.router( return MaterialApp.router(
title: 'Solian', title: 'Solian',
theme: ThemeData( theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), brightness: Brightness.light,
colorScheme: ColorScheme.fromSeed(brightness: Brightness.light, seedColor: Colors.indigo),
useMaterial3: true, useMaterial3: true,
), ),
darkTheme: ThemeData(
brightness: Brightness.dark,
colorScheme: ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: Colors.indigo),
useMaterial3: true,
),
themeMode: ThemeMode.system,
localizationsDelegates: AppLocalizations.localizationsDelegates, localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales, supportedLocales: AppLocalizations.supportedLocales,
routerConfig: router, routerConfig: router,

View File

@ -88,7 +88,7 @@ class _ChannelEditorScreenState extends State<ChannelEditorScreen> {
final editingBanner = MaterialBanner( final editingBanner = MaterialBanner(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
leading: const Icon(Icons.edit_note), leading: const Icon(Icons.edit_note),
backgroundColor: const Color(0xFFE0E0E0), backgroundColor: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.9),
dividerColor: const Color.fromARGB(1, 0, 0, 0), dividerColor: const Color.fromARGB(1, 0, 0, 0),
content: Text(AppLocalizations.of(context)!.chatChannelEditNotify), content: Text(AppLocalizations.of(context)!.chatChannelEditNotify),
actions: [ actions: [

View File

@ -109,7 +109,7 @@ class _CommentEditorScreenState extends State<CommentEditorScreen> {
final editingBanner = MaterialBanner( final editingBanner = MaterialBanner(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
leading: const Icon(Icons.edit_note), leading: const Icon(Icons.edit_note),
backgroundColor: const Color(0xFFE0E0E0), backgroundColor: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.9),
dividerColor: const Color.fromARGB(1, 0, 0, 0), dividerColor: const Color.fromARGB(1, 0, 0, 0),
content: Text(AppLocalizations.of(context)!.postEditNotify), content: Text(AppLocalizations.of(context)!.postEditNotify),
actions: [ actions: [

View File

@ -99,7 +99,7 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
final editingBanner = MaterialBanner( final editingBanner = MaterialBanner(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
leading: const Icon(Icons.edit_note), leading: const Icon(Icons.edit_note),
backgroundColor: const Color(0xFFE0E0E0), backgroundColor: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.9),
dividerColor: const Color.fromARGB(1, 0, 0, 0), dividerColor: const Color.fromARGB(1, 0, 0, 0),
content: Text(AppLocalizations.of(context)!.postEditNotify), content: Text(AppLocalizations.of(context)!.postEditNotify),
actions: [ actions: [

View File

@ -108,7 +108,7 @@ class _ChatMessageEditorState extends State<ChatMessageEditor> {
final editingBanner = MaterialBanner( final editingBanner = MaterialBanner(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 20),
leading: const Icon(Icons.edit_note), leading: const Icon(Icons.edit_note),
backgroundColor: const Color(0xFFE0E0E0), backgroundColor: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.9),
dividerColor: const Color.fromARGB(1, 0, 0, 0), dividerColor: const Color.fromARGB(1, 0, 0, 0),
content: Text(AppLocalizations.of(context)!.chatMessageEditNotify), content: Text(AppLocalizations.of(context)!.chatMessageEditNotify),
actions: [ actions: [
@ -122,7 +122,7 @@ class _ChatMessageEditorState extends State<ChatMessageEditor> {
final replyingBanner = MaterialBanner( final replyingBanner = MaterialBanner(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 20),
leading: const Icon(Icons.reply), leading: const Icon(Icons.reply),
backgroundColor: const Color(0xFFE0E0E0), backgroundColor: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.9),
dividerColor: const Color.fromARGB(1, 0, 0, 0), dividerColor: const Color.fromARGB(1, 0, 0, 0),
content: Text(AppLocalizations.of(context)!.chatMessageReplyNotify), content: Text(AppLocalizations.of(context)!.chatMessageReplyNotify),
actions: [ actions: [