opt: get theme color

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-28 21:32:30 +08:00
parent 451a84e696
commit ca993df0c6
149 changed files with 4415 additions and 4803 deletions

View File

@@ -23,7 +23,6 @@ class BangumiCardV extends StatelessWidget {
margin: EdgeInsets.zero,
child: InkWell(
onLongPress: () => imageSaveDialog(
context: context,
title: bangumiItem.title,
cover: bangumiItem.cover,
),
@@ -88,6 +87,11 @@ class BangumiCardV extends StatelessWidget {
}
Widget bagumiContent(context) {
final theme = Theme.of(context);
final style = TextStyle(
fontSize: theme.textTheme.labelMedium!.fontSize,
color: theme.colorScheme.outline,
);
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(4, 5, 0, 3),
@@ -108,19 +112,13 @@ class BangumiCardV extends StatelessWidget {
Text(
bangumiItem.indexShow,
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
style: style,
),
if (bangumiItem.progress != null)
Text(
bangumiItem.progress,
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
style: style,
),
],
),

View File

@@ -27,7 +27,6 @@ class BangumiCardVMemberHome extends StatelessWidget {
PageUtils.viewBangumi(seasonId: seasonId);
},
onLongPress: () => imageSaveDialog(
context: context,
title: bangumiItem.title,
cover: bangumiItem.cover,
),

View File

@@ -21,7 +21,6 @@ class BangumiCardVPgcIndex extends StatelessWidget {
margin: EdgeInsets.zero,
child: InkWell(
onLongPress: () => imageSaveDialog(
context: context,
title: bangumiItem['title'],
cover: bangumiItem['cover'],
),
@@ -73,6 +72,7 @@ class BangumiCardVPgcIndex extends StatelessWidget {
}
Widget bagumiContent(context) {
final theme = Theme.of(context);
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(4, 5, 0, 3),
@@ -94,8 +94,8 @@ class BangumiCardVPgcIndex extends StatelessWidget {
bangumiItem['index_show'],
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
fontSize: theme.textTheme.labelMedium!.fontSize,
color: theme.colorScheme.outline,
),
),
],

View File

@@ -22,7 +22,6 @@ class BangumiCardVSearch extends StatelessWidget {
margin: EdgeInsets.zero,
child: InkWell(
onLongPress: () => imageSaveDialog(
context: context,
title: item.title?.map((e) => e['text']).join(),
cover: item.cover,
),

View File

@@ -22,7 +22,6 @@ class BangumiCardVTimeline extends StatelessWidget {
margin: EdgeInsets.zero,
child: InkWell(
onLongPress: () => imageSaveDialog(
context: context,
title: item.title,
cover: item.cover,
),
@@ -71,6 +70,7 @@ class BangumiCardVTimeline extends StatelessWidget {
}
Widget bagumiContent(context) {
final theme = Theme.of(context);
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(4, 5, 0, 3),
@@ -90,8 +90,8 @@ class BangumiCardVTimeline extends StatelessWidget {
item.pubIndex ?? '',
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
fontSize: theme.textTheme.labelMedium!.fontSize,
color: theme.colorScheme.outline,
),
),
],

View File

@@ -81,6 +81,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Column(
children: [
Padding(
@@ -95,7 +96,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.outline,
color: theme.colorScheme.outline,
),
),
),
@@ -140,7 +141,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
right: index == widget.pages.length - 1 ? 0 : 10,
),
child: Material(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
borderRadius: BorderRadius.circular(6),
clipBehavior: Clip.hardEdge,
child: InkWell(
@@ -169,7 +170,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
if (index == currentIndex) ...<Widget>[
Image.asset(
'assets/images/live.png',
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
height: 12,
semanticLabel: "正在播放:",
),
@@ -185,10 +186,8 @@ class _BangumiPanelState extends State<BangumiPanel> {
style: TextStyle(
fontSize: 13,
color: index == currentIndex
? Theme.of(context).colorScheme.primary
: Theme.of(context)
.colorScheme
.onSurface),
? theme.colorScheme.primary
: theme.colorScheme.onSurface),
)),
const SizedBox(width: 2),
if (item.badge != null) ...[
@@ -205,8 +204,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
item.badge!,
style: TextStyle(
fontSize: 11,
color:
Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
),
],
@@ -222,10 +220,8 @@ class _BangumiPanelState extends State<BangumiPanel> {
style: TextStyle(
fontSize: 13,
color: index == currentIndex
? Theme.of(context).colorScheme.primary
: Theme.of(context)
.colorScheme
.onSurface),
? theme.colorScheme.primary
: theme.colorScheme.onSurface),
overflow: TextOverflow.ellipsis,
)
]