-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Control._is_isolated()
replaced with Control.is_isolated()
Close #2721
- Loading branch information
1 parent
1a3d82d
commit 9a1e37c
Showing
6 changed files
with
22 additions
and
33 deletions.
There are no files selected for viewing
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
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
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
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
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
18 changes: 1 addition & 17 deletions
18
sdk/python/packages/flet-core/src/flet_core/user_control.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
from typing import List | ||
|
||
from flet_core.control import Control | ||
from flet_core.stack import Stack | ||
|
||
|
||
class UserControl(Stack): | ||
def build(self): | ||
pass | ||
|
||
def _build(self): | ||
content = self.build() | ||
if isinstance(content, Control): | ||
self.controls = [content] | ||
elif isinstance(content, List) and all( | ||
isinstance(control, Control) for control in content | ||
): | ||
self.controls = content | ||
else: | ||
raise Exception( | ||
f"{self.__class__.__name__}.build() method must be implemented and returning either Control or List[Control]." | ||
) | ||
|
||
def _is_isolated(self): | ||
def is_isolated(self): | ||
return True |