Flet v0.26.0 Release Announcement
The Flet 0.26.0 release is here, featuring a significant update to the extensibility approach!
In summary, a Flet extension is now a single Python package that bundles both Python and Flutter code. This package can be part of your Flet project or hosted in a public Git repository or PyPI.
Built-in Flet extensions, such as Audio, Video, and Map, have been moved to their own repositories. You’re welcome to fork these extensions to create your own or contribute to Flet! These extensions have been published to PyPI, making them easy to include in your Flet app. To use them, simply add the desired extensions to the dependencies section of your pyproject.toml file.
How to upgrade
Run the following command to upgrade Flet:
pip install 'flet[all]' --upgrade
[all] is an "extra" specifier which tells pip to install or upgrade all flet packages: flet, flet-cli, flet-desktop and flet-web.
Bump flet package version to 0.26.0 (or remove it at all to use the latest) in your pyproject.toml.
Extensibility changes
Built-in extensions
Flet controls based on 3rd-party Flutter packages that used to be a part of Flet repository, now have been moved to separate repos and published on pypi:
- flet-ads
- flet-audio
- flet-audio-recorder
- flet-flashlight
- flet-geolocator
- flet-lottie
- flet-map
- flet-permission-handler
- flet-rive
- flet-video
- flet-webview
To use a built-in Flet extension in your project, add it to the dependencies section of your pyproject.toml file, for example:
dependencies = [
"flet-audio",
"flet>=0.26.0",
]
User extensions
Flet now makes it easy to create and build projects with your custom controls based on Flutter widgets or Flutter 3rd-party packages:
-
Create new virtual enviroment and install Flet there.
-
Create new Flet extension project from template:
flet create --template extension --project-name my-control
A project with new MyControl control will be created. The control is just a Flutter Text widget with a single text property.
- Build your app.
Flet project created from extension template has examples/my_control_example folder with the example app.
When in the folder where your pyproject.toml for the app is, run flet build command, for example, for macOS:
flet build macos -v
Run the app and see the new custom Flet Control:
open build/macos/my-control-example.app
Read more about how to customise your extension here.
Development environment configuration
To enhance the developer experience with the flet build command, Flet 0.26.0 ensures that the correct versions of Flutter SDK, Java (JDK), and Android SDK are installed. If any of these are missing or outdated, it automatically installs them for you.
You still need to install Visual Studio 2022 yourself if you're building a Flet app for Windows, or Xcode if you're building for iOS or macOS.
In the next releases we are going to introduce automatic configuration and startup of Android and iOS emulators.
Flutter 3.27
Flet has been migrated to Flutter SDK 3.27. See this pull request for new and updated control properties.
Python 3.9
Flet 0.26.0 requires Python 3.9 or later. Python 3.8 has reached EOL.
Other changes
- Optional on-demand creation of
ListView.controls(#3931) - Reset
InteractiveViewertranformations (#4391) - Passthrough of mouse events from main window to other applications (#1438)
- Implemented
Window.ignore_mouse_events(#4465) - Adding Google/Android TV platform support (#4581)
- Remove
Optional[]from predefined typing*Values (#4702) - Throttle
InteractiveViewerupdate events (#4704) - Remove v0.26.0-related deprecations (#4456)
Bug fixes
- Fixed: Update project_dependencies.py (#4459)
- Fixed:
SafeAreaobject has no attribute_SafeArea__minimum(#4500) - Fixed: Tooltip corruption in
SegmentandBarChartRodonupdate()(#4525) - Fixed: Setting
CheckBox.border_side.stroke_alignto an Enum fails (#4526) - Fixed:
ControlStateshould be resolved based on user-defined order (#4556) - Fixed: broken
Dismissible.dismiss_direction(#4557) - Fixed: Fix Rive not updating (#4582)
- Fixed:
DatePickerregression with first and last dates (#4661) flet buildcommand: Copyflutter-packages, support for platform-specific dependencies (#4667)- Fixed:
CupertinoBottomSheetapplies a red color and yellow underline toTextcontent (#4673) - Fixed: setting
ButtonThemedisplays a grey screen (#4731) - Fixed:
Textfieldinput border color considers user-specifiedborder_colorproperty (#4735) - Fixed: make
Tooltip.messagea required parameter (#4736)
Conclusion
Upgrade to Flet 0.26.0, test your apps and let us know how you find the new features we added.
If you have any questions, please join Flet Discord server or create a new thread on Flet GitHub discussions.
Happy Flet-ing! 👾