Skip to content

Commit c0e6ae8

Browse files
committed
update types docs
1 parent 903ecf8 commit c0e6ae8

20 files changed

Lines changed: 131 additions & 154 deletions
2.76 MB
Loading

sdk/python/packages/flet/docs/ads/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Based on the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) Flu
1111

1212
## Platform Support
1313

14-
| Platform | Windows | macOS | Linux | iOS | Android | Web |
15-
|----------|---------|-------|-------|-----|---------|-----|
16-
| Supported| | | | | | |
14+
| Platform | Windows | macOS | Linux | iOS | Android | Web |
15+
|-----------|---------|-------|-------|-----|---------|-----|
16+
| Supported | | | | | | |
1717

1818
## Usage
1919

@@ -39,7 +39,7 @@ pip install flet-ads # (1)!
3939
--8<-- "{{ examples }}/example_1.py"
4040
```
4141

42-
{{ image(example_images + "/example_1.gif", alt="example_1", width="80%") }}
42+
{{ image(example_images + "/example_1.gif", width="80%") }}
4343

4444

4545
## Packaging
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
{{ class_all_options("flet.Alignment", members_order="source") }}
1+
---
2+
class_name: flet.Alignment
3+
examples: ../../examples/controls/types/alignment
4+
---
25

3-
## Examples
6+
{{ class_all_options(class_name, members_order="source") }}
47

5-
### Example 1
8+
## Examples
69

7-
```python
8-
--8<-- "../../examples/controls/types/alignment/container.py"
9-
```
10+
### Basic example
1011

11-
{{ image("../examples/controls/types/alignment/media/container.png", alt="container", width="80%") }}
12+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}

sdk/python/packages/flet/docs/types/badge.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ example_images: ../test-images/examples/material/golden/macos/badge
1010

1111
### Badge decorating an icon on a NavigationBar
1212

13-
```python
14-
--8<-- "{{ examples }}/basic.py"
15-
```
16-
17-
{{ demo("badge/basic", height="420", width="80%") }}
13+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}
1814

1915

2016
{{ class_members(class_name) }}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
{{ class_all_options("flet.Blur") }}
1+
---
2+
class_name: flet.Blur
3+
examples: ../../examples/controls/types/blur
4+
---
25

3-
## Examples
6+
{{ class_all_options(class_name) }}
47

5-
### Example 1
8+
## Examples
69

7-
```python
8-
--8<-- "../../examples/controls/types/blur/container.py"
9-
```
10+
### Basic example
1011

11-
{{ image("../examples/controls/types/blur/media/container.gif", alt="container", width="80%") }}
12+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
---
2+
class_name: flet.Border
3+
examples: ../../examples/controls/types/border
4+
---
5+
16
{{ class_all_options("flet.Border") }}
27

38
## Examples
49

5-
### Example 1
10+
### Basic example
611

7-
```python
8-
--8<-- "../../examples/controls/types/border/container.py"
9-
```
12+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}

sdk/python/packages/flet/docs/types/borderradius.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{{ class_all_options("flet.BorderRadius") }}
1+
---
2+
class_name: flet.BorderRadius
3+
---
4+
5+
{{ class_all_options(class_name) }}
26

37
## Usage example
48

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
{{ class_all_options("flet.BoxShadow") }}
1+
---
2+
class_name: flet.BoxShadow
3+
examples: ../../examples/controls/types/box_shadow
4+
---
5+
6+
{{ class_all_options(class_name) }}
27

38
## Examples
49

5-
### Example 1
10+
### Basic example
611

7-
```python
8-
--8<-- "../../examples/controls/types/box_shadow/container.py"
9-
```
12+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}

sdk/python/packages/flet/docs/types/controlstate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ ft.Radio(fill_color=ft.Colors.GREEN)
1616

1717
For more control, you can provide a dictionary where the key is the state name and the value is the corresponding color.
1818

19-
#### **Ordering Matters**
19+
#### Ordering Matters
2020

2121
- The order in which states appear in the dictionary will determine their priority, allowing for flexibility and
2222
customization.
2323
- The position of `DEFAULT` does not affect behavior—it always has the least priority and can be placed anywhere in the
2424
dictionary.
2525

26-
#### **Example**
26+
#### Example
2727

2828
To configure different fill colors of a [`Radio`][flet.Radio] button for `ControlState.HOVERED` and
2929
`ControlState.FOCUSED`, with a fallback color for all other states:
Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,12 @@
1-
{{ class_all_options("flet.CrossAxisAlignment", separate_signature=False) }}
1+
---
2+
class_name: flet.CrossAxisAlignment
3+
examples: ../../examples/controls/types/cross_axis_alignment
4+
---
25

3-
## Usage example
6+
{{ class_all_options(class_name, separate_signature=False) }}
47

5-
<img src="/img/docs/controls/column/column-horiz-alignment.png" className="screenshot-50" />
8+
## Examples
69

7-
<Tabs groupId="language">
8-
<TabItem value="python" label="Python" default>
10+
### Basic example
911

10-
```python
11-
import flet as ft
12-
13-
def main(page: ft.Page):
14-
def items(count):
15-
items = []
16-
for i in range(1, count + 1):
17-
items.append(
18-
ft.Container(
19-
content=ft.Text(value=str(i)),
20-
alignment=ft.alignment.center,
21-
width=50,
22-
height=50,
23-
bgcolor=ft.Colors.AMBER_500,
24-
)
25-
)
26-
return items
27-
28-
def column_with_horiz_alignment(align: ft.CrossAxisAlignment):
29-
return ft.Column(
30-
[
31-
ft.Text(str(align), size=16),
32-
ft.Container(
33-
content=ft.Column(
34-
items(3),
35-
alignment=ft.MainAxisAlignment.START,
36-
horizontal_alignment=align,
37-
),
38-
bgcolor=ft.Colors.AMBER_100,
39-
width=100,
40-
),
41-
]
42-
)
43-
44-
page.add(
45-
ft.Row(
46-
[
47-
column_with_horiz_alignment(ft.CrossAxisAlignment.START),
48-
column_with_horiz_alignment(ft.CrossAxisAlignment.CENTER),
49-
column_with_horiz_alignment(ft.CrossAxisAlignment.END),
50-
],
51-
spacing=30,
52-
alignment=ft.MainAxisAlignment.START,
53-
)
54-
)
55-
56-
ft.run(main)
57-
```
58-
</TabItem>
59-
</Tabs>
12+
{{ code_and_demo(examples + "/basic.py", demo_height="420", demo_width="80%") }}

0 commit comments

Comments
 (0)