Skip to content

Commit 86aeafd

Browse files
committed
Update deprecations
1 parent 2bbee1e commit 86aeafd

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/diagrams/lib/src/basic_shapes.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ class RadiusDiagramPainter extends CustomPainter {
869869
..shader = ui.Gradient.linear(
870870
Offset.zero,
871871
Offset(0, size.height),
872-
<Color>[Colors.white, Colors.white.withOpacity(0)],
872+
<Color>[Colors.white, Colors.white.withValues(alpha: 0)],
873873
<double>[1 - 64 / size.height, 1.0],
874874
)
875875
..blendMode = BlendMode.dstIn,
@@ -880,7 +880,7 @@ class RadiusDiagramPainter extends CustomPainter {
880880
..shader = ui.Gradient.linear(
881881
Offset.zero,
882882
Offset(size.width, 0),
883-
<Color>[Colors.white, Colors.white.withOpacity(0)],
883+
<Color>[Colors.white, Colors.white.withValues(alpha: 0)],
884884
<double>[1 - 64 / size.width, 1.0],
885885
)
886886
..blendMode = BlendMode.dstIn,

packages/diagrams/lib/src/colors.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ColorSwatchDiagram extends ColorDiagram {
3737
: Colors.white;
3838
TextStyle style = TextStyle(color: textColor, fontSize: _kFontSize);
3939
String label, shadeLabel;
40-
if (swatch[key]!.value == swatch.value) {
40+
if (swatch[key]!.toARGB32() == swatch.toARGB32()) {
4141
label = name;
4242
shadeLabel = '';
4343
style = style.copyWith(fontWeight: FontWeight.w800);
@@ -60,7 +60,7 @@ class ColorSwatchDiagram extends ColorDiagram {
6060
],
6161
),
6262
Text(
63-
'0x${swatch[key]!.value.toRadixString(16).toUpperCase()}',
63+
'0x${swatch[key]!.toARGB32().toRadixString(16).toUpperCase()}',
6464
style: style,
6565
),
6666
],
@@ -104,7 +104,7 @@ class ColorListDiagram extends ColorDiagram {
104104
children: <Widget>[
105105
Text(key, style: style),
106106
Text(
107-
'0x${textColor.value.toRadixString(16).toUpperCase()}',
107+
'0x${textColor.toARGB32().toRadixString(16).toUpperCase()}',
108108
style: style,
109109
),
110110
],

packages/diagrams/lib/src/cupertino_colors.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class CupertinoColorsDiagram extends StatelessWidget with DiagramMetadata {
182182
Padding(
183183
padding: const EdgeInsets.only(bottom: 14.0),
184184
child: Text(
185-
'High\nconstrast color',
185+
'High\ncontrast color',
186186
style: textStyle,
187187
textAlign: TextAlign.center,
188188
),
@@ -238,7 +238,7 @@ class CupertinoColorsDiagram extends StatelessWidget with DiagramMetadata {
238238
Padding(
239239
padding: const EdgeInsets.only(bottom: 14.0),
240240
child: Text(
241-
'High\nconstrast color',
241+
'High\ncontrast color',
242242
style: textStyle,
243243
textAlign: TextAlign.center,
244244
),
@@ -352,7 +352,7 @@ class CupertinoColorsDiagram extends StatelessWidget with DiagramMetadata {
352352
Padding(
353353
padding: const EdgeInsets.only(bottom: 14.0),
354354
child: Text(
355-
'High\nconstrast color',
355+
'High\ncontrast color',
356356
style: textStyle,
357357
textAlign: TextAlign.center,
358358
),
@@ -412,7 +412,7 @@ class CupertinoColorsDiagram extends StatelessWidget with DiagramMetadata {
412412
Padding(
413413
padding: const EdgeInsets.only(bottom: 14.0),
414414
child: Text(
415-
'High\nconstrast color',
415+
'High\ncontrast color',
416416
style: textStyle,
417417
textAlign: TextAlign.center,
418418
),
@@ -491,7 +491,7 @@ class ColorWidget extends StatelessWidget {
491491
return DefaultTextStyle(
492492
style: TextStyle(
493493
color:
494-
color.red > 200 && color.green > 200 && color.blue > 200
494+
color.r > 200 && color.g > 200 && color.b > 200
495495
? CupertinoColors.black
496496
: CupertinoColors.white,
497497
fontSize: 16.0,
@@ -517,9 +517,9 @@ class ColorWidget extends StatelessWidget {
517517
mainAxisSize: MainAxisSize.min,
518518
crossAxisAlignment: CrossAxisAlignment.start,
519519
children: <Widget>[
520-
Text('${color.red}'),
521-
Text('${color.green}'),
522-
Text('${color.blue}'),
520+
Text('${color.r}'),
521+
Text('${color.g}'),
522+
Text('${color.b}'),
523523
],
524524
),
525525
],

packages/diagrams/lib/src/text_style.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ class TextStyleDiagram extends StatelessWidget with DiagramMetadata {
4545
children: <TextSpan>[
4646
TextSpan(
4747
text: "You don't have the votes.\n",
48-
style: TextStyle(color: Colors.black.withOpacity(0.6)),
48+
style: TextStyle(color: Colors.black.withValues(alpha: 0.6)),
4949
),
5050
TextSpan(
5151
text: "You don't have the votes!\n",
52-
style: TextStyle(color: Colors.black.withOpacity(0.8)),
52+
style: TextStyle(color: Colors.black.withValues(alpha: 0.8)),
5353
),
5454
TextSpan(
5555
text:
5656
"You're gonna need congressional approval and you don't have the votes!\n",
57-
style: TextStyle(color: Colors.black.withOpacity(1.0)),
57+
style: TextStyle(color: Colors.black.withValues(alpha: 1.0)),
5858
),
5959
],
6060
),

0 commit comments

Comments
 (0)