refactor: Deprecate accentColor

This commit is contained in:
Christian Pauly 2021-05-24 10:59:00 +02:00
parent 445a2498f1
commit ddd5711f79
17 changed files with 60 additions and 39 deletions

View File

@ -34,7 +34,10 @@ abstract class FluffyThemes {
primaryColorLight: Color(0xff121212),
brightness: Brightness.light,
primaryColor: AppConfig.primaryColor,
accentColor: AppConfig.primaryColor,
colorScheme: ThemeData.light().colorScheme.copyWith(
primary: AppConfig.primaryColor,
secondary: AppConfig.primaryColor,
),
backgroundColor: Colors.white,
secondaryHeaderColor: lighten(AppConfig.primaryColor, .51),
scaffoldBackgroundColor: Colors.white,
@ -115,7 +118,10 @@ abstract class FluffyThemes {
errorColor: Color(0xFFCF6679),
backgroundColor: Colors.black,
scaffoldBackgroundColor: Colors.black,
accentColor: AppConfig.primaryColorLight,
colorScheme: ThemeData.dark().colorScheme.copyWith(
primary: AppConfig.primaryColorLight,
secondary: AppConfig.primaryColorLight,
),
secondaryHeaderColor: FluffyThemes.darken(AppConfig.primaryColorLight, .65),
textTheme: Typography.material2018().white.merge(fallback_text_theme),
dialogTheme: DialogTheme(

View File

@ -9,6 +9,7 @@ import 'package:fluffychat/utils/sentry_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'utils/localized_exception_extension.dart';
import 'package:flutter_app_lock/flutter_app_lock.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';

View File

@ -110,7 +110,9 @@ class ChatDetailsView extends StatelessWidget {
title: Text(
'${L10n.of(context).groupDescription}:',
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context)
.colorScheme
.secondary,
fontWeight: FontWeight.bold)),
subtitle: LinkText(
text: room.topic?.isEmpty ?? true
@ -136,7 +138,8 @@ class ChatDetailsView extends StatelessWidget {
title: Text(
L10n.of(context).settings,
style: TextStyle(
color: Theme.of(context).accentColor,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -321,7 +324,8 @@ class ChatDetailsView extends StatelessWidget {
actualMembersCount.toString())
: L10n.of(context).emptyChat,
style: TextStyle(
color: Theme.of(context).accentColor,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),

View File

@ -32,7 +32,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
title: Text(L10n.of(context).deviceVerifyDescription),
leading: CircleAvatar(
backgroundColor: Theme.of(context).secondaryHeaderColor,
foregroundColor: Theme.of(context).accentColor,
foregroundColor: Theme.of(context).colorScheme.secondary,
child: Icon(Icons.lock),
),
),

View File

@ -110,7 +110,8 @@ class ChatView extends StatelessWidget {
: Row(
children: <Widget>[
Icon(Icons.edit_outlined,
color: Theme.of(context).accentColor,
color:
Theme.of(context).colorScheme.secondary,
size: 13),
SizedBox(width: 4),
Expanded(
@ -119,7 +120,9 @@ class ChatView extends StatelessWidget {
.getLocalizedTypingText(context),
maxLines: 1,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context)
.colorScheme
.secondary,
fontStyle: FontStyle.italic,
),
),
@ -209,7 +212,8 @@ class ChatView extends StatelessWidget {
color: Theme.of(context).secondaryHeaderColor,
child: ListTile(
leading: CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
foregroundColor:
Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).backgroundColor,
child: Icon(Icons.upgrade_outlined),
),
@ -330,7 +334,8 @@ class ChatView extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context)
.accentColor,
.colorScheme
.secondary,
),
),
),

View File

@ -25,7 +25,7 @@ class NewPrivateChatView extends StatelessWidget {
onPressed: () => VRouter.of(context).push('/newgroup'),
child: Text(
L10n.of(context).createNewGroup,
style: TextStyle(color: Theme.of(context).accentColor),
style: TextStyle(color: Theme.of(context).colorScheme.secondary),
),
)
],
@ -78,7 +78,7 @@ class NewPrivateChatView extends StatelessWidget {
ListTile(
leading: CircleAvatar(
radius: Avatar.defaultSize / 2,
foregroundColor: Theme.of(context).accentColor,
foregroundColor: Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).secondaryHeaderColor,
child: Icon(Icons.share_outlined),
),
@ -86,7 +86,8 @@ class NewPrivateChatView extends StatelessWidget {
title: Text('${L10n.of(context).yourOwnUsername}:'),
subtitle: Text(
Matrix.of(context).client.userID,
style: TextStyle(color: Theme.of(context).accentColor),
style:
TextStyle(color: Theme.of(context).colorScheme.secondary),
),
),
Divider(height: 1),

View File

@ -75,8 +75,8 @@ class SearchView extends StatelessWidget {
onChanged: controller.search,
),
bottom: TabBar(
indicatorColor: Theme.of(context).accentColor,
labelColor: Theme.of(context).accentColor,
indicatorColor: Theme.of(context).colorScheme.secondary,
labelColor: Theme.of(context).colorScheme.secondary,
unselectedLabelColor: Theme.of(context).textTheme.bodyText1.color,
labelStyle: TextStyle(fontSize: 16),
labelPadding: EdgeInsets.symmetric(
@ -97,7 +97,7 @@ class SearchView extends StatelessWidget {
SizedBox(height: 12),
ListTile(
leading: CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
foregroundColor: Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).secondaryHeaderColor,
child: Icon(Icons.edit_outlined),
),

View File

@ -56,11 +56,11 @@ class EmotesSettingsView extends StatelessWidget {
prefixText: ': ',
suffixText: ':',
prefixStyle: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
suffixStyle: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
border: InputBorder.none,
@ -140,11 +140,15 @@ class EmotesSettingsView extends StatelessWidget {
prefixText: ': ',
suffixText: ':',
prefixStyle: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context)
.colorScheme
.secondary,
fontWeight: FontWeight.bold,
),
suffixStyle: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context)
.colorScheme
.secondary,
fontWeight: FontWeight.bold,
),
border: InputBorder.none,

View File

@ -65,7 +65,7 @@ class SettingsNotificationsView extends StatelessWidget {
title: Text(
L10n.of(context).pushRules,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -83,7 +83,7 @@ class SettingsNotificationsView extends StatelessWidget {
title: Text(
L10n.of(context).devices,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),

View File

@ -47,7 +47,7 @@ class SettingsStyleView extends StatelessWidget {
title: Text(
L10n.of(context).wallpaper,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -77,7 +77,7 @@ class SettingsStyleView extends StatelessWidget {
title: Text(
L10n.of(context).fontSize,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),

View File

@ -74,7 +74,7 @@ class SettingsView extends StatelessWidget {
title: Text(
L10n.of(context).notifications,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -89,7 +89,7 @@ class SettingsView extends StatelessWidget {
title: Text(
L10n.of(context).chat,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -127,7 +127,7 @@ class SettingsView extends StatelessWidget {
title: Text(
L10n.of(context).account,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -188,7 +188,7 @@ class SettingsView extends StatelessWidget {
title: Text(
L10n.of(context).security,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -223,7 +223,7 @@ class SettingsView extends StatelessWidget {
title: Text(
L10n.of(context).about,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),

View File

@ -98,7 +98,7 @@ class _ContactListTile extends StatelessWidget {
subtitle: Text(contact.getLocalizedStatusMessage(context),
style: contact.presence.statusMsg?.isNotEmpty ?? false
? TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
)
: null),

View File

@ -46,7 +46,7 @@ class HtmlMessage extends StatelessWidget {
emoteSize: emoteSize,
linkStyle: linkStyle ??
themeData.textTheme.bodyText2.copyWith(
color: themeData.accentColor,
color: themeData.colorScheme.secondary,
decoration: TextDecoration.underline,
),
shrinkToFit: true,

View File

@ -30,7 +30,7 @@ class OnePageCard extends StatelessWidget {
colors: [
Theme.of(context).secondaryHeaderColor.withAlpha(alpha),
Theme.of(context).primaryColor.withAlpha(alpha),
Theme.of(context).accentColor.withAlpha(alpha),
Theme.of(context).colorScheme.secondary.withAlpha(alpha),
Theme.of(context).backgroundColor.withAlpha(alpha),
],
),

View File

@ -185,7 +185,7 @@ class ChatListItem extends StatelessWidget {
style: TextStyle(
fontSize: 13,
color: room.notificationCount > 0
? Theme.of(context).accentColor
? Theme.of(context).colorScheme.secondary
: null,
),
),
@ -205,7 +205,7 @@ class ChatListItem extends StatelessWidget {
if (typingText.isNotEmpty) ...{
Icon(
Icons.edit_outlined,
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
size: 14,
),
SizedBox(width: 4),
@ -215,7 +215,7 @@ class ChatListItem extends StatelessWidget {
? Text(
typingText,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
),
softWrap: false,
)
@ -223,7 +223,7 @@ class ChatListItem extends StatelessWidget {
? Text(
L10n.of(context).youAreInvitedToThisChat,
style: TextStyle(
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
),
softWrap: false,
)
@ -253,7 +253,7 @@ class ChatListItem extends StatelessWidget {
child: Icon(
Icons.push_pin_outlined,
size: 20,
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
),
),
if (room.isUnread)

View File

@ -51,7 +51,7 @@ class _LockScreenState extends State<LockScreen> {
colors: [
Theme.of(context).secondaryHeaderColor.withAlpha(16),
Theme.of(context).primaryColor.withAlpha(16),
Theme.of(context).accentColor.withAlpha(16),
Theme.of(context).colorScheme.secondary.withAlpha(16),
Theme.of(context).backgroundColor.withAlpha(16),
],
),

View File

@ -82,7 +82,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
linux-x64 ${CMAKE_BUILD_TYPE}
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS