Revert "mod: color alpha"

This reverts commit a7ffc3b05f.
This commit is contained in:
bggRGjQaUbCoE
2024-12-22 10:42:00 +08:00
parent fe2b4f6735
commit a01d54cd80
64 changed files with 168 additions and 210 deletions

View File

@@ -50,7 +50,7 @@ class AnimatedDialogState extends State<AnimatedDialog>
@override
Widget build(BuildContext context) {
return Material(
color: Colors.black.withValues(alpha: opacityAnimation.value),
color: Colors.black.withOpacity(opacityAnimation.value),
child: InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,

View File

@@ -267,10 +267,9 @@ class ProgressBar extends LeafRenderObjectWidget {
onDragUpdate: onDragUpdate,
onDragEnd: onDragEnd,
barHeight: barHeight,
baseBarColor: baseBarColor ?? primaryColor.withValues(alpha: 0.24),
baseBarColor: baseBarColor ?? primaryColor.withOpacity(0.24),
progressBarColor: progressBarColor ?? primaryColor,
bufferedBarColor:
bufferedBarColor ?? primaryColor.withValues(alpha: 0.24),
bufferedBarColor: bufferedBarColor ?? primaryColor.withOpacity(0.24),
barCapShape: barCapShape,
thumbRadius: thumbRadius,
thumbColor: thumbColor ?? primaryColor,
@@ -301,10 +300,9 @@ class ProgressBar extends LeafRenderObjectWidget {
..onDragUpdate = onDragUpdate
..onDragEnd = onDragEnd
..barHeight = barHeight
..baseBarColor = baseBarColor ?? primaryColor.withValues(alpha: 0.24)
..baseBarColor = baseBarColor ?? primaryColor.withOpacity(0.24)
..progressBarColor = progressBarColor ?? primaryColor
..bufferedBarColor =
bufferedBarColor ?? primaryColor.withValues(alpha: 0.24)
..bufferedBarColor = bufferedBarColor ?? primaryColor.withOpacity(0.24)
..barCapShape = barCapShape
..thumbRadius = thumbRadius
..thumbColor = thumbColor ?? primaryColor

View File

@@ -38,11 +38,11 @@ class PBadge extends StatelessWidget {
// 边框色
Color borderColor = Colors.transparent;
if (type == 'gray') {
bgColor = Colors.black54.withValues(alpha: 0.4);
bgColor = Colors.black54.withOpacity(0.4);
color = Colors.white;
}
if (type == 'color') {
bgColor = t.secondaryContainer.withValues(alpha: 0.5);
bgColor = t.secondaryContainer.withOpacity(0.5);
color = t.onSecondaryContainer;
}
if (type == 'line') {

View File

@@ -21,7 +21,7 @@ class CustomToast extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.primaryContainer
.withValues(alpha: toastOpacity),
.withOpacity(toastOpacity),
borderRadius: BorderRadius.circular(20),
),
child: Text(

View File

@@ -282,7 +282,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black.withValues(alpha: 0.3)
Colors.black.withOpacity(0.3)
],
),
)

View File

@@ -334,7 +334,7 @@ class _ListSheetContentState extends State<ListSheetContent>
),
Divider(
height: 1,
color: Theme.of(context).dividerColor.withValues(alpha: 0.1),
color: Theme.of(context).dividerColor.withOpacity(0.1),
),
if (_isList)
Material(
@@ -346,8 +346,7 @@ class _ListSheetContentState extends State<ListSheetContent>
.map((item) => Tab(text: item.title))
.toList(),
dividerHeight: 1,
dividerColor:
Theme.of(context).dividerColor.withValues(alpha: 0.1),
dividerColor: Theme.of(context).dividerColor.withOpacity(0.1),
),
),
Expanded(
@@ -408,7 +407,7 @@ class _ListSheetContentState extends State<ListSheetContent>
itemScrollController: itemScrollController[i ?? 0],
separatorBuilder: (context, index) => Divider(
height: 1,
color: Theme.of(context).dividerColor.withValues(alpha: 0.1),
color: Theme.of(context).dividerColor.withOpacity(0.1),
),
),
);

View File

@@ -21,7 +21,7 @@ class LiveCard extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
side: BorderSide(
color: Theme.of(context).dividerColor.withValues(alpha: 0.08),
color: Theme.of(context).dividerColor.withOpacity(0.08),
),
),
margin: EdgeInsets.zero,

View File

@@ -114,10 +114,7 @@ class NetworkImgLayer extends StatelessWidget {
height: height,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Theme.of(context)
.colorScheme
.onInverseSurface
.withValues(alpha: 0.4),
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
borderRadius: BorderRadius.circular(type == 'avatar'
? 50
: type == 'emote'

View File

@@ -45,7 +45,7 @@ class OverlayPop extends StatelessWidget {
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.3),
color: Colors.black.withOpacity(0.3),
borderRadius:
const BorderRadius.all(Radius.circular(20))),
child: IconButton(

View File

@@ -77,7 +77,7 @@ class SegmentProgressBar extends CustomPainter {
size.width,
0,
),
Paint()..color = Colors.grey[600]!.withValues(alpha: 0.45),
Paint()..color = Colors.grey[600]!.withOpacity(0.45),
);
}

View File

@@ -9,8 +9,8 @@ Widget statDanMu({
}) {
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),
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
};
Color color = colorObject[theme]!;
return Row(

View File

@@ -10,8 +10,8 @@ Widget statView({
}) {
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),
'gray': Theme.of(context).colorScheme.outline.withOpacity(0.8),
'black': Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
};
Color color = colorObject[theme]!;
return Row(

View File

@@ -327,7 +327,7 @@ class VideoCardV extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.outline
.withValues(alpha: 0.8),
.withOpacity(0.8),
),
text:
Utils.formatTimestampToRelativeTime(videoItem.pubdate)),
@@ -349,7 +349,7 @@ class VideoCardV extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.outline
.withValues(alpha: 0.8),
.withOpacity(0.8),
),
text: Utils.shortenChineseDateString(
videoItem.desc.split(' · ').last)),

View File

@@ -308,7 +308,7 @@ Widget videoContent(BuildContext context, Item videoItem) {
// style: TextStyle(
// fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
// color:
// Theme.of(context).colorScheme.outline.withValues(alpha: 0.8),
// Theme.of(context).colorScheme.outline.withOpacity(0.8),
// ),
// text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)),
// )),
@@ -326,7 +326,7 @@ Widget videoContent(BuildContext context, Item videoItem) {
// style: TextStyle(
// fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
// color:
// Theme.of(context).colorScheme.outline.withValues(alpha: 0.8),
// Theme.of(context).colorScheme.outline.withOpacity(0.8),
// ),
// text: Utils.shortenChineseDateString(
// videoItem.desc.split(' · ').last)),