1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

CI Fix, part #2 (#2423)

This commit is contained in:
Brett Morgan
2024-09-01 17:25:33 +10:00
committed by GitHub
parent 82a8a8411e
commit 8d208d7fd4
16 changed files with 65 additions and 63 deletions

View File

@@ -223,7 +223,7 @@ class PromptScreen extends StatelessWidget {
iconColor: Colors.black45,
buttonBackgroundColor: Colors.transparent,
hoverColor:
MarketplaceTheme.secondary.withOpacity(.1),
MarketplaceTheme.secondary.withAlpha(25),
),
),
const Spacer(flex: 1),
@@ -292,7 +292,7 @@ class PromptScreen extends StatelessWidget {
icon: Symbols.restart_alt,
iconColor: Colors.black45,
buttonBackgroundColor: Colors.transparent,
hoverColor: MarketplaceTheme.secondary.withOpacity(.1),
hoverColor: MarketplaceTheme.secondary.withAlpha(25),
),
),
const SizedBox(height: 200.0),
@@ -322,7 +322,7 @@ class _FilterChipSection extends StatelessWidget {
child: Container(
height: 230,
decoration: BoxDecoration(
color: Theme.of(context).splashColor.withOpacity(.1),
color: Theme.of(context).splashColor.withAlpha(25),
border: Border.all(
color: MarketplaceTheme.borderColor,
),

View File

@@ -201,7 +201,7 @@ class _CameraViewState extends State<CameraView> {
right: 0,
height: 89.5,
child: Container(
color: Colors.black.withOpacity(.7),
color: Colors.black.withAlpha(179),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -247,7 +247,7 @@ class _CameraViewState extends State<CameraView> {
right: 0,
height: 150,
child: Container(
color: Colors.black.withOpacity(.7),
color: Colors.black.withAlpha(179),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@@ -193,7 +193,7 @@ class _ListTileState extends State<_ListTile> {
bottomLeft:
Radius.circular(MarketplaceTheme.defaultBorderRadius),
),
color: color.withOpacity(.3),
color: color.withAlpha(77),
),
padding: const EdgeInsets.all(MarketplaceTheme.spacing7),
child: Stack(

View File

@@ -76,7 +76,7 @@ class RecipeDisplayWidget extends StatelessWidget {
children: [
Container(
padding: const EdgeInsets.all(MarketplaceTheme.defaultBorderRadius),
color: MarketplaceTheme.primary.withOpacity(.5),
color: MarketplaceTheme.primary.withAlpha(128),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -106,7 +106,7 @@ class RecipeDisplayWidget extends StatelessWidget {
style: ButtonStyle(
backgroundColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return MarketplaceTheme.scrim.withOpacity(.6);
return MarketplaceTheme.scrim.withAlpha(153);
}
return Colors.white;
}),

View File

@@ -35,9 +35,7 @@ class _AdaptiveRouterState extends State<AdaptiveRouter>
super.initState();
tabController = TabController(length: 2, vsync: this);
_textStyle = MarketplaceTheme.heading1.copyWith(
color: Colors.black87.withOpacity(
1.0,
),
color: Colors.black87.withAlpha(255),
);
scrollController = ScrollController();
@@ -60,7 +58,7 @@ class _AdaptiveRouterState extends State<AdaptiveRouter>
// By offset 200, ensure the text is transparent
if (scrollController.offset > 200) {
_textStyle = _textStyle.copyWith(
color: Colors.black87.withOpacity(0),
color: Colors.black87.withAlpha(0),
);
return;
}
@@ -73,9 +71,7 @@ class _AdaptiveRouterState extends State<AdaptiveRouter>
if (value > 1) value = 1;
if (value < 0) value = 0;
_textStyle = _textStyle.copyWith(
color: Colors.black87.withOpacity(
value,
),
color: Colors.black87.withAlpha((255 * value).ceil()),
);
});
}

View File

@@ -96,9 +96,10 @@ class _RenderTapRecorder extends RenderProxyBox with _SilentTickerProvider {
Rect.fromCircle(center: tap.localPosition, radius: _tapRadius));
final opacity = 1 - tap.animation.value;
canvas.drawShadow(
path, _shadowColor.withOpacity(opacity), _shadowElevation, true);
canvas.drawPath(path, Paint()..color = _tapColor.withOpacity(opacity));
canvas.drawShadow(path, _shadowColor.withAlpha((2565 * opacity).ceil()),
_shadowElevation, true);
canvas.drawPath(
path, Paint()..color = _tapColor.withAlpha((2565 * opacity).ceil()));
}
}
}

View File

@@ -27,11 +27,11 @@ class _AddImageState extends State<AddImage> {
var state = (hovered, tappedDown);
return switch (state) {
// tapped down state
(_, true) => MarketplaceTheme.secondary.withOpacity(.7),
(_, true) => MarketplaceTheme.secondary.withAlpha(179),
// hovered
(true, _) => MarketplaceTheme.secondary.withOpacity(.3),
(true, _) => MarketplaceTheme.secondary.withAlpha(77),
// base color
(_, _) => MarketplaceTheme.secondary.withOpacity(.3),
(_, _) => MarketplaceTheme.secondary.withAlpha(77),
};
}

View File

@@ -51,10 +51,10 @@ class _CategorySelectionInputState<T extends Enum>
return FilterChip(
color: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return MarketplaceTheme.secondary.withOpacity(.5);
return MarketplaceTheme.secondary.withAlpha(128);
}
if (states.contains(WidgetState.selected)) {
return MarketplaceTheme.secondary.withOpacity(.3);
return MarketplaceTheme.secondary.withAlpha(77);
}
return Theme.of(context).splashColor;
}),

View File

@@ -38,7 +38,7 @@ class _HighlightBorderOnHoverWidgetState
},
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).splashColor.withOpacity(.1),
color: Theme.of(context).splashColor.withAlpha(25),
border: Border.all(
color: hovered ? widget.color : MarketplaceTheme.borderColor,
),

View File

@@ -55,10 +55,10 @@ class _MarketplaceButtonState extends State<MarketplaceButton> {
backgroundColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return widget.hoverColor ??
MarketplaceTheme.secondary.withOpacity(.3);
MarketplaceTheme.secondary.withAlpha(77);
}
return widget.buttonBackgroundColor ??
Theme.of(context).splashColor.withOpacity(.3);
Theme.of(context).splashColor.withAlpha(77);
}),
shape: WidgetStateProperty.resolveWith(
(states) {