1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 06:49:22 +00:00

Fix theme color

This commit is contained in:
Pierre HUBERT 2021-03-16 17:41:14 +01:00
parent bd794f8079
commit e31c91a55c
2 changed files with 8 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
return _buildVisitorState(); return _buildVisitorState();
default: default:
throw Exception("Unkonwn grou pmembership level state: $_level"); throw Exception("Unkonwn group pmembership level state: $_level");
} }
} }
@ -63,7 +63,7 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
WidgetSpan( WidgetSpan(
child: Icon(Icons.info_outline, size: 12), child: Icon(Icons.info_outline, size: 12),
alignment: PlaceholderAlignment.middle), alignment: PlaceholderAlignment.middle),
TextSpan(text: " " + tr("Invited") + " "), TextSpan(text: " " + tr("Invited") + " ", style: blackForWhiteTheme()),
TextSpan( TextSpan(
text: tr("Accept"), text: tr("Accept"),
style: TextStyle(color: Colors.green), style: TextStyle(color: Colors.green),
@ -107,7 +107,8 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
WidgetSpan( WidgetSpan(
child: Icon(Icons.access_time, size: 12), child: Icon(Icons.access_time, size: 12),
alignment: PlaceholderAlignment.middle), alignment: PlaceholderAlignment.middle),
TextSpan(text: " " + tr("Requested") + " "), TextSpan(
text: " " + tr("Requested") + " ", style: blackForWhiteTheme()),
TextSpan( TextSpan(
text: tr("Cancel"), text: tr("Cancel"),
style: TextStyle(color: Colors.blue), style: TextStyle(color: Colors.blue),
@ -132,7 +133,6 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
/// Build visitor state /// Build visitor state
Widget _buildVisitorState() { Widget _buildVisitorState() {
// Check if the user can request membership // Check if the user can request membership
if (group.registrationLevel == GroupRegistrationLevel.CLOSED) if (group.registrationLevel == GroupRegistrationLevel.CLOSED)
return Text(tr("Closed registration")); return Text(tr("Closed registration"));

View File

@ -274,3 +274,7 @@ void applyNewThemeSettings(BuildContext context) =>
/// Parse emojies /// Parse emojies
String parseEmojies(String input) => EmojiParser().emojify(input); String parseEmojies(String input) => EmojiParser().emojify(input);
/// Create a white text style for dart heme and a black text otherwise
TextStyle blackForWhiteTheme() =>
TextStyle(color: darkTheme() ? Colors.white : Colors.black);