Merge branch 'krille/design-fixes' into 'master'

Minor design fixes

See merge request ChristianPauly/fluffychat-flutter!84
This commit is contained in:
Christian Pauly 2020-06-25 07:26:07 +00:00
commit 3e97f1e0ac
3 changed files with 12 additions and 2 deletions

View file

@ -48,7 +48,7 @@ class Avatar extends StatelessWidget {
) )
: null, : null,
backgroundColor: noPic backgroundColor: noPic
? name?.color ?? Theme.of(context).secondaryHeaderColor ? name?.lightColor ?? Theme.of(context).secondaryHeaderColor
: Theme.of(context).secondaryHeaderColor, : Theme.of(context).secondaryHeaderColor,
child: noPic child: noPic
? Text(fallbackLetters, style: TextStyle(color: Colors.white)) ? Text(fallbackLetters, style: TextStyle(color: Colors.white))

View file

@ -2,6 +2,15 @@ import 'package:flutter/material.dart';
extension StringColor on String { extension StringColor on String {
Color get color { Color get color {
var number = 0.0;
for (var i = 0; i < length; i++) {
number += codeUnitAt(i);
}
number = (number % 10) * 25.5;
return HSLColor.fromAHSL(1, number, 1, 0.35).toColor();
}
Color get lightColor {
var number = 0.0; var number = 0.0;
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
number += codeUnitAt(i); number += codeUnitAt(i);

View file

@ -298,7 +298,8 @@ class _ChatListState extends State<ChatList> {
title: selectMode == SelectMode.share title: selectMode == SelectMode.share
? Text(L10n.of(context).share) ? Text(L10n.of(context).share)
: Padding( : Padding(
padding: EdgeInsets.all(8), padding:
EdgeInsets.only(top: 8, bottom: 8, right: 8),
child: TextField( child: TextField(
autocorrect: false, autocorrect: false,
controller: searchController, controller: searchController,