flet-ads 0.2.0.dev38__py3-none-any.whl → 0.2.0.dev505__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-ads might be problematic. Click here for more details.
- flet_ads/__init__.py +12 -5
- flet_ads/banner_ad.py +7 -5
- flet_ads/base_ad.py +15 -13
- flet_ads/interstitial_ad.py +3 -8
- flet_ads/native_ad.py +7 -6
- {flet_ads-0.2.0.dev38.dist-info → flet_ads-0.2.0.dev505.dist-info}/METADATA +6 -4
- flet_ads-0.2.0.dev505.dist-info/RECORD +11 -0
- flet_ads-0.2.0.dev38.dist-info/RECORD +0 -11
- {flet_ads-0.2.0.dev38.dist-info → flet_ads-0.2.0.dev505.dist-info}/WHEEL +0 -0
- {flet_ads-0.2.0.dev38.dist-info → flet_ads-0.2.0.dev505.dist-info}/licenses/LICENSE +0 -0
- {flet_ads-0.2.0.dev38.dist-info → flet_ads-0.2.0.dev505.dist-info}/top_level.txt +0 -0
flet_ads/__init__.py
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
from .banner_ad import BannerAd
|
|
2
|
-
from .base_ad import BaseAd
|
|
3
|
-
from .interstitial_ad import InterstitialAd
|
|
4
|
-
from .types import (
|
|
1
|
+
from flet_ads.banner_ad import BannerAd
|
|
2
|
+
from flet_ads.base_ad import BaseAd
|
|
3
|
+
from flet_ads.interstitial_ad import InterstitialAd
|
|
4
|
+
from flet_ads.types import (
|
|
5
5
|
AdRequest,
|
|
6
6
|
PaidAdEvent,
|
|
7
7
|
PrecisionType,
|
|
8
8
|
)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
__all__ = [
|
|
11
|
+
"AdRequest",
|
|
12
|
+
"BannerAd",
|
|
13
|
+
"BaseAd",
|
|
14
|
+
"InterstitialAd",
|
|
15
|
+
"PaidAdEvent",
|
|
16
|
+
"PrecisionType",
|
|
17
|
+
]
|
flet_ads/banner_ad.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
import flet as ft
|
|
2
4
|
|
|
3
|
-
from .base_ad import BaseAd
|
|
4
|
-
from .types import PaidAdEvent
|
|
5
|
+
from flet_ads.base_ad import BaseAd
|
|
6
|
+
from flet_ads.types import PaidAdEvent
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
@ft.control("BannerAd")
|
|
@@ -10,10 +12,10 @@ class BannerAd(BaseAd):
|
|
|
10
12
|
Displays a banner ad.
|
|
11
13
|
|
|
12
14
|
Raises:
|
|
13
|
-
AssertionError: When
|
|
15
|
+
AssertionError: When this control is used on a web and/or non-mobile platform.
|
|
14
16
|
"""
|
|
15
17
|
|
|
16
|
-
on_will_dismiss: ft.
|
|
18
|
+
on_will_dismiss: Optional[ft.ControlEventHandler["BannerAd"]] = None
|
|
17
19
|
"""
|
|
18
20
|
Called before dismissing a full screen view.
|
|
19
21
|
|
|
@@ -21,7 +23,7 @@ class BannerAd(BaseAd):
|
|
|
21
23
|
Only available on iOS.
|
|
22
24
|
"""
|
|
23
25
|
|
|
24
|
-
on_paid: ft.
|
|
26
|
+
on_paid: Optional[ft.ControlEventHandler[PaidAdEvent["BannerAd"]]] = None
|
|
25
27
|
"""
|
|
26
28
|
Called when this ad is estimated to have earned money.
|
|
27
29
|
|
flet_ads/base_ad.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from dataclasses import field
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
import flet as ft
|
|
4
5
|
|
|
@@ -24,44 +25,45 @@ class BaseAd(ft.Control):
|
|
|
24
25
|
Targeting information used to fetch an Ad.
|
|
25
26
|
"""
|
|
26
27
|
|
|
27
|
-
on_load: ft.
|
|
28
|
+
on_load: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
28
29
|
"""
|
|
29
30
|
Called when this ad is loaded successfully.
|
|
30
31
|
"""
|
|
31
32
|
|
|
32
|
-
on_error: ft.
|
|
33
|
+
on_error: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
33
34
|
"""
|
|
34
35
|
Called when an ad request failed.
|
|
35
|
-
|
|
36
|
-
Event handler argument `data` property
|
|
36
|
+
|
|
37
|
+
Event handler argument [`data`][flet.Event.data] property
|
|
38
|
+
contains information about the error.
|
|
37
39
|
"""
|
|
38
40
|
|
|
39
|
-
on_open: ft.
|
|
41
|
+
on_open: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
40
42
|
"""
|
|
41
43
|
Called when this ad opens up.
|
|
42
|
-
|
|
44
|
+
|
|
43
45
|
A full screen view/overlay is presented in response to the user clicking
|
|
44
46
|
on an ad. You may want to pause animations and time sensitive
|
|
45
47
|
interactions.
|
|
46
48
|
"""
|
|
47
49
|
|
|
48
|
-
on_close: ft.
|
|
50
|
+
on_close: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
49
51
|
"""
|
|
50
52
|
Called when the full screen view has been closed. You should restart
|
|
51
|
-
anything paused while handling [`on_open`][
|
|
53
|
+
anything paused while handling [`on_open`][flet_ads.BaseAd.on_open].
|
|
52
54
|
"""
|
|
53
55
|
|
|
54
|
-
on_impression: ft.
|
|
56
|
+
on_impression: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
55
57
|
"""
|
|
56
58
|
Called when an impression occurs on this ad.
|
|
57
59
|
"""
|
|
58
60
|
|
|
59
|
-
on_click: ft.
|
|
61
|
+
on_click: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
60
62
|
"""
|
|
61
63
|
Called when this ad is clicked.
|
|
62
64
|
"""
|
|
63
65
|
|
|
64
66
|
def before_update(self):
|
|
65
|
-
assert (
|
|
66
|
-
|
|
67
|
-
)
|
|
67
|
+
assert not self.page.web and self.page.platform.is_mobile(), (
|
|
68
|
+
f"{self.__class__.__name__} is only supported on Mobile (Android and iOS)"
|
|
69
|
+
)
|
flet_ads/interstitial_ad.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
|
|
3
1
|
import flet as ft
|
|
4
2
|
|
|
5
|
-
from .base_ad import BaseAd
|
|
3
|
+
from flet_ads.base_ad import BaseAd
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
@ft.control("InterstitialAd")
|
|
@@ -14,8 +12,5 @@ class InterstitialAd(BaseAd):
|
|
|
14
12
|
AssertionError: When using this control on a web and/or non-mobile platform.
|
|
15
13
|
"""
|
|
16
14
|
|
|
17
|
-
def show(self):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
async def show_async(self):
|
|
21
|
-
await self._invoke_method_async("show")
|
|
15
|
+
async def show(self):
|
|
16
|
+
await self._invoke_method("show")
|
flet_ads/native_ad.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import flet as ft
|
|
2
2
|
|
|
3
|
-
from .banner_ad import BannerAd
|
|
4
|
-
from .types import NativeAdTemplateStyle
|
|
3
|
+
from flet_ads.banner_ad import BannerAd
|
|
4
|
+
from flet_ads.types import NativeAdTemplateStyle
|
|
5
5
|
|
|
6
6
|
__all__ = ["NativeAd"]
|
|
7
7
|
|
|
@@ -12,7 +12,8 @@ class NativeAd(BannerAd):
|
|
|
12
12
|
Renders a native ad.
|
|
13
13
|
|
|
14
14
|
Raises:
|
|
15
|
-
AssertionError: When neither [`factory_id`][
|
|
15
|
+
AssertionError: When neither [`factory_id`][(c).] nor
|
|
16
|
+
[`template_style`][(c).] is set.
|
|
16
17
|
"""
|
|
17
18
|
|
|
18
19
|
factory_id: str = None
|
|
@@ -27,6 +28,6 @@ class NativeAd(BannerAd):
|
|
|
27
28
|
|
|
28
29
|
def before_update(self):
|
|
29
30
|
super().before_update()
|
|
30
|
-
assert (
|
|
31
|
-
|
|
32
|
-
)
|
|
31
|
+
assert self.factory_id is not None or self.template_style is not None, (
|
|
32
|
+
"factory_id or template_style must be set"
|
|
33
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-ads
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev505
|
|
4
4
|
Summary: Display Google Ads in Flet apps.
|
|
5
5
|
Author-email: Flet contributors <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -41,7 +41,9 @@ This package supports the following platforms:
|
|
|
41
41
|
| Android | ✅ |
|
|
42
42
|
| Web | ❌ |
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Installation
|
|
45
47
|
|
|
46
48
|
To install the `flet-ads` package and add it to your project dependencies:
|
|
47
49
|
|
|
@@ -61,6 +63,6 @@ To install the `flet-ads` package and add it to your project dependencies:
|
|
|
61
63
|
poetry add flet-ads
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
### Examples
|
|
65
67
|
|
|
66
|
-
For examples, see [
|
|
68
|
+
For examples, see [these](./examples).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
flet_ads/__init__.py,sha256=tm30fkWLlgwJXpjTg784n4xeh_Box2UfZ-B4ULugq_s,334
|
|
2
|
+
flet_ads/banner_ad.py,sha256=-izrx1lxhrt_rMHMA7ltLSaOuZMmxNFHWDwoxU7Qk4U,696
|
|
3
|
+
flet_ads/base_ad.py,sha256=Ln6OYjq1UVHVi05gsLILovGw5X-G9gPkAN83gdo7r4Y,1824
|
|
4
|
+
flet_ads/interstitial_ad.py,sha256=2PZyAxwmLgBdbIrJc20d3eCurBV8RJ0Bd0aZeHvabdQ,344
|
|
5
|
+
flet_ads/native_ad.py,sha256=MII44loDGWjjBjfuEUqFBCEyrQ89RaL4htmKoiN9InM,769
|
|
6
|
+
flet_ads/types.py,sha256=q1Hpmu_w6afkG6ovLUgToWSRVb1Euf-OVlf52si00VM,3212
|
|
7
|
+
flet_ads-0.2.0.dev505.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
+
flet_ads-0.2.0.dev505.dist-info/METADATA,sha256=gVSTpczOSWuV1LyNrHUddtyAILoJ5Ub42fJ6hfHb8hc,1885
|
|
9
|
+
flet_ads-0.2.0.dev505.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
flet_ads-0.2.0.dev505.dist-info/top_level.txt,sha256=gv6ICx8xIfzUQalF99v9x0gh0g0R8EPksQFAknB3baM,9
|
|
11
|
+
flet_ads-0.2.0.dev505.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
flet_ads/__init__.py,sha256=IJRqRlozCGkISTdcXX7xn7-jzUtp1yMp6y2msgpPR6g,316
|
|
2
|
-
flet_ads/banner_ad.py,sha256=esnqiKAmeaLEpBSJfO1_z847FyKvTrtk3YypjRh8d0U,645
|
|
3
|
-
flet_ads/base_ad.py,sha256=lYuEWwYVVd1qTmVFt02igcAS-g6tOcFzwbO4Li18mY0,1748
|
|
4
|
-
flet_ads/interstitial_ad.py,sha256=KXGcf0bXIDDw4gPeo4O0vR3LK9wgRSa6gAzxPl40qNg,432
|
|
5
|
-
flet_ads/native_ad.py,sha256=-4xOvEjaIWCWSQbgPX1JBpqOTBARN-cwaPPTPuQxCrQ,737
|
|
6
|
-
flet_ads/types.py,sha256=q1Hpmu_w6afkG6ovLUgToWSRVb1Euf-OVlf52si00VM,3212
|
|
7
|
-
flet_ads-0.2.0.dev38.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
-
flet_ads-0.2.0.dev38.dist-info/METADATA,sha256=SYla7hgDCSQe5bU0aebE2cCxLHxbY_f6jkrPW2FfY2U,1870
|
|
9
|
-
flet_ads-0.2.0.dev38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
flet_ads-0.2.0.dev38.dist-info/top_level.txt,sha256=gv6ICx8xIfzUQalF99v9x0gh0g0R8EPksQFAknB3baM,9
|
|
11
|
-
flet_ads-0.2.0.dev38.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|