diff --git a/examples/flutter_gallery/lib/demo/material/cards_demo.dart b/examples/flutter_gallery/lib/demo/material/cards_demo.dart index 6898ff7468..427851d257 100644 --- a/examples/flutter_gallery/lib/demo/material/cards_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/cards_demo.dart @@ -135,7 +135,10 @@ class TappableTravelDestinationItem extends StatelessWidget { onTap: () { print('Card was tapped'); }, - splashColor: Theme.of(context).colorScheme.primary.withAlpha(30), + // Generally, material cards use onSurface with 12% opacity for the pressed state. + splashColor: Theme.of(context).colorScheme.onSurface.withOpacity(0.12), + // Generally, material cards do not have a highlight overlay. + highlightColor: Colors.transparent, child: TravelDestinationContent(destination: destination), ), ), @@ -167,6 +170,8 @@ class _SelectableTravelDestinationItemState extends State[ Container( color: _isSelected - ? Theme.of(context).colorScheme.primary.withAlpha(41) + // Generally, material cards use primary with 8% opacity for the selected state. + // See: https://material.io/design/interaction/states.html#anatomy + ? colorScheme.primary.withOpacity(0.08) : Colors.transparent, ), TravelDestinationContent(destination: widget.destination), Align( alignment: Alignment.topRight, child: Padding( - padding: const EdgeInsets.all(4.0), + padding: const EdgeInsets.all(8.0), child: Icon( Icons.check_circle, - color: _isSelected ? Colors.white : Colors.transparent, + color: _isSelected ? colorScheme.primary : Colors.transparent, ), ) ), ], - ) + ), ), ), ),