Skip to content

Commit

Permalink
[reopen] Rename NavigationDestination to NavigationBarDestination
Browse files Browse the repository at this point in the history
… + some type hinting, fixes and new features (#3172)

* init commit

* `page.py` type hinting part 1, `close_snack_bar()`, Snack bar and Dialog open/close methods fixes

* Fix Inherited

* Fix `'type' object is not subscriptable`

* type hinting `page.py` final

* `auto_update` + `Page.__contains__()`

* add `@deprecated` for`NavigationDestination`, `add()`, `insert()`, `remove()` methods for `NavigationBar` and magic methods (`Control.__iadd__()`, `Control.__add__()`, `Control.__radd__()`, `Control.__isub__()`, `Control.__sub__()`, `Control.__rsub__()`, `Control.__setitem__()`

* `add()`, `remove()`, `inserrt()`: `NavigationDrawer` and `NavigationRail`

* `CupertinoNavigationBar`, `View`, `Column`, `Row`

* Type hinting `control.py`

* Fix `NameError: name 'Page' is not defined
`

* Final `add()`, `insert()`, `remove()`

* type hinting for `cupertino_navigation_bar.py`

* isort and black formatting

finnaly i made this pull

* Change `0.22.0` to `0.22.1` in deprecations

* Fix `except ImportError`

* Remove `add/insert/remove` methods + remove magic methods

* Fix `SyntaxError` and fix `Optional`

* Fix `TypeError`

* Remove `Args` and `Kwargs` from `types.py`

* Delete auto_update
  • Loading branch information
bleudev authored May 30, 2024
1 parent 4f4bd9c commit f008f39
Show file tree
Hide file tree
Showing 15 changed files with 764 additions and 511 deletions.
12 changes: 9 additions & 3 deletions sdk/python/packages/flet-core/src/flet_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
from flet_core.circle_avatar import CircleAvatar
from flet_core.column import Column
from flet_core.container import Container, ContainerTapEvent
from flet_core.control import Control, OptionalNumber
from flet_core.control import Control
from flet_core.control_event import ControlEvent
from flet_core.cupertino_action_sheet import CupertinoActionSheet
from flet_core.cupertino_action_sheet_action import CupertinoActionSheetAction
Expand Down Expand Up @@ -171,7 +171,7 @@
from flet_core.icon import Icon
from flet_core.icon_button import IconButton
from flet_core.image import Image
from flet_core.list_tile import ListTile, ListTileTitleAlignment, ListTileStyle
from flet_core.list_tile import ListTile, ListTileStyle, ListTileTitleAlignment
from flet_core.list_view import ListView
from flet_core.lottie import Lottie
from flet_core.margin import Margin
Expand All @@ -180,8 +180,8 @@
from flet_core.menu_item_button import MenuItemButton
from flet_core.navigation_bar import (
NavigationBar,
NavigationBarDestination,
NavigationBarLabelBehavior,
NavigationDestination,
)
from flet_core.navigation_drawer import NavigationDrawer, NavigationDrawerDestination
from flet_core.navigation_rail import (
Expand Down Expand Up @@ -317,20 +317,26 @@
BoxShape,
Brightness,
ClipBehavior,
ColorStr,
ControlEventFunction,
CrossAxisAlignment,
FloatingActionButtonLocation,
FontWeight,
IconStr,
ImageFit,
ImageRepeat,
LabelPosition,
MainAxisAlignment,
MaterialState,
MouseCursor,
NotchShape,
Number,
OptionalNumber,
Orientation,
PaddingValue,
PagePlatform,
ScrollMode,
SupportsStr,
TabAlignment,
TextAlign,
ThemeMode,
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/packages/flet-core/src/flet_core/app_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from flet_core.adaptive_control import AdaptiveControl
from flet_core.buttons import OutlinedBorder
from flet_core.control import Control, OptionalNumber
from flet_core.control import Control
from flet_core.ref import Ref
from flet_core.text_style import TextStyle
from flet_core.types import ClipBehavior
from flet_core.types import ClipBehavior, OptionalNumber


class AppBar(AdaptiveControl):
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/packages/flet-core/src/flet_core/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

from flet_core.adaptive_control import AdaptiveControl
from flet_core.constrained_control import ConstrainedControl
from flet_core.control import Control, OptionalNumber
from flet_core.control import Control
from flet_core.ref import Ref
from flet_core.scrollable_control import ScrollableControl
from flet_core.types import (
AnimationValue,
CrossAxisAlignment,
MainAxisAlignment,
OffsetValue,
OptionalNumber,
ResponsiveNumber,
RotateValue,
ScaleValue,
Expand Down Expand Up @@ -157,6 +158,7 @@ def _get_control_name(self):
def _get_children(self):
return self.__controls

# Public methods
def clean(self):
super().clean()
self.__controls.clear()
Expand Down
Loading

0 comments on commit f008f39

Please sign in to comment.