mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: get theme color
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -93,6 +93,7 @@ class _WhisperPageState extends State<WhisperPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: List.generate(_whisperController.msgFeedTopItems.length,
|
||||
(index) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Padding(
|
||||
@@ -111,12 +112,11 @@ class _WhisperPageState extends State<WhisperPage> {
|
||||
alignment: Alignment.topRight,
|
||||
child: CircleAvatar(
|
||||
radius: 22,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.onInverseSurface,
|
||||
backgroundColor: theme.colorScheme.onInverseSurface,
|
||||
child: Icon(
|
||||
_whisperController.msgFeedTopItems[index]['icon'],
|
||||
size: 20,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -21,6 +21,7 @@ class WhisperSessionItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
dynamic content = item.lastMsg?.content;
|
||||
final ThemeData theme = Theme.of(context);
|
||||
if (content == null || content == "") {
|
||||
content = '不支持的消息类型';
|
||||
} else {
|
||||
@@ -37,9 +38,7 @@ class WhisperSessionItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
tileColor: item.topTs == 0
|
||||
? null
|
||||
: Theme.of(context).colorScheme.onInverseSurface,
|
||||
tileColor: item.topTs == 0 ? null : theme.colorScheme.onInverseSurface,
|
||||
onLongPress: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -122,17 +121,15 @@ class WhisperSessionItem extends StatelessWidget {
|
||||
'$content',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.labelMedium!
|
||||
.copyWith(color: Theme.of(context).colorScheme.outline),
|
||||
style: theme.textTheme.labelMedium!
|
||||
.copyWith(color: theme.colorScheme.outline),
|
||||
),
|
||||
trailing: item.lastMsg?.timestamp != null
|
||||
? Text(
|
||||
Utils.dateFormat(item.lastMsg!.timestamp, formatType: "day"),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
|
||||
Reference in New Issue
Block a user