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

Customize unread conversation color

This commit is contained in:
Pierre HUBERT 2021-04-25 16:24:42 +02:00
parent a07c7af715
commit 616755aa38
3 changed files with 8 additions and 1 deletions

View File

@ -34,6 +34,7 @@ void main() {
primaryColorDark: Colors.green.shade900,
appName: "#Forez",
appQuickDescription: tr("Events organisation in Forez plain"),
unreadConversationColor: Colors.green.shade900,
toursEntriesBuilder: buildTour,
additionalLoading: () => ForezGroupHelper.refreshInfo(),
mainRouteBuilder: (c, k) => ForezRoute(key: k),

View File

@ -23,6 +23,7 @@ class Config {
final Color primaryColorDark;
final String appName;
final String appQuickDescription;
final Color unreadConversationColor;
// Entries for the welcome tour
final TourEntriesBuilder toursEntriesBuilder;
@ -43,6 +44,7 @@ class Config {
this.primaryColorDark,
this.appName = "Comunic",
this.appQuickDescription,
this.unreadConversationColor,
this.toursEntriesBuilder,
this.additionalLoading,
this.mainRouteBuilder,

View File

@ -1,6 +1,7 @@
import 'package:comunic/helpers/conversations_helper.dart';
import 'package:comunic/lists/groups_list.dart';
import 'package:comunic/lists/users_list.dart';
import 'package:comunic/models/config.dart';
import 'package:comunic/models/conversation.dart';
import 'package:comunic/ui/routes/main_route/main_route.dart';
import 'package:comunic/ui/widgets/conversation_image_widget.dart';
@ -76,7 +77,10 @@ class ConversationTile extends StatelessWidget {
// Tile color
tileColor: conversation.sawLastMessage
? null
: (conversation.color ?? Colors.blue).withOpacity(0.2),
: (conversation.color ??
config().unreadConversationColor ??
Colors.blue)
.withOpacity(0.2),
// Leading icon
leading: ConversationImageWidget(