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

NEW FEATURES: Drop Zone, Layout Builder, Window Background Blur #4441

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Wanna-Pizza
Copy link

@Wanna-Pizza Wanna-Pizza commented Nov 28, 2024

Description

New Feature: Layout Builder

Allows to know size,position of widget.

New Feature: DropZone

DropZone - widget that must have child widget (ft.Container as example) to drop files inside of it.

New Feature: WIndow Bacgkround Blur

Adding nice transparency effect to your Flet App.

Motivation

Such functionality should be by default in Flet. Such as DropZone, or LayoutBuilder, for building more complex interfaces. Acrylic - to make it look beautiful ;)

Knows Problem

LayoutBuilder may not be built correctly. In terms of, not fully optimized. But you at least have a working example of LayoutBuilder, maybe you should improve it. Because my knowledge of Dart is not good.

Test Code DropZone

import flet as ft

def main(page: ft.Page):
    page.add(
        ft.DropZone(
            content=ft.Container(ft.Text('Drop here!'),width=500,height=500,alignment=ft.alignment.center,bgcolor='red'),
            on_dropped=lambda e: print(f'Dropped: {e.files}'),
            on_entered=lambda e: print('Entered'),
            on_exited=lambda e: print('Exited')
            )
    )
ft.app(target=main)

Test Code Window Blur

import flet as ft

def main(page: ft.Page):
    page.add(ft.Text('Acrylic!'))
    page.bgcolor = 'transparent'
    page.window.bgblur = ft.bgblur.TABBED #ACRYLIC, MICA, TABBED, AERO
    page.update()
    
ft.app(target=main)

Test Code LayoutBuilder

import flet as ft

def main(page: ft.Page):
    page.add(
        ft.LayoutBuilder(
            content=ft.Container(ft.Text('LayoutBuilder'),expand=True,alignment=ft.alignment.center),
            update_size_on_init=True, # will trigger "on_change" at first build.
            expand=True,
            on_change=lambda e: print(e.width,e.height,e.x,e.y)
        
        )
    )
ft.app(target=main)

Type of change

  • This change requires a documentation update
  • New feature (non-breaking change which adds functionality)

Checklist

  • I signed the CLA.
  • 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

Screenshots

image
image
image

Additional details

Link to these features:
https://pub.dev/packages/desktop_drop
https://pub.dev/packages/flutter_acrylic
https://api.flutter.dev/flutter/widgets/LayoutBuilder-class.html

Summary by Sourcery

Add new features including Layout Builder, DropZone, and Window Background Blur to enhance the application's UI capabilities. Integrate the Flutter Acrylic package to support the new blur effect.

New Features:

  • Introduce a Layout Builder feature to determine the size and position of widgets.
  • Add a DropZone widget to enable file dropping functionality within a child widget.
  • Implement a Window Background Blur feature to add transparency effects to the application.

Enhancements:

  • Integrate the Flutter Acrylic package to support window background blur effects.

@CLAassistant
Copy link

CLAassistant commented Nov 28, 2024

CLA assistant check
All committers have signed the CLA.

@Wanna-Pizza Wanna-Pizza changed the title Dop Zone, Layout Builder, Window Background Blur NEW FEATURES: Drop Zone, Layout Builder, Window Background Blur Nov 28, 2024
@Wanna-Pizza
Copy link
Author

@FeodorFitsner

Could you check it please?

@theN1C1
Copy link

theN1C1 commented Nov 30, 2024

дай боб проверят 🙏🙏🙏🙏

@zeldridge
Copy link

I would love these features added to Flet @FeodorFitsner @ndonkoHenri

@FeodorFitsner
Copy link
Contributor

No worries, we are looking into this PR and will provide the feedback.

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.

5 participants