Skip to content

flet-flashlight#

pypi downloads license

A Flet extension to manage the device torch/flashlight.

It is based on the flashlight Flutter package.

Platform Support#

This package supports the following platforms:

Platform Supported
Windows
macOS
Linux
iOS
Android
Web

Usage#

Installation#

To install the flet-flashlight package and add it to your project dependencies:

uv add flet-flashlight
pip install flet-flashlight  # (1)!
  1. After this, you will have to manually add this package to your requirements.txt or pyproject.toml.
poetry add flet-flashlight

Example#

main.py
import flet as ft

import flet_flashlight as ffl


def main(page: ft.Page):
    flashlight = ffl.Flashlight()
    page.services.append(flashlight)

    page.add(ft.TextButton("toggle", on_click=lambda _: flashlight.toggle()))


ft.run(main)