Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use it in other language #20

Closed
faress123 opened this issue Jul 13, 2020 · 13 comments
Closed

how to use it in other language #20

faress123 opened this issue Jul 13, 2020 · 13 comments

Comments

@faress123
Copy link

hello everyone,

I use the google_nav_bar package, it is good and very nice.

but when I convert the direction of the app to (right to left) the text is making an error.

like the photo below:

https://i.ibb.co/D183V9b/20200713-170022.jpg

how can I solve that ??

and I am sorry because my English is not very good

@sooxt98
Copy link
Owner

sooxt98 commented Jul 15, 2020

@faress123 may i know what language are you using?

@faress123
Copy link
Author

@sooxt98 I using the Arabic language

@sooxt98 sooxt98 mentioned this issue Jul 29, 2020
@sooxt98
Copy link
Owner

sooxt98 commented Jul 29, 2020

I just try with the web; it works fine; maybe it doesn't work on phone? And im using google translate
image

@sooxt98 sooxt98 modified the milestones: Support custom icon widget, Fix language RTL issue Jul 29, 2020
@omrid594
Copy link

@sooxt98 you are probably using MaterialApp, that's why its showing left to right instead of right to left.
I have the same problem - my app localization is RTL.
Thats why it showed like this >>
image

Any solution?

@sooxt98
Copy link
Owner

sooxt98 commented Jul 29, 2020

@omrid594 maybe u could try to wrap the navbar with Directionality widget

void main() {
  runApp(
    MaterialApp(
      home: Directionality( // add this
        textDirection: TextDirection.rtl, // set this property 
        child: GNav(...),
      ),
    ),
  );
}

take a look at here: https://stackoverflow.com/questions/50535185/right-to-left-rtl-in-flutter

@omrid594
Copy link

@sooxt98 Not working - The issue causes because there is Row which contains the Icon and Text in each GNav.
Because everything it RTL (due to localization) >> the Icon starts at the right side on each Row
Any way to move make the mainAxisAlignment: MainAxisAlignment.end, inside the Row?

@sooxt98
Copy link
Owner

sooxt98 commented Jul 29, 2020

Did you try textDirection: TextDirection.ltr instead of TextDirection.rtl

@omrid594
Copy link

@sooxt98 Great! the order now is backward but works just fine! Thanks a lot

@sooxt98 sooxt98 closed this as completed Jul 29, 2020
@faress123
Copy link
Author

the problem still appears,

I need to make my app always start from right to left,

but the text appears to a behind of the icon.

like that:

https://i.ibb.co/D183V9b/20200713-170022.jpg

Any Solutions?

@sooxt98
Copy link
Owner

sooxt98 commented Aug 5, 2020

@faress123 try wrap your Gnav with Directionality

void main() {
  runApp(
    MaterialApp(
      home: Directionality( // add this
        textDirection: TextDirection.ltr, // set this property 
        child: GNav(...),
      ),
    ),
  );
}

@faress123
Copy link
Author

@sooxt98 this work fine, and the text appear fine, but the app work from left to right,
like the photo here:
https://i.ibb.co/mHTq7bN/Screenshot-20200805-161842.jpg

but I need my app to work from right to left ...

@sooxt98
Copy link
Owner

sooxt98 commented Aug 5, 2020

@faress123 for ur case, I need to rewrite the UI & animation to flip the icon & text

@faress123
Copy link
Author

@sooxt98
I will be grateful to you, will there appear in the new version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants