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

remove AdjustableScrollController() #4145

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

OwenMcDonnell
Copy link
Contributor

@OwenMcDonnell OwenMcDonnell commented Oct 11, 2024

Description

Removal of conditional assignment of scrollController in Grid View widget.
Fixes #3963

Test Code

import flet as ft

def main(page: ft.Page):
    page.title = "GridView Example"
    page.theme_mode = ft.ThemeMode.DARK
    page.padding = 50
    page.update()

    images = ft.GridView(
        expand=1,
        runs_count=5,
        max_extent=150,
        child_aspect_ratio=1.0,
        spacing=5,
        run_spacing=5
    )

    page.add(images)

    for i in range(0, 60):
        images.controls.append(
            ft.Image(
                src=f"https://picsum.photos/150/150?{i}",
                fit=ft.ImageFit.NONE,
                repeat=ft.ImageRepeat.NO_REPEAT,
                border_radius=ft.border_radius.all(10),
            )
        )
    page.update()

ft.app(main)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes

Summary by Sourcery

Remove the use of AdjustableScrollController and replace it with ScrollController in GridView, ListView, and ScrollableControl widgets to simplify the scroll controller logic and fix related issues.

Bug Fixes:

  • Remove conditional assignment of AdjustableScrollController in GridView, ListView, and ScrollableControl widgets.

Enhancements:

  • Simplify scroll controller logic by using ScrollController directly instead of AdjustableScrollController.

@FeodorFitsner FeodorFitsner merged commit fae728e into flet-dev:main Oct 17, 2024
2 checks passed
@ndonkoHenri
Copy link
Contributor

@sourcery-ai review

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.

Scroll gets stuck when using scrollbar or dragging touch
3 participants