Skip to content

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Oct 24, 2025

Fix #4322

Example Code

import flet as ft


def main(page: ft.Page):
    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

    page.bottom_appbar = ft.BottomAppBar(
        border_radius=ft.BorderRadius.all(20),
        bgcolor=ft.Colors.BLUE,
        content=ft.Row(
            controls=[
                ft.IconButton(icon=ft.Icons.MENU, icon_color=ft.Colors.WHITE),
                ft.Container(expand=True),
                ft.IconButton(icon=ft.Icons.SEARCH, icon_color=ft.Colors.WHITE),
                ft.IconButton(icon=ft.Icons.FAVORITE, icon_color=ft.Colors.WHITE),
            ]
        ),
    )

    page.add(ft.Text("Content goes here..."))


ft.run(main)

Summary by Sourcery

Enable custom border radius on BottomAppBar by introducing a new property, updating rendering logic in both Python and Dart components, and enhancing documentation and default value descriptions.

New Features:

  • Add border_radius property to BottomAppBar with automatic clipping support

Enhancements:

  • Standardize default fallback descriptions for BottomAppBar properties (bgcolor, shadow_color, padding, clip_behavior, shape, elevation)
  • Adjust clip behavior logic in Dart renderer to respect border_radius settings
  • Refine FloatingActionButton docstrings to use consistent error messages for negative values

Documentation:

  • Add a custom border radius example and image to BottomAppBar documentation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a border_radius property to the BottomAppBar control, allowing developers to customize the corner rounding of the bottom app bar. The implementation also updates documentation formatting and error messages for consistency.

  • Added border_radius property to BottomAppBar with corresponding Python and Dart implementations
  • Updated clip_behavior to automatically default to ANTI_ALIAS when border radius is applied
  • Improved documentation strings across multiple properties for clarity and consistency

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/python/packages/flet/src/flet/controls/material/bottom_app_bar.py Added border_radius property, updated property documentation, and modified clip_behavior default behavior
packages/flet/lib/src/controls/bottom_app_bar.dart Implemented border radius rendering using ClipRRect wrapper with automatic clip behavior handling
sdk/python/examples/controls/bottom_app_bar/border_radius.py Added example demonstrating the new border_radius property usage
sdk/python/packages/flet/docs/controls/bottomappbar.md Added documentation section for custom border radius feature
sdk/python/packages/flet/src/flet/controls/material/floating_action_button.py Standardized error message formatting in documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Raises:
ValueError: If [`highlight_elevation`][(c).] is negative.
ValueError:If it is less than `0`.
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

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

Missing space after colon. Should be 'ValueError: If' not 'ValueError:If'.

Suggested change
ValueError:If it is less than `0`.
ValueError: If it is less than `0`.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix it?

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.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f6c4784
Status: ✅  Deploy successful!
Preview URL: https://13a5f35a.flet-docs.pages.dev
Branch Preview URL: https://bottom-appbar-radius.flet-docs.pages.dev

View logs

@FeodorFitsner
Copy link
Contributor

Example screenshot must be generated with integration test. See example here: packages/flet/integration_tests/examples/material/test_bottom_app_bar.py
You will probably need to set window size like, for example, in this test: packages/flet/integration_tests/examples/material/test_bottom_sheet.py

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.

Make it possible to change BottomAppBar's border radius

2 participants