flet-webview 0.1.0.dev1__py3-none-any.whl → 0.2.0.dev49__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flet-webview might be problematic. Click here for more details.
- flet_webview/__init__.py +7 -7
- flet_webview/types.py +71 -0
- flet_webview/webview.py +432 -413
- flet_webview-0.2.0.dev49.dist-info/METADATA +67 -0
- flet_webview-0.2.0.dev49.dist-info/RECORD +23 -0
- {flet_webview-0.1.0.dev1.dist-info → flet_webview-0.2.0.dev49.dist-info}/WHEEL +1 -1
- flet_webview-0.2.0.dev49.dist-info/licenses/LICENSE +201 -0
- flutter/flet_webview/lib/flet_webview.dart +1 -1
- flutter/flet_webview/lib/src/extension.dart +16 -0
- flutter/flet_webview/lib/src/utils/webview.dart +3 -5
- flutter/flet_webview/lib/src/webview.dart +7 -19
- flutter/flet_webview/lib/src/webview_mobile_and_mac.dart +129 -143
- flutter/flet_webview/lib/src/webview_web.dart +2 -3
- flutter/flet_webview/lib/src/webview_web_vain.dart +2 -8
- flutter/flet_webview/lib/src/webview_windows_and_linux.dart +2 -9
- flutter/flet_webview/lib/src/webview_windows_and_linux_vain.dart +1 -3
- flutter/flet_webview/pubspec.lock +175 -126
- flutter/flet_webview/pubspec.yaml +10 -5
- flet_webview-0.1.0.dev1.dist-info/METADATA +0 -42
- flet_webview-0.1.0.dev1.dist-info/RECORD +0 -21
- flutter/flet_webview/lib/src/create_control.dart +0 -20
- {flet_webview-0.1.0.dev1.dist-info → flet_webview-0.2.0.dev49.dist-info}/top_level.txt +0 -0
flet_webview/__init__.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
WebviewScrollEvent,
|
|
1
|
+
from .types import (
|
|
2
|
+
LogLevelSeverity,
|
|
3
|
+
RequestMethod,
|
|
4
|
+
WebViewConsoleMessageEvent,
|
|
5
|
+
WebViewJavaScriptEvent,
|
|
6
|
+
WebViewScrollEvent,
|
|
8
7
|
)
|
|
8
|
+
from .webview import WebView
|
flet_webview/types.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"RequestMethod",
|
|
8
|
+
"LogLevelSeverity",
|
|
9
|
+
"WebViewScrollEvent",
|
|
10
|
+
"WebViewConsoleMessageEvent",
|
|
11
|
+
"WebViewJavaScriptEvent",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RequestMethod(Enum):
|
|
16
|
+
"""Defines the supported HTTP methods for loading a page in a `WebView`."""
|
|
17
|
+
|
|
18
|
+
GET = "get"
|
|
19
|
+
"""HTTP GET method."""
|
|
20
|
+
|
|
21
|
+
POST = "post"
|
|
22
|
+
"""HTTP POST method."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class LogLevelSeverity(Enum):
|
|
26
|
+
"""Represents the severity of a JavaScript log message."""
|
|
27
|
+
|
|
28
|
+
ERROR = "error"
|
|
29
|
+
"""
|
|
30
|
+
Indicates an error message was logged via an "error" event of the
|
|
31
|
+
`console.error` method.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
WARNING = "warning"
|
|
35
|
+
"""Indicates a warning message was logged using the `console.warning` method."""
|
|
36
|
+
|
|
37
|
+
DEBUG = "debug"
|
|
38
|
+
"""Indicates a debug message was logged using the `console.debug` method."""
|
|
39
|
+
|
|
40
|
+
INFO = "info"
|
|
41
|
+
"""Indicates an informational message was logged using the `console.info` method."""
|
|
42
|
+
|
|
43
|
+
LOG = "log"
|
|
44
|
+
"""Indicates a log message was logged using the `console.log` method."""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass
|
|
48
|
+
class WebViewScrollEvent(ft.Event[ft.EventControlType]):
|
|
49
|
+
x: float
|
|
50
|
+
"""The value of the horizontal offset with the origin being at the leftmost of the `WebView`."""
|
|
51
|
+
|
|
52
|
+
y: float
|
|
53
|
+
"""The value of the vertical offset with the origin being at the topmost of the `WebView`."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass
|
|
57
|
+
class WebViewConsoleMessageEvent(ft.Event[ft.EventControlType]):
|
|
58
|
+
message: str
|
|
59
|
+
"""The message written to the console."""
|
|
60
|
+
|
|
61
|
+
severity_level: LogLevelSeverity
|
|
62
|
+
"""The severity of a JavaScript log message."""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass
|
|
66
|
+
class WebViewJavaScriptEvent(ft.Event[ft.EventControlType]):
|
|
67
|
+
message: str
|
|
68
|
+
"""The message to be displayed in the window."""
|
|
69
|
+
|
|
70
|
+
url: str
|
|
71
|
+
"""The URL of the page requesting the dialog."""
|