I'm right-dominant, but a close friend is left-dominant. He always complains about apps being developed for right-handed people, so while developing my apps I want to give lefties the option.
My method works, but it feels wordy and inelegant. Here's what I'm doing:
String userDominantHand = 'right';
Scaffold (
endDrawer: userDominantHand == 'left' ? Drawer(...) : null,
drawer: userDominantHand == 'right' ? Drawer(...) : null,
)
A toggle in the settings switches from 'right' to 'left'. I can't think of a better way to achieve this, since drawer and endDrawer are separated in Scaffold().
Flutter docs say to use TextDirection.rtl and TextDirection.ltr, but I can't figure out where to put that to move the drawer. Wrapping it in a Directionality() widget didn't work.
Is there something I'm missing? A better way to achieve this functionality?