cmdrootaccess / another-flushbar

A flexible widget for user notification. Customize your text, button, duration, animations and much more. For Android devs, it is made to replace Snackbars and Toasts.
https://pub.dev/packages/another_flushbar
MIT License
145 stars 89 forks source link

RTL Support #46

Closed iMajeed16 closed 2 years ago

iMajeed16 commented 3 years ago
Yahllil commented 2 years ago

Doesn't work. Seems to be displaying the text on the left even when setting TextDirection.rtl

iMajeed16 commented 2 years ago

Doesn't work. Seems to be displaying the text on the left even when setting TextDirection.ltr

Did you mean TextDirection.rtl?. ltr it would be for the text from left to right and thus it will be on the left side.

Check this example .

Yahllil commented 2 years ago

Doesn't work. Seems to be displaying the text on the left even when setting TextDirection.ltr

Did you mean TextDirection.rtl?. ltr it would be for the text from left to right and thus it will be on the left side.

Check this example .

Yes sorry, I've edited my comment. It does not work when setting TextDirection.rtl. The Text still appears on the left side

iMajeed16 commented 2 years ago

Yes sorry, I've edited my comment. It does not work when setting TextDirection.rtl. The Text still appears on the left side

Could you please provide me some code?

Yahllil commented 2 years ago

Yes sorry, I've edited my comment. It does not work when setting TextDirection.rtl. The Text still appears on the left side

Could you please provide me some code?

Of course:

Flushbar(
      title: 'My title',
      message: 'My message',
      backgroundColor: Colors.red,
      titleColor: Colors.white,
      messageColor: Colors.white,
      borderRadius: BorderRadius.circular(25),
      flushbarPosition: FlushbarPosition.TOP,
      textDirection: TextDirection.rtl,
      onTap: (_) {
        print('Tapped');
      },
      animationDuration: const Duration(milliseconds: 500),
      duration: const Duration(seconds: 3),
    )..show(context);
iMajeed16 commented 2 years ago

Of course:

Flushbar(
      title: 'My title',
      message: 'My message',
      backgroundColor: Colors.red,
      titleColor: Colors.white,
      messageColor: Colors.white,
      borderRadius: BorderRadius.circular(25),
      flushbarPosition: FlushbarPosition.TOP,
      textDirection: TextDirection.rtl,
      onTap: (_) {
        print('Tapped');
      },
      animationDuration: const Duration(milliseconds: 500),
      duration: const Duration(seconds: 3),
    )..show(context);

After some testing if the app language is in a language that is left to right it would show it in that way even if you added TextDirection.rtl. and it depends of that.

To be clear this is only effect the indicator (the left bar) to be showed on the right if you set it to TextDirection.rtl.

Yahllil commented 2 years ago

Of course:

Flushbar(
      title: 'My title',
      message: 'My message',
      backgroundColor: Colors.red,
      titleColor: Colors.white,
      messageColor: Colors.white,
      borderRadius: BorderRadius.circular(25),
      flushbarPosition: FlushbarPosition.TOP,
      textDirection: TextDirection.rtl,
      onTap: (_) {
        print('Tapped');
      },
      animationDuration: const Duration(milliseconds: 500),
      duration: const Duration(seconds: 3),
    )..show(context);

After some testing if the app language is in a language that is left to right it would show it in that way even if you added TextDirection.rtl. and it depends of that.

To be clear this is only effect the indicator (the left bar) to be showed on the right if you set it to TextDirection.rtl.

So what is the solution for presenting the alert's text as RTL?