Repository navigation
Conversation
`LocalNotifications` service wrapping flutter_local_notifications for Android, iOS, macOS, Windows, Linux and Web: show, schedule (zoned, daily, weekly, periodic), cancel, permissions and probes, Android channels and foreground service, rich styles (big text/picture/inbox/messaging), inline-reply actions and typed on_tap/on_action/on_dismissed handlers. The plugin needs scheduled-notification receivers and core-library-desugaring Gradle flags that [tool.flet.android.*] cannot declare, so the package ships an idempotent `flet-notifications-patch` console script for the built project.
|
Sorry @Nwokike, your pull request is larger than the review limit of 150,000 diff characters |
|
Thank you for the PR! You will need to transfer ownership of https://pypi.org/project/flet-notifications/ to Flet, so we could publish it from CI and maintain. |
|
@FeodorFitsner I've invited the "flet" PyPI account as an Owner, and the invitation is pending. Since the account already maintains Flet's other packages, would this be sufficient for your team to take over maintenance and CI publishing? |
Yes, got access to it. Thanks for a quick turnaround. Local notifications will be an awesome (and long-awaited) addition to Flet! |
There was a problem hiding this comment.
🟡 Changes recommended
Missing Dart implementation files block client compilation, and Android build configuration and patching need correction.
4 open issues
What changed in this PR
Introduces flet-notifications to expose local notifications through Flet’s service API, addressing #6948.
Changes:
- Adds Python notification APIs, platform options, serialization and Android patching.
- Registers the extension in the client, workspace, build-test app and CI.
- Adds examples, documentation and Python/Dart tests.
| File | Description |
|---|---|
| website/sidebars.yml | Adds notification navigation. |
| website/docs/services/notifications/types/windowsscenario.md | Documents Windows scenarios. |
| website/docs/services/notifications/types/windowsoptions.md | Documents Windows options. |
| website/docs/services/notifications/types/weboptions.md | Documents browser options. |
| website/docs/services/notifications/types/visibility.md | Documents visibility values. |
| website/docs/services/notifications/types/style.md | Documents the style union. |
| website/docs/services/notifications/types/responsetype.md | Documents response types. |
| website/docs/services/notifications/types/repeatinterval.md | Documents repeat intervals. |
| website/docs/services/notifications/types/priority.md | Documents priority values. |
| website/docs/services/notifications/types/person.md | Documents messaging participants. |
| website/docs/services/notifications/types/pendingnotification.md | Documents pending notifications. |
| website/docs/services/notifications/types/notificationoptions.md | Documents combined options. |
| website/docs/services/notifications/types/notificationevent.md | Documents notification events. |
| website/docs/services/notifications/types/notificationerrorcode.md | Documents error codes. |
| website/docs/services/notifications/types/notificationerror.md | Documents notification errors. |
| website/docs/services/notifications/types/notificationchannel.md | Documents Android channels. |
| website/docs/services/notifications/types/notificationactioninput.md | Documents reply inputs. |
| website/docs/services/notifications/types/notificationaction.md | Documents action buttons. |
| website/docs/services/notifications/types/messagingstyle.md | Documents messaging style. |
| website/docs/services/notifications/types/message.md | Documents message records. |
| website/docs/services/notifications/types/linuxurgency.md | Documents Linux urgency. |
| website/docs/services/notifications/types/linuxoptions.md | Documents Linux options. |
| website/docs/services/notifications/types/launchdetails.md | Documents launch details. |
| website/docs/services/notifications/types/interruptionlevel.md | Documents interruption levels. |
| website/docs/services/notifications/types/inboxstyle.md | Documents inbox style. |
| website/docs/services/notifications/types/importance.md | Documents channel importance. |
| website/docs/services/notifications/types/groupalertbehavior.md | Documents group alerts. |
| website/docs/services/notifications/types/datetimecomponents.md | Documents calendar recurrence. |
| website/docs/services/notifications/types/darwinoptions.md | Documents Apple options. |
| website/docs/services/notifications/types/bigtextstyle.md | Documents expanded text. |
| website/docs/services/notifications/types/bigpicturestyle.md | Documents expanded images. |
| website/docs/services/notifications/types/androidschedulemode.md | Documents Android scheduling. |
| website/docs/services/notifications/types/androidoptions.md | Documents Android options. |
| website/docs/services/notifications/types/androidicon.md | Documents icon sources. |
| website/docs/services/notifications/types/activenotification.md | Documents active notifications. |
| website/docs/services/notifications/index.md | Adds setup and usage guidance. |
| tools/crocodocs/pyproject.toml | Registers API documentation sources. |
| sdk/python/pyproject.toml | Adds workspace integration. |
| sdk/python/packages/flet/pyproject.toml | Adds the extension dependency. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_styles.py | Tests style serialization. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_service.py | Tests service calls and exports. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_scheduling.py | Tests scheduling arguments. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_probes.py | Tests queries and permissions. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_patcher.py | Tests Android patching. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_options.py | Tests platform options. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_events.py | Tests event hydration. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_channels.py | Tests channels and foreground services. |
| sdk/python/packages/flet/integration_tests/extensions/notifications/test_actions.py | Tests actions and error helpers. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/test/scheduling_test.dart | Tests scheduling conversion. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/test/response_events_test.dart | Tests response normalization and replay. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/test/parsers_test.dart | Tests notification parsers. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/test/notifications_service_test.dart | Tests platform method mapping. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/pubspec.yaml | Declares Flutter dependencies. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/analysis_options.yaml | Enables Flutter lint rules. |
| sdk/python/packages/flet-notifications/src/flutter/flet_notifications/.gitignore | Excludes generated artifacts. |
| sdk/python/packages/flet-notifications/src/flet_notifications/types.py | Defines notification enums. |
| sdk/python/packages/flet-notifications/src/flet_notifications/styles.py | Defines rich notification styles. |
| sdk/python/packages/flet-notifications/src/flet_notifications/scheduling.py | Serializes scheduling arguments. |
| sdk/python/packages/flet-notifications/src/flet_notifications/patcher.py | Patches Android manifests and Gradle. |
| sdk/python/packages/flet-notifications/src/flet_notifications/options.py | Defines platform-specific options. |
| sdk/python/packages/flet-notifications/src/flet_notifications/local_notifications.py | Implements the Python service API. |
| sdk/python/packages/flet-notifications/src/flet_notifications/events.py | Defines query result records. |
| sdk/python/packages/flet-notifications/src/flet_notifications/channels.py | Defines Android channel configuration. |
| sdk/python/packages/flet-notifications/src/flet_notifications/base.py | Defines events and error helpers. |
| sdk/python/packages/flet-notifications/src/flet_notifications/actions.py | Defines actions and reply inputs. |
| sdk/python/packages/flet-notifications/src/flet_notifications/__init__.py | Exports the public API. |
| sdk/python/packages/flet-notifications/README.md | Introduces the package. |
| sdk/python/packages/flet-notifications/pyproject.toml | Configures packaging and patch command. |
| sdk/python/packages/flet-notifications/LICENSE | Adds an Apache license reference. |
| sdk/python/examples/extensions/notifications/notifications/pyproject.toml | Configures the example project. |
| sdk/python/examples/extensions/notifications/notifications/main.py | Demonstrates notification features. |
| sdk/python/examples/apps/flet_build_test/src/main.py | Imports the extension for build checks. |
| sdk/python/examples/apps/flet_build_test/pyproject.toml | Adds build-test dependencies. |
| client/pubspec.yaml | Adds the Flutter package dependency. |
| client/lib/main.dart | Registers the notification extension. |
| CHANGELOG.md | Announces the extension. |
| .github/workflows/ci.yml | Adds package build and publishing entries. |
Review effort: Balanced
| import 'package:flet_notifications/flet_notifications.dart' | ||
| as flet_notifications; |
| flet_notifications: | ||
| path: ../sdk/python/packages/flet-notifications/src/flutter/flet_notifications |
| if existing: | ||
| return [] |
| flet build apk --yes --project myapp --org com.example -v | ||
| flet-notifications-patch --project-root build/flutter | ||
| cd build/flutter/android && ./gradlew assembleRelease -Psplit-per-abi=true |
|
Hi @Nwokike, thanks for your PR. fyi: I am working on significantly improving your work to make it better and so it best fits the Flet codebase standard/style. For example, we won't have to "patch" on Android anymore, as I will make |
|
That’s exactly why I was happy to hand it over. You guys know the Flet codebase better than I do, so I trust your judgment on how best to implement it. |


Description
Adds the
flet-notificationsextension (Fixes #6948): aLocalNotificationsservice wrappingflutter_local_notifications22.x for Android, iOS, macOS, Windows, Linux and Web.show,schedule(zoned, daily, weekly, periodic),periodically_show,cancel/cancel_all/cancel_pendingPerson,Message,AndroidIcon)on_tap/on_action/on_dismissedhandlers, replay of taps that arrived while the app was not runningAndroidOptions,DarwinOptions,LinuxOptions,WindowsOptions,WebOptionsLayout follows flet-local-auth / flet-secure-storage: Python package plus the Dart package under
src/flutter/flet_notifications. Registered in the client,sdk/python/pyproject.toml,packages/flet/pyproject.toml, the build-test app, crocodocs and CI.The Android plugin needs scheduled-notification receivers and core-library-desugaring Gradle flags that
[tool.flet.android.*]cannot declare, so the package ships an idempotentflet-notifications-patchconsole script that injects them into a built project (documented on the service docs page).Test code
Type of change
Checklist
Additional details
packages/flet/integration_tests/extensions/notificationswith explicit@pytest.mark.asynciomarkers (matching flet's own tests), passing locally;ruff checkanddocstr-coveragepass for the new package.dart analyze, the client builds andclient/pubspec.lockregeneration are unverified locally. The Dart package's 70 widget/unit tests come along insrc/flutter/flet_notifications/test.package:flutter/widgets.dartanddart:ui, so the 1.1.0 material_ui/cupertino_ui migration does not apply to it.flet-notifications0.1.0 to 0.1.4 are published under my account. Happy to transfer the project to the flet org so CI keeps the name, or rename, once you decide.