Clean up dark mode
This commit is contained in:
parent
38ef2b7807
commit
ea71a97e45
|
@ -38,7 +38,7 @@ class AdaptivePageLayout extends StatelessWidget {
|
|||
),
|
||||
Container(
|
||||
width: 1,
|
||||
color: Color(0xFFE8E8E8),
|
||||
color: Theme.of(context).secondaryHeaderColor, //Color(0xFFE8E8E8),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
|
|
|
@ -11,7 +11,7 @@ import '../../utils/date_time_extension.dart';
|
|||
import '../../utils/event_extension.dart';
|
||||
import '../../utils/room_extension.dart';
|
||||
import '../../views/chat.dart';
|
||||
import '../ThemeSwitcher.dart';
|
||||
import '../theme_switcher.dart';
|
||||
import '../avatar.dart';
|
||||
import '../dialogs/simple_dialogs.dart';
|
||||
import '../matrix.dart';
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../utils/famedlysdk_store.dart';
|
||||
import 'matrix.dart';
|
||||
|
||||
enum Themes {
|
||||
|
@ -49,6 +47,16 @@ final ThemeData darkTheme = ThemeData.dark().copyWith(
|
|||
scaffoldBackgroundColor: Color(0xff121212),
|
||||
accentColor: Color(0xFFF5B4D2),
|
||||
secondaryHeaderColor: Color(0xff1D1D1D),
|
||||
dialogTheme: DialogTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
brightness: Brightness.dark,
|
||||
color: Color(0xff1D1D1D),
|
||||
|
@ -70,6 +78,16 @@ final ThemeData amoledTheme = ThemeData.dark().copyWith(
|
|||
scaffoldBackgroundColor: Colors.black,
|
||||
accentColor: Color(0xFFF5B4D2),
|
||||
secondaryHeaderColor: Color(0xff1D1D1D),
|
||||
dialogTheme: DialogTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
brightness: Brightness.dark,
|
||||
color: Color(0xff1D1D1D),
|
||||
|
@ -141,25 +159,15 @@ class ThemeSwitcherWidgetState extends State<ThemeSwitcherWidget> {
|
|||
BuildContext context;
|
||||
|
||||
Future loadSelection(MatrixState matrix) async {
|
||||
if (kIsWeb) {
|
||||
Store store = matrix.client.storeAPI;
|
||||
String item = await store.getItem("theme") ?? "light";
|
||||
selectedTheme =
|
||||
Themes.values.firstWhere((e) => e.toString() == 'Themes.' + item);
|
||||
String item = await matrix.client.storeAPI.getItem("theme") ?? "light";
|
||||
selectedTheme =
|
||||
Themes.values.firstWhere((e) => e.toString() == 'Themes.' + item);
|
||||
|
||||
amoledEnabled =
|
||||
(await store.getItem("amoled_enabled") ?? "false").toLowerCase() ==
|
||||
'true';
|
||||
} else {
|
||||
ExtendedStore store = matrix.client.storeAPI;
|
||||
String item = await store.getItem("theme") ?? "light";
|
||||
selectedTheme =
|
||||
Themes.values.firstWhere((e) => e.toString() == 'Themes.' + item);
|
||||
amoledEnabled =
|
||||
(await matrix.client.storeAPI.getItem("amoled_enabled") ?? "false")
|
||||
.toLowerCase() ==
|
||||
'true';
|
||||
|
||||
amoledEnabled =
|
||||
(await store.getItem("amoled_enabled") ?? "false").toLowerCase() ==
|
||||
'true';
|
||||
}
|
||||
switchTheme(matrix, selectedTheme, amoledEnabled);
|
||||
return;
|
||||
}
|
||||
|
@ -205,23 +213,12 @@ class ThemeSwitcherWidgetState extends State<ThemeSwitcherWidget> {
|
|||
}
|
||||
|
||||
Future saveThemeValue(MatrixState matrix, Themes value) async {
|
||||
if (kIsWeb) {
|
||||
Store store = matrix.client.storeAPI;
|
||||
await store.setItem("theme", value.toString().split('.').last);
|
||||
} else {
|
||||
ExtendedStore store = matrix.client.storeAPI;
|
||||
await store.setItem("theme", value.toString().split('.').last);
|
||||
}
|
||||
await matrix.client.storeAPI
|
||||
.setItem("theme", value.toString().split('.').last);
|
||||
}
|
||||
|
||||
Future saveAmoledEnabledValue(MatrixState matrix, bool value) async {
|
||||
if (kIsWeb) {
|
||||
Store store = matrix.client.storeAPI;
|
||||
await store.setItem("amoled_enabled", value.toString());
|
||||
} else {
|
||||
ExtendedStore store = matrix.client.storeAPI;
|
||||
await store.setItem("amoled_enabled", value.toString());
|
||||
}
|
||||
await matrix.client.storeAPI.setItem("amoled_enabled", value.toString());
|
||||
}
|
||||
|
||||
void setup() async {
|
|
@ -5,7 +5,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
|
|||
|
||||
import 'i18n/i18n.dart';
|
||||
import 'views/sign_up.dart';
|
||||
import 'components/ThemeSwitcher.dart';
|
||||
import 'components/theme_switcher.dart';
|
||||
import 'components/matrix.dart';
|
||||
import 'views/chat_list.dart';
|
||||
|
||||
|
|
|
@ -202,7 +202,12 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
ChatSettingsPopupMenu(widget.room, false)
|
||||
],
|
||||
title: Text(widget.room.getLocalizedDisplayname(context),
|
||||
style: TextStyle(color: Colors.black)),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.appBarTheme
|
||||
.textTheme
|
||||
.headline6
|
||||
.color)),
|
||||
backgroundColor: Theme.of(context).appBarTheme.color,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: ContentBanner(widget.room.avatar,
|
||||
|
@ -221,7 +226,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
ListTile(
|
||||
leading: widget.room.canSendEvent("m.room.topic")
|
||||
? CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.edit),
|
||||
)
|
||||
|
@ -257,7 +263,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
if (widget.room.canSendEvent("m.room.name"))
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.people),
|
||||
),
|
||||
|
@ -270,7 +277,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
widget.room.joinRules == JoinRules.public)
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.link),
|
||||
),
|
||||
|
@ -284,7 +292,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.public)),
|
||||
title: Text(
|
||||
|
@ -316,7 +325,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.visibility),
|
||||
),
|
||||
|
@ -363,7 +373,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.info_outline),
|
||||
),
|
||||
|
@ -436,7 +447,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
title: Text(I18n.of(context).loadCountMoreParticipants(
|
||||
(actualMembersCount - members.length).toString())),
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
child: Icon(
|
||||
Icons.refresh,
|
||||
color: Colors.grey,
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
|||
import 'package:toast/toast.dart';
|
||||
import 'package:uni_links/uni_links.dart';
|
||||
|
||||
import '../components/ThemeSwitcher.dart';
|
||||
import '../components/theme_switcher.dart';
|
||||
import '../components/adaptive_page_layout.dart';
|
||||
import '../components/list_items/chat_list_item.dart';
|
||||
import '../components/matrix.dart';
|
||||
|
|
|
@ -114,8 +114,15 @@ class _SettingsState extends State<Settings> {
|
|||
pinned: true,
|
||||
backgroundColor: Theme.of(context).appBarTheme.color,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
title: Text(I18n.of(context).settings,
|
||||
style: TextStyle(color: Colors.black)),
|
||||
title: Text(
|
||||
I18n.of(context).settings,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.appBarTheme
|
||||
.textTheme
|
||||
.headline6
|
||||
.color),
|
||||
),
|
||||
background: ContentBanner(
|
||||
profile?.avatarUrl ?? MxContent(""),
|
||||
height: 300,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../components/ThemeSwitcher.dart';
|
||||
import '../components/theme_switcher.dart';
|
||||
import '../components/adaptive_page_layout.dart';
|
||||
import '../components/matrix.dart';
|
||||
import '../i18n/i18n.dart';
|
||||
|
@ -82,7 +82,7 @@ class ThemesSettingsState extends State<ThemesSettings> {
|
|||
});
|
||||
},
|
||||
),
|
||||
Divider(thickness: 8),
|
||||
Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
I18n.of(context).useAmoledTheme,
|
||||
|
|
Loading…
Reference in a new issue