mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 20:49:26 +01:00
chore: Minor design tweaks
This commit is contained in:
parent
9b5a3cadce
commit
06581e21e9
@ -39,7 +39,9 @@ class Avatar extends StatelessWidget {
|
||||
child: Text(
|
||||
fallbackLetters,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).brightness == Brightness.light
|
||||
? name?.darkColor
|
||||
: name?.lightColor ?? Colors.white,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
@ -55,7 +57,9 @@ class Avatar extends StatelessWidget {
|
||||
width: size,
|
||||
height: size,
|
||||
color: noPic
|
||||
? name?.lightColor ?? Theme.of(context).secondaryHeaderColor
|
||||
? Theme.of(context).brightness == Brightness.light
|
||||
? name?.lightColor
|
||||
: name?.darkColor ?? Theme.of(context).secondaryHeaderColor
|
||||
: Theme.of(context).secondaryHeaderColor,
|
||||
child: noPic
|
||||
? textWidget
|
||||
|
@ -10,12 +10,21 @@ extension StringColor on String {
|
||||
return HSLColor.fromAHSL(1, number, 1, 0.35).toColor();
|
||||
}
|
||||
|
||||
Color get darkColor {
|
||||
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.2).toColor();
|
||||
}
|
||||
|
||||
Color get lightColor {
|
||||
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.66).toColor();
|
||||
return HSLColor.fromAHSL(1, number, 1, 0.8).toColor();
|
||||
}
|
||||
}
|
||||
|
@ -248,6 +248,7 @@ class _ChatListState extends State<ChatList> {
|
||||
searchController: searchController,
|
||||
hintText: L10n.of(context).searchForAChat,
|
||||
onChanged: (_) => setState(() => null),
|
||||
suffix: Icon(Icons.search_outlined),
|
||||
),
|
||||
),
|
||||
floatingActionButton:
|
||||
|
Loading…
Reference in New Issue
Block a user