fix(ads): refactor InterstitialAd to a Service and BannerAd to a LayoutControl#6235
fix(ads): refactor InterstitialAd to a Service and BannerAd to a LayoutControl#6235ndonkoHenri wants to merge 18 commits intomainfrom
InterstitialAd to a Service and BannerAd to a LayoutControl#6235Conversation
`flet-cli` pulls `cookiecutter`, which depends on `binaryornot` and allows unconstrained `chardet`. With `uvx`, this can resolve to `chardet==6.x`, while `requests==2.32.5` still checks for `chardet<6` and emits: `RequestsDependencyWarning: urllib3 (...) or chardet (...)/charset_normalizer (...) doesn't match a supported version` Add `chardet <6` to `sdk/python/packages/flet-cli/pyproject.toml` to keep the dependency set compatible and remove the warning during `flet build apk`.
…S and iOS permissions
…seAd, enhance BaseAd with dataclass
…nfo_plus from client to flet
…ion into new release section
…oved control hierarchy
This reverts commit aabcdfc.
Deploying flet-docs with
|
| Latest commit: |
c34a0b4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://480cbdc5.flet-docs.pages.dev |
| Branch Preview URL: | https://fix-ads.flet-docs.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
c34a0b4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fc51f043.flet-examples.pages.dev |
| Branch Preview URL: | https://fix-ads.flet-examples.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #6194 by refactoring InterstitialAd from a regular control to a Service (which auto-registers itself to the page's service registry upon instantiation, without needing to be added to page.overlay), and BannerAd from a base Control to a LayoutControl. It also separates iOS and macOS Info.plist permission handling in the CLI, and adds various documentation improvements for extension packages.
Changes:
InterstitialAdrefactored toft.ServiceandBannerAdtoft.LayoutControlinflet-ads- Cross-platform CLI permissions split into platform-specific
ios_info_plistandmacos_info_plistkeys, replacing the sharedinfo_plistkey - Documentation overhaul for several extension packages (ads, audio recorder, camera, geolocator, video, permission handler, webview)
Reviewed changes
Copilot reviewed 44 out of 47 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
flet-ads/src/flet_ads/base_ad.py |
Converted BaseAd to a @dataclass(kw_only=True) mixin on ft.BaseControl |
flet-ads/src/flet_ads/banner_ad.py |
Changed BannerAd base class to ft.LayoutControl |
flet-ads/src/flet_ads/interstitial_ad.py |
Changed InterstitialAd base class to ft.Service to fix issue #6194 |
flet-ads/CHANGELOG.md |
Documents the unreleased refactoring changes |
examples/controls/ads/example_1.py |
Updated example to use new Service-based InterstitialAd pattern |
flet-cli/src/flet_cli/commands/build_base.py |
Split iOS/macOS plist keys and updated info-plist boolean parsing |
flet-cli/pyproject.toml |
Added chardet <6 dependency |
flet/docs/audio_recorder/index.md |
Expanded platform requirements documentation |
flet/docs/video/index.md |
Expanded platform requirements documentation |
flet/docs/camera/index.md |
Expanded platform requirements documentation |
flet/docs/geolocator/index.md |
Expanded platform requirements documentation |
flet/docs/permission_handler/index.md |
Added platform-specific requirements section |
flet/docs/ads/index.md |
Reorganized ad configuration and test values |
flet/docs/ads/bannerad.md |
Minor formatting cleanup |
flet/docs/ads/interstitialad.md |
Minor formatting cleanup |
flet/docs/webview/index.md |
Improved description |
flet/docs/publish/index.md |
Reformatted long CLI commands for readability |
flet/docs/controls/image.md |
Added gapless playback example reference |
flet/docs/extras/macros/cross_platform_permissions.py |
Updated to handle ios_info_plist/macos_info_plist keys |
examples/controls/image/gapless_playback.py |
New example for Image.gapless_playback |
packages/flet/pubspec.yaml |
Moved cupertino_icons, package_info_plus, wakelock_plus to main package |
packages/flet/lib/src/controls/datatable.dart |
Added external ClipRRect when border radius + clip is set |
client/pubspec.yaml |
Cleaned up dependencies moved to flet package |
client/ios/Runner/Info.plist |
Minor XML formatting (removed space before />) |
flet-geolocator/src/flet_geolocator/geolocator.py |
Minor code style cleanups |
Multiple */pyproject.toml |
Narrowed package-data patterns for Flutter extension packages |
.codex/skills/prepare-flet-release/SKILL.md |
Added instruction to handle Unreleased changelog sections |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdk/python/packages/flet-cli/src/flet_cli/commands/build_base.py
Outdated
Show resolved
Hide resolved
| Configuration to be made to access the microphone: | ||
|
|
||
| - [`NSMicrophoneUsageDescription`](https://developer.apple.com/documentation/BundleResources/Information-Property-List/NSMicrophoneUsageDescription): Required for recording audio. | ||
| - [`com.apple.security.device.audio-input`](https://developer.apple.com/documentation/BundleResources/Entitlements/com.apple.security.device.audio-input) (optional): Required for recording audio. |
There was a problem hiding this comment.
The entitlement com.apple.security.device.audio-input is listed as "(optional)" in the bullet description, but the text also says it is "Required for recording audio." This is contradictory. If the entitlement is required for macOS audio recording, it should not be labeled as optional.
| android.permission.READ_EXTERNAL_STORAGE=True | ||
| android.permission.WRITE_EXTERNAL_STORAGE=True |
There was a problem hiding this comment.
The flet build command example is missing a backslash (\) at the end of line 54 (android.permission.READ_EXTERNAL_STORAGE=True). Without it, android.permission.WRITE_EXTERNAL_STORAGE=True on the next line will not be part of the same command and will be interpreted as a separate shell command, so it will be silently ignored.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix #6194
Test code
code
Summary by Sourcery
Refine ads controls and cross-platform permission handling while expanding and clarifying platform-specific documentation and examples.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores: