{ final theme = Theme.of(context); // ↓ Add this. final style = theme.textTheme.displayMedium!.copyWith( color: theme.colorScheme.onPrimary, ); return Card( color: theme.colorScheme.primary, child: Padding( padding: const EdgeInsets.all(20), // ↓ Change this line. child: Text(pair.asLowerCase, style: style), ), ); }