diff --git a/material_3_demo/lib/color_box.dart b/material_3_demo/lib/color_box.dart index a2f498123..6fd24ea43 100644 --- a/material_3_demo/lib/color_box.dart +++ b/material_3_demo/lib/color_box.dart @@ -68,9 +68,12 @@ class _ColorBoxState extends State { // Copy color as hex to clipboard var hex = '#'; final c = widget.color; - hex += (c.r * 255.0).round().toRadixString(16).padLeft(2, '0'); - hex += (c.g * 255.0).round().toRadixString(16).padLeft(2, '0'); - hex += (c.b * 255.0).round().toRadixString(16).padLeft(2, '0'); + // Will change from int 0-255 to double 0.0-1.0 in 3.26+ + // The properties also change from red/green/blue to r/g/b + // hex += (c.[r g b] * 255.0).round().toRadixString(16).padLeft(2, '0'); + hex += c.red.toRadixString(16).padLeft(2, '0'); + hex += c.green.toRadixString(16).padLeft(2, '0'); + hex += c.blue.toRadixString(16).padLeft(2, '0'); final data = ClipboardData(text: hex); await Clipboard.setData(data); messenger.hideCurrentSnackBar();