Tkko / Flutter_Pinput

Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations, iOS autofill, Android autofill
https://pub.dev/packages/pinput
MIT License
775 stars 179 forks source link

Is there any property to set the otp text direction from left to right or right to left? Because if the language is Arabic, its direction changes from left to right to right to left. #187

Closed muhammadahmad-15 closed 5 months ago

muhammadahmad-15 commented 5 months ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Tkko commented 5 months ago

Hi, when you set the locale in MaterialApp the text direction will work as expected

    MaterialApp(
      localizationsDelegates: const [
        GlobalCupertinoLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: const [
        Locale('fa', 'IR'),
      ],
      locale: const Locale('fa', 'IR'),
      home:  MyApp(),
  )
muhammadahmad-15 commented 5 months ago

I'm using multiple languages so it was only thing that i needed to adjust. I just wrapped Pininput widget with Directionality widget and set its direction to TextDirection.ltr and it worked. Thanks for responding!!