Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit c264295

Browse files
committed
write v0.2 changelog
1 parent eced9de commit c264295

4 files changed

Lines changed: 43 additions & 27 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- 'pyproject.toml'
1414
- '.github/workflows/docs.yml'
1515
- 'src/flet_webview/**'
16-
- 'examples/webview_example/src/main.py'
16+
- 'examples/webview_example/src/**'
1717

1818
workflow_dispatch: # Allow manual trigger from the GitHub Actions UI
1919

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Changed
1515

16-
TBA
16+
- Refactored all controls to use `@flet.control` dataclass-style definition.
1717

1818
## [0.1.0] - 2025-01-15
1919

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ To install the `flet-webview` package and add it to your project dependencies:
3838
pip install flet-webview # (1)!
3939
```
4040

41+
1. After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
42+
4143
=== "poetry"
4244
```bash
4345
poetry add flet-webview
4446
```
4547

46-
1. After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
4748

4849
## Example
4950

src/flet_webview/webview.py

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ async def can_go_back_async(self) -> bool:
158158
"""
159159
Whether there's a back history item.
160160
161+
Returns:
162+
`True` if there is a back history item, `False` otherwise.
163+
161164
Note:
162165
Works only on the following platforms: iOS, Android and macOS.
163166
"""
@@ -168,6 +171,9 @@ async def can_go_forward(self) -> bool:
168171
"""
169172
Whether there's a forward history item.
170173
174+
Returns:
175+
`True` if there is a forward history item, `False` otherwise.
176+
171177
Note:
172178
Works only on the following platforms: iOS, Android and macOS.
173179
"""
@@ -308,6 +314,9 @@ async def get_current_url_async(self) -> Optional[str]:
308314
"""
309315
Returns the current URL that the WebView is displaying or `None` if no URL was ever loaded.
310316
317+
Returns:
318+
The current URL that the WebView is displaying or `None` if no URL was ever loaded.
319+
311320
Note:
312321
Works only on the following platforms: iOS, Android and macOS.
313322
"""
@@ -318,6 +327,9 @@ async def get_title_async(self) -> Optional[str]:
318327
"""
319328
Returns the title of the currently loaded page.
320329
330+
Returns:
331+
The title of the currently loaded page.
332+
321333
Note:
322334
Works only on the following platforms: iOS, Android and macOS.
323335
"""
@@ -328,45 +340,48 @@ async def get_user_agent_async(self) -> Optional[str]:
328340
"""
329341
Returns the value used for the HTTP `User-Agent:` request header.
330342
343+
Returns:
344+
The value used for the HTTP `User-Agent:` request header.
345+
331346
Note:
332347
Works only on the following platforms: iOS, Android and macOS.
333348
"""
334349
self._check_mobile_or_mac_platform()
335350
return await self._invoke_method_async("get_user_agent")
336351

337-
def load_file(self, absolute_path: str):
352+
def load_file(self, path: str):
338353
"""
339354
Loads the provided local file.
340355
341356
Args:
342-
absolute_path (str): The absolute path to the file.
357+
path: The absolute path to the file.
343358
344359
Note:
345360
Works only on the following platforms: iOS, Android and macOS.
346361
"""
347362
self._check_mobile_or_mac_platform()
348-
asyncio.create_task(self.load_file_async(absolute_path))
363+
asyncio.create_task(self.load_file_async(path))
349364

350-
async def load_file_async(self, absolute_path: str):
365+
async def load_file_async(self, path: str):
351366
"""
352367
Loads the provided local file.
353368
354369
Args:
355-
absolute_path (str): The absolute path to the file.
370+
path: The absolute path to the file.
356371
357372
Note:
358373
Works only on the following platforms: iOS, Android and macOS.
359374
"""
360375
self._check_mobile_or_mac_platform()
361-
await self._invoke_method_async("load_file", arguments={"path": absolute_path})
376+
await self._invoke_method_async("load_file", arguments={"path": path})
362377

363378
def load_request(self, url: str, method: RequestMethod = RequestMethod.GET):
364379
"""
365380
Makes an HTTP request and loads the response in the webview.
366381
367382
Args:
368-
url (str): The URL to load.
369-
method (RequestMethod): The HTTP method to use.
383+
url: The URL to load.
384+
method: The HTTP method to use.
370385
"""
371386
self._check_mobile_or_mac_platform()
372387
asyncio.create_task(self.load_request_async(url, method))
@@ -378,8 +393,8 @@ async def load_request_async(
378393
Makes an HTTP request and loads the response in the webview.
379394
380395
Args:
381-
url (str): The URL to load.
382-
method (RequestMethod): The HTTP method to use.
396+
url: The URL to load.
397+
method: The HTTP method to use.
383398
384399
Note:
385400
Works only on the following platforms: iOS, Android and macOS.
@@ -394,7 +409,7 @@ def run_javascript(self, value: str):
394409
Runs the given JavaScript in the context of the current page.
395410
396411
Args:
397-
value (str: The JavaScript code to run.
412+
value: The JavaScript code to run.
398413
399414
Note:
400415
Works only on the following platforms: iOS, Android and macOS.
@@ -407,7 +422,7 @@ async def run_javascript_async(self, value: str):
407422
Runs the given JavaScript in the context of the current page.
408423
409424
Args:
410-
value (str): The JavaScript code to run.
425+
value: The JavaScript code to run.
411426
412427
Note:
413428
Works only on the following platforms: iOS, Android and macOS.
@@ -420,8 +435,8 @@ def load_html(self, value: str, base_url: Optional[str] = None):
420435
Loads the provided HTML string.
421436
422437
Args:
423-
value (str): The HTML string to load.
424-
base_url (str, optional): The base URL to use when resolving relative URLs within the value.
438+
value: The HTML string to load.
439+
base_url: The base URL to use when resolving relative URLs within the value.
425440
426441
Note:
427442
Works only on the following platforms: iOS, Android and macOS.
@@ -434,8 +449,8 @@ async def load_html_async(self, value: str, base_url: Optional[str] = None):
434449
Loads the provided HTML string.
435450
436451
Args:
437-
value (str): The HTML string to load.
438-
base_url (str, optional): The base URL to use when resolving relative URLs within the value.
452+
value: The HTML string to load.
453+
base_url: The base URL to use when resolving relative URLs within the value.
439454
440455
Note:
441456
Works only on the following platforms: iOS, Android and macOS.
@@ -450,8 +465,8 @@ def scroll_to(self, x: int, y: int):
450465
Scroll to the provided position of webview pixels.
451466
452467
Args:
453-
x (int): The x-coordinate of the scroll position.
454-
y (int): The y-coordinate of the scroll position.
468+
x: The x-coordinate of the scroll position.
469+
y: The y-coordinate of the scroll position.
455470
456471
Note:
457472
Works only on the following platforms: iOS, Android and macOS.
@@ -464,8 +479,8 @@ async def scroll_to_async(self, x: int, y: int):
464479
Scroll to the provided position of webview pixels.
465480
466481
Args:
467-
x (int): The x-coordinate of the scroll position.
468-
y (int): The y-coordinate of the scroll position.
482+
x: The x-coordinate of the scroll position.
483+
y: The y-coordinate of the scroll position.
469484
470485
Note:
471486
Works only on the following platforms: iOS, Android and macOS.
@@ -478,8 +493,8 @@ def scroll_by(self, x: int, y: int):
478493
Scroll by the provided number of webview pixels.
479494
480495
Args:
481-
x (int): The number of pixels to scroll by on the x-axis.
482-
y (int): The number of pixels to scroll by on the y-axis.
496+
x: The number of pixels to scroll by on the x-axis.
497+
y: The number of pixels to scroll by on the y-axis.
483498
484499
Note:
485500
Works only on the following platforms: iOS, Android and macOS.
@@ -492,8 +507,8 @@ async def scroll_by_async(self, x: int, y: int):
492507
Scroll by the provided number of webview pixels.
493508
494509
Args:
495-
x (int): The number of pixels to scroll by on the x-axis.
496-
y (int): The number of pixels to scroll by on the y-axis.
510+
x: The number of pixels to scroll by on the x-axis.
511+
y: The number of pixels to scroll by on the y-axis.
497512
498513
Note:
499514
Works only on the following platforms: iOS, Android and macOS.

0 commit comments

Comments
 (0)