Skip to content

Commit 97d0650

Browse files
committed
Expand can be True
1 parent 5cb537a commit 97d0650

29 files changed

+62
-205
lines changed

docs/roadmap.md

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -479,24 +479,6 @@ More info:
479479
- https://api.flutter.dev/flutter/widgets/Expanded-class.html
480480
- https://api.flutter.dev/flutter/widgets/Flexible-class.html
481481

482-
## Container
483-
484-
Docs: https://api.flutter.dev/flutter/widgets/Container-class.html
485-
486-
Properties:
487-
488-
- bgColor (background color - `decoration: BoxDecoration.color`)
489-
- alignment - `topLeft`, `topCenter`, `topRight`, `centerLeft`, `center`, `centerRight`, `bottomLeft`, `bottomCenter`, `bottomRight`
490-
- border - width, color
491-
- borderRadius
492-
- verticalScroll (S2)
493-
- horizontalScroll (S2)
494-
- autoScroll (S2) - `end`, `start` ([example](https://stackoverflow.com/questions/43485529/programmatically-scrolling-to-the-end-of-a-listview)).
495-
- content - child control of any type
496-
- marging
497-
- padding
498-
- tooltip
499-
500482
## Row
501483

502484
Docs: https://api.flutter.dev/flutter/widgets/Row-class.html
@@ -638,136 +620,6 @@ Properties:
638620
- border_radius - to make rounded corners
639621
- tooltip
640622

641-
## CircleAvatar
642-
643-
Docs: https://api.flutter.dev/flutter/material/CircleAvatar-class.html
644-
645-
Properties:
646-
647-
- foregroundImageUrl
648-
- backgroundImageUrl
649-
- color
650-
- bgColor
651-
- radius
652-
- minRadius
653-
- maxRadius
654-
- content
655-
- tooltip
656-
657-
## ProgressBar
658-
659-
Docs: https://api.flutter.dev/flutter/material/LinearProgressIndicator-class.html
660-
661-
Properties:
662-
663-
- color
664-
- bgColor
665-
- barHeight
666-
- value
667-
- label
668-
- description
669-
- tooltip
670-
671-
## ProgressRing
672-
673-
Docs: https://api.flutter.dev/flutter/material/CircularProgressIndicator-class.html
674-
675-
Properties:
676-
677-
- color
678-
- bgColor
679-
- strokeWidth
680-
- value
681-
- label
682-
- labelPosition
683-
- tooltip
684-
685-
## ElevatedButton
686-
687-
Docs: https://api.flutter.dev/flutter/material/ElevatedButton-class.html
688-
689-
Properties:
690-
691-
- text
692-
- icon
693-
- iconColor
694-
- content - a Control representing custom button content
695-
- tooltip
696-
- autofocus
697-
698-
Events:
699-
700-
- click
701-
702-
## OutlinedButton
703-
704-
Docs: https://api.flutter.dev/flutter/material/OutlinedButton-class.html
705-
706-
Properties:
707-
708-
- text
709-
- icon
710-
- iconColor
711-
- content - a Control representing custom button content
712-
- tooltip
713-
- autofocus
714-
715-
Events:
716-
717-
- click
718-
719-
## TextButton
720-
721-
Docs: https://api.flutter.dev/flutter/material/TextButton-class.html
722-
723-
Properties:
724-
725-
- text
726-
- icon
727-
- iconColor
728-
- content - a Control representing custom button content
729-
- tooltip
730-
- autofocus
731-
732-
Events:
733-
734-
- click
735-
736-
## IconButton
737-
738-
Docs: https://api.flutter.dev/flutter/material/IconButton-class.html
739-
740-
Properties:
741-
742-
- icon
743-
- iconColor
744-
- bgcolor
745-
- iconSize
746-
- tooltip
747-
- content - a Control representing custom button content
748-
- autofocus
749-
750-
Events:
751-
752-
- onPressed
753-
754-
## FloatingActionButton (FAB)
755-
756-
Docs: https://api.flutter.dev/flutter/material/FloatingActionButton-class.html
757-
758-
Properties:
759-
760-
- text
761-
- icon
762-
- bgColor
763-
- content - a Control representing custom button content
764-
- tooltip
765-
- autofocus
766-
767-
Events:
768-
769-
- click
770-
771623
## RadioGroup
772624

773625
Properties:

sdk/python/flet/checkbox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -21,7 +21,7 @@ def __init__(
2121
ref: Ref = None,
2222
width: OptionalNumber = None,
2323
height: OptionalNumber = None,
24-
expand: int = None,
24+
expand: Union[bool, int] = None,
2525
opacity: OptionalNumber = None,
2626
tooltip: str = None,
2727
visible: bool = None,

sdk/python/flet/circle_avatar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -14,7 +14,7 @@ def __init__(
1414
ref: Ref = None,
1515
width: OptionalNumber = None,
1616
height: OptionalNumber = None,
17-
expand: int = None,
17+
expand: Union[bool, int] = None,
1818
opacity: OptionalNumber = None,
1919
tooltip: str = None,
2020
visible: bool = None,

sdk/python/flet/column.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import List, Optional, Union
22

33
from beartype import beartype
44

@@ -20,7 +20,7 @@ def __init__(
2020
ref: Ref = None,
2121
width: OptionalNumber = None,
2222
height: OptionalNumber = None,
23-
expand: int = None,
23+
expand: Union[bool, int] = None,
2424
opacity: OptionalNumber = None,
2525
visible: bool = None,
2626
disabled: bool = None,

sdk/python/flet/constrained_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -10,7 +10,7 @@ class ConstrainedControl(Control):
1010
def __init__(
1111
self,
1212
ref: Ref = None,
13-
expand: int = None,
13+
expand: Union[bool, int] = None,
1414
opacity: OptionalNumber = None,
1515
tooltip: str = None,
1616
visible: bool = None,

sdk/python/flet/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from typing import Optional
2+
from typing import Optional, Union
33

44
from beartype import beartype
55

@@ -24,7 +24,7 @@ def __init__(
2424
ref: Ref = None,
2525
width: OptionalNumber = None,
2626
height: OptionalNumber = None,
27-
expand: int = None,
27+
expand: Union[bool, int] = None,
2828
opacity: OptionalNumber = None,
2929
tooltip: str = None,
3030
visible: bool = None,

sdk/python/flet/control.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import datetime as dt
22
import threading
33
from difflib import SequenceMatcher
4-
from json import tool
54
from typing import Union
65

76
from beartype import beartype
@@ -59,7 +58,7 @@ class Control:
5958
def __init__(
6059
self,
6160
ref: Ref = None,
62-
expand: int = None,
61+
expand: Union[bool, int] = None,
6362
opacity: OptionalNumber = None,
6463
tooltip: str = None,
6564
visible: bool = None,
@@ -173,11 +172,15 @@ def uid(self):
173172
# expand
174173
@property
175174
def expand(self):
176-
return self._get_attr("expand")
175+
return self.__expand
177176

178177
@expand.setter
179-
def expand(self, value):
180-
self._set_attr("expand", value)
178+
@beartype
179+
def expand(self, value: Union[None, bool, int]):
180+
self.__expand = value
181+
if value and isinstance(value, bool):
182+
value = 1
183+
self._set_attr("expand", value if value else None)
181184

182185
# opacity
183186
@property

sdk/python/flet/dropdown.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -13,7 +13,7 @@ def __init__(
1313
ref: Ref = None,
1414
width: OptionalNumber = None,
1515
height: OptionalNumber = None,
16-
expand: int = None,
16+
expand: Union[bool, int] = None,
1717
opacity: OptionalNumber = None,
1818
tooltip: str = None,
1919
visible: bool = None,

sdk/python/flet/elevated_button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -14,7 +14,7 @@ def __init__(
1414
ref: Ref = None,
1515
width: OptionalNumber = None,
1616
height: OptionalNumber = None,
17-
expand: int = None,
17+
expand: Union[bool, int] = None,
1818
opacity: OptionalNumber = None,
1919
tooltip: str = None,
2020
visible: bool = None,

sdk/python/flet/floating_action_button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, Union
22

33
from beartype import beartype
44

@@ -14,7 +14,7 @@ def __init__(
1414
ref: Ref = None,
1515
width: OptionalNumber = None,
1616
height: OptionalNumber = None,
17-
expand: int = None,
17+
expand: Union[bool, int] = None,
1818
opacity: OptionalNumber = None,
1919
tooltip: str = None,
2020
visible: bool = None,

0 commit comments

Comments
 (0)