Files
PiliPlus/lib/common/widgets/stat/view.dart
bggRGjQaUbCoE a7ffc3b05f mod: color alpha
`withOpacity` -> `withValues`

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2024-12-19 20:22:55 +08:00

41 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:PiliPalaX/utils/utils.dart';
Widget statView({
required BuildContext context,
String? theme,
dynamic view,
String? size,
String? goto,
}) {
Map<String, Color> colorObject = {
'white': Colors.white,
'gray': Theme.of(context).colorScheme.outline.withValues(alpha: 0.8),
'black': Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
};
Color color = colorObject[theme]!;
return Row(
children: [
Icon(
goto == 'picture'
? Icons.remove_red_eye_outlined
: Icons.play_circle_outlined,
size: 13,
color: color,
),
const SizedBox(width: 2),
Text(
Utils.numFormat(view!),
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: size == 'medium' ? 12 : 11,
color: color,
),
overflow: TextOverflow.clip,
semanticsLabel:
'${Utils.numFormat(view!)}${goto == "picture" ? "浏览" : "播放"}',
),
],
);
}