This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
def main(page): | |
page.window_height, page.window_width = 500, 400 | |
def close_yes_dlg(e): | |
page.close_dialog() | |
dlg.data.confirm_dismiss(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import os | |
import random | |
import string | |
from pathlib import Path | |
from typing import Callable | |
import flet as ft | |
from captcha.audio import AudioCaptcha | |
from captcha.image import ImageCaptcha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from size_aware_control import SizeAwareControl | |
import flet as ft | |
def main(page: ft.Page): | |
def handle_resize(e: ft.canvas.CanvasResizeEvent): | |
""" | |
The handle_resize function is a callback function that will be called when | |
the control that triggered this event is resized (ex: through window resize). | |
The CanvasResizeEvent object has several useful attributes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet.canvas as cv | |
from collections import namedtuple | |
class SizeAwareControl(cv.Canvas): | |
def __init__(self, content= None, resize_interval=100, on_resize=None, **kwargs): | |
super().__init__(**kwargs) | |
self.content = content | |
self.resize_interval = resize_interval | |
self.resize_callback = on_resize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
def main(page: ft.Page): | |
# basic page settings/config | |
page.title = "FullScreen Dialog example" | |
page.horizontal_alignment = page.vertical_alignment = "center" | |
def handle_route_change(r: ft.RouteChangeEvent): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
import random | |
class ImageCard(ft.Card): | |
# normal elevation of this card (when not hovered) | |
NORMAL_ELEVATION = 3 | |
# elevation of this card when hovered | |
HOVERED_ELEVATION = 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
import pyshorteners # pip install pyshorteners | |
shortener = pyshorteners.Shortener() | |
class ShortLinkRow(ft.Row): | |
# a row containing the shortened url, and two buttons ('copy', and 'open in browser') | |
def __init__(self, shortened_link, link_source): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
def main(page: ft.Page): | |
page.add(ft.Text(value="Hello, world!")) | |
ft.app(target=main) # add parameter view=ft.WEB_BROWSER to show the output in your browser! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flet import * | |
from flet import icons, colors | |
import pyqrcode | |
def main(page: Page): | |
page.title = "QRcode Generator" | |
page.theme_mode = "light" | |
page.window_always_on_top = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flet import * | |
from flet import icons, colors | |
import pyqrcode | |
def main(page: Page): | |
page.title = "QRcode Generator" | |
page.theme_mode = "light" |
NewerOlder