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

Add rtl prop to more controls #3641

Merged
merged 7 commits into from
Aug 20, 2024
Merged

Add rtl prop to more controls #3641

merged 7 commits into from
Aug 20, 2024

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jul 13, 2024

Fixes #3637

Summary by Sourcery

This pull request introduces the rtl property to several controls to support right-to-left layouts, fixes an assertion in NavigationRail, and includes various refactorings to streamline control creation and logic.

  • New Features:
    • Added rtl (right-to-left) property to various controls including NavigationRailDestination, NavigationRail, AppBar, CupertinoAppBar, and NavigationDrawer to support right-to-left layouts.
  • Bug Fixes:
    • Fixed an assertion in NavigationRail to ensure elevation must be greater than 0.
  • Enhancements:
    • Refactored the creation of AppBar, CupertinoAppBar, NavigationRail, and NavigationDrawer controls to use a more concise and consistent approach.
    • Simplified conditional checks and control creation logic in CupertinoBottomSheet and NavigationDrawer.

Copy link
Contributor

sourcery-ai bot commented Jul 13, 2024

Reviewer's Guide by Sourcery

This pull request adds the rtl (right-to-left) property to various controls across the codebase, ensuring better support for right-to-left languages. Additionally, it refactors some existing code for better readability and maintainability.

File-Level Changes

Files Changes
sdk/python/packages/flet-core/src/flet_core/navigation_rail.py
sdk/python/packages/flet-core/src/flet_core/app_bar.py
sdk/python/packages/flet-core/src/flet_core/cupertino_app_bar.py
sdk/python/packages/flet-core/src/flet_core/navigation_drawer.py
Added rtl property to various controls to support right-to-left languages.
packages/flet/lib/src/controls/app_bar.dart
packages/flet/lib/src/controls/cupertino_app_bar.dart
packages/flet/lib/src/controls/navigation_rail.dart
packages/flet/lib/src/controls/navigation_drawer.dart
Refactored control classes to directly use control attributes within widget initializations, improving code readability and maintainability.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ndonkoHenri - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

# Conflicts:
#	sdk/python/packages/flet-core/src/flet_core/navigation_rail.py
@FeodorFitsner FeodorFitsner merged commit a625671 into main Aug 20, 2024
1 of 2 checks passed
@FeodorFitsner FeodorFitsner deleted the rtl branch August 20, 2024 18:10
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

Successfully merging this pull request may close these issues.

appbar RTL without page RTL
2 participants