💄 Optimize font color on app bar in some pages

This commit is contained in:
2024-12-12 22:33:10 +08:00
parent 1347aacbc5
commit bb5fe9c380
7 changed files with 23 additions and 29 deletions

View File

@ -2,7 +2,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:provider/provider.dart';

View File

@ -238,7 +238,7 @@ class _UserScreenState extends State<UserScreen> with SingleTickerProviderStateM
TextSpan(
text: _account!.nick,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Colors.white,
color: Theme.of(context).appBarTheme.foregroundColor!,
shadows: labelShadows,
),
),
@ -246,7 +246,7 @@ class _UserScreenState extends State<UserScreen> with SingleTickerProviderStateM
TextSpan(
text: '@${_account!.name}',
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Colors.white,
color: Theme.of(context).appBarTheme.foregroundColor!,
shadows: labelShadows,
),
),

View File

@ -84,12 +84,16 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
text: TextSpan(children: [
TextSpan(
text: _data?.body['title'] ?? 'postNoun'.tr(),
style: Theme.of(context).textTheme.titleLarge!.copyWith(color: Colors.white),
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).appBarTheme.foregroundColor!,
),
),
const TextSpan(text: '\n'),
TextSpan(
text: 'postDetail'.tr(),
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: Colors.white),
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Theme.of(context).appBarTheme.foregroundColor!,
),
),
]),
)

View File

@ -149,12 +149,16 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
text: TextSpan(children: [
TextSpan(
text: _writeController.title.isNotEmpty ? _writeController.title : 'untitled'.tr(),
style: Theme.of(context).textTheme.titleLarge!.copyWith(color: Colors.white),
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).appBarTheme.foregroundColor!,
),
),
const TextSpan(text: '\n'),
TextSpan(
text: PostWriteController.kTitleMap[widget.mode]!.tr(),
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: Colors.white),
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Theme.of(context).appBarTheme.foregroundColor!,
),
),
]),
),

View File

@ -201,7 +201,6 @@ class _PostPublisherScreenState extends State<PostPublisherScreen> with SingleTi
setState(() => _isWorking = true);
try {
final sn = context.read<SnNetworkProvider>();
final rel = context.read<SnRelationshipProvider>();
await rel.updateRelationship(_account!.id, 1, _accountRelationship?.permNodes ?? {});
if (!mounted) return;
@ -288,7 +287,7 @@ class _PostPublisherScreenState extends State<PostPublisherScreen> with SingleTi
TextSpan(
text: _publisher!.nick,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Colors.white,
color: Theme.of(context).appBarTheme.foregroundColor!,
shadows: labelShadows,
),
),

View File

@ -213,6 +213,10 @@ class _PostBottomAction extends StatelessWidget {
}
}
void _doShareViaPicture() {
}
@override
Widget build(BuildContext context) {
final iconColor = Theme.of(context).colorScheme.onSurface.withAlpha(
@ -298,6 +302,7 @@ class _PostBottomAction extends StatelessWidget {
),
InkWell(
onTap: _doShare,
onLongPress: _doShareViaPicture,
child: Icon(
Symbols.share,
size: 20,
@ -369,10 +374,10 @@ class _PostHeadline extends StatelessWidget {
style: TextStyle(fontSize: 13),
),
const Gap(8),
if (data.updatedAt != data.createdAt)
if (data.editedAt != null)
Text(
'articleEditedAt'.tr(
args: [DateFormat('y/M/d HH:mm').format(data.updatedAt)],
args: [DateFormat('y/M/d HH:mm').format(data.editedAt!)],
),
style: TextStyle(fontSize: 13),
),
@ -652,7 +657,7 @@ class _PostQuoteContent extends StatelessWidget {
if (child.visibility > 0) _PostVisibilityHint(data: child).padding(top: 4),
],
).padding(horizontal: 16),
if (child.preload?.attachments?.isNotEmpty ?? false)
if (child.type != 'article' && (child.preload?.attachments?.isNotEmpty ?? false))
ClipRRect(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(8),