-
Notifications
You must be signed in to change notification settings - Fork 8
/
utils.py
38 lines (34 loc) · 939 Bytes
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import flet as ft
def ImageLoader(
src: str, width: ft.OptionalNumber, height: int, border_radius: int = 0
) -> ft.Control:
return ft.Stack(
[
ft.Container(
width=width,
height=height,
bgcolor="#e7ebf4",
border_radius=border_radius,
),
ft.Image(
src=src,
width=width,
height=height,
fit=ft.ImageFit.COVER,
repeat=ft.ImageRepeat.NO_REPEAT,
border_radius=border_radius,
),
],
width=width,
height=height,
)
def Icon(src: str, width: int, height: int) -> ft.Control:
return ft.Container(
content=ft.Image(
src=src,
width=width,
height=height,
fit=ft.ImageFit.COVER,
repeat=ft.ImageRepeat.NO_REPEAT,
)
)