The sentence "Ich war dir egal", is translated in English as "You didn't care about me". Why in the translation "Ich" and "dir" exchange its position? Why it not translated as "I didn't care about you"?
In this, "dir" is the dative object. And dative objects are the recipient of the action (to/for whom action is taken). Then, how "dir" become the one who is taking action instead of receiving action?