bug: `BottomAppBar` custom margins break `NotchShape` calculation due to coordinate offsets
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by tracing the Python BottomAppBar and notch shape bindings into the Flutter handler that calculates the notch path; the issue names no source files or tests. Reproduce the supplied example and inspect how custom margins affect the guest rectangle and cutout coordinates. Done means the notch stays aligned with the floating action button when the bar has custom margins, with offset adjustment available through the bindings.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
When configuring a BottomAppBar with custom spatial styling (such as adjusting outer margins/paddings or wrapping its internal contents inside a padded container to make a modern "floating capsule" navigation bar), the underlying Flutter NotchShape engine fails to align the cutout coordinates properly.
Because Flet relies entirely on fixed enum declarations (ft.NotchShape.CIRCULAR_RECTANGLE) or rigid configuration wrappers (ft.AutomaticNotchShape), python developers have no mechanism to pass custom math offsets (such as adjusting dxOffset or dyOffset) or shifting guest coordinate bounds inside the shape path calculation. As a result, adding margins to the bar permanently misaligns or deletes the cutout relative to a docked FloatingActionButton's position.
Code sample
Code
import flet as ft
def main(page: ft.Page) -> None:
page.title = "Notch Shape Example"
page.bottom_appbar = ft.BottomAppBar(
content=ft.Row(
controls=[
ft.IconButton(ft.Icons.HOME, icon_color="#006A6A", icon_size=32),
ft.IconButton(
ft.Icons.ACCOUNT_BOX,
icon_color="#006A6A",
icon_size=32,
),
],
alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
),
bgcolor=ft.Colors.WHITE,
border_radius=42,
shape=ft.CircularRectangleNotchShape(),
# To make the bottom bar flay in the bottom of the screen
margin=ft.Margin.only(left=40, right=40, bottom=28),
padding=ft.Padding.only(left=14, right=14, top=10),
height=70,
# notch_margin=20
)
page.floating_action_button = ft.FloatingActionButton(
icon=ft.Icons.ADD,
shape=ft.CircleBorder(),
bgcolor="#006A6A",
on_click=lambda _: print("Floating"),
elevation=3,
)
page.floating_action_button_location = ft.FloatingActionButtonLocation.CENTER_DOCKED
page.add(ft.SafeArea(content=ft.Column(controls=[ft.Container(expand=True)])))
if __name__ == "__main__":
ft.run(main)
To reproduce
- Execute the provided Flet mini-example code sample.
Expected behavior
Developers should be able to cleanly handle notches on floating navigation elements. There should be a built-in mechanism inside Flet's NotchShape
or AutomaticNotchShape bindings to specify raw alignment translation offsets (e.g., properties like dx_offset and dy_offset), allowing the framework to execute a coordinate shift on the guest rect bounds (guest.shift(Offset(dx, dy))) before committing to the layout path generation.
Screenshots / Videos
Captures
Operating System
Linux
Operating system details
Ubuntu 24 and Android 16
Flet version
1.0.4
Regression
I'm not sure / I don't know
Suggestions
Expose offset adjustment arguments within Flet's notch configuration bindings. Under the hood in the Flutter engine wrapper, these values should translate to shifting the layout rect math properties before calculating the shape path:
// Suggestion for Flutter side handler logic:
final Rect adjustedGuest = guest.shift(Offset(dxOffset, dyOffset));
Logs
Logs
[Paste your logs here]
Additional details
No response
- Ngôn ngữ chính
- Python
- Star
- 17.4k
- Fork
- 737
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flet-dev/flet
-
feature: python 3.15 supportĐang mởfeature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
flet-dev/flet#6985 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
flet build: common [tool.flet.deep_linking] is ignored on Android and iOSCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug packaging platform: mobile
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: `flet test` fails with `ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'`Có thể đã có người làm @ndonkoHenri đã nhận 1 ngày trước. Đang mởbug
flet-dev/flet#7022 · 3 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flet-dev/flet
Issue tương tự
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
huggingface/huggingface_hub#5283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
ccxt/ccxt#31045 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug example
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày