flet-ads 0.70.0.dev6365__py3-none-any.whl → 0.70.0.dev6370__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/banner_ad.py CHANGED
@@ -11,7 +11,8 @@ class BannerAd(BaseAd):
11
11
  Displays a banner ad.
12
12
 
13
13
  Raises:
14
- AssertionError: When this control is used on a web and/or non-mobile platform.
14
+ FletUnsupportedPlatformException: When this control is used on a web
15
+ and/or non-mobile platform.
15
16
  """
16
17
 
17
18
  on_will_dismiss: Optional[ft.ControlEventHandler["BannerAd"]] = None
flet_ads/base_ad.py CHANGED
@@ -11,7 +11,8 @@ class BaseAd(ft.Control):
11
11
  Base class for all ad controls in Flet Ads package.
12
12
 
13
13
  Raises:
14
- AssertionError: When using this control on a web and/or non-mobile platform.
14
+ FletUnsupportedPlatformException: When using this control on a web
15
+ and/or non-mobile platform.
15
16
  """
16
17
 
17
18
  unit_id: str
@@ -63,6 +64,8 @@ class BaseAd(ft.Control):
63
64
  """
64
65
 
65
66
  def before_update(self):
66
- assert not self.page.web and self.page.platform.is_mobile(), (
67
- f"{self.__class__.__name__} is only supported on Mobile (Android and iOS)"
68
- )
67
+ if self.page.web or not self.page.platform.is_mobile():
68
+ raise ft.FletUnsupportedPlatformException(
69
+ f"{self.__class__.__name__} is only supported on "
70
+ f"Mobile (Android and iOS)"
71
+ )
@@ -8,7 +8,8 @@ class InterstitialAd(BaseAd):
8
8
  Displays a full-screen interstitial ad.
9
9
 
10
10
  Raises:
11
- AssertionError: When using this control on a web and/or non-mobile platform.
11
+ FletUnsupportedPlatformException: When using this control on a
12
+ web and/or non-mobile platform.
12
13
  """
13
14
 
14
15
  async def show(self):
flet_ads/native_ad.py CHANGED
@@ -9,24 +9,25 @@ __all__ = ["NativeAd"]
9
9
  class NativeAd(BannerAd):
10
10
  """
11
11
  Renders a native ad.
12
-
13
- Raises:
14
- AssertionError: When neither [`factory_id`][(c).] nor
15
- [`template_style`][(c).] is set.
16
12
  """
17
13
 
18
14
  factory_id: str = None
19
15
  """
20
16
  An identifier for the factory that creates the Platform view.
17
+
18
+ Raises:
19
+ ValueError: When neither `factory_id` nor [`template_style`][(c).] is set.
21
20
  """
22
21
 
23
22
  template_style: NativeAdTemplateStyle = None
24
23
  """
25
24
  A style for the native ad template.
25
+
26
+ Raises:
27
+ ValueError: When neither [`factory_id`][(c).] nor `template_style` is set.
26
28
  """
27
29
 
28
30
  def before_update(self):
29
31
  super().before_update()
30
- assert self.factory_id is not None or self.template_style is not None, (
31
- "factory_id or template_style must be set"
32
- )
32
+ if self.factory_id is None and self.template_style is None:
33
+ raise ValueError("factory_id or template_style must be set")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-ads
3
- Version: 0.70.0.dev6365
3
+ Version: 0.70.0.dev6370
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
@@ -11,7 +11,7 @@ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: flet==0.70.0.dev6365
14
+ Requires-Dist: flet==0.70.0.dev6370
15
15
  Dynamic: license-file
16
16
 
17
17
  # flet-ads
@@ -1,10 +1,10 @@
1
1
  flet_ads/__init__.py,sha256=tm30fkWLlgwJXpjTg784n4xeh_Box2UfZ-B4ULugq_s,334
2
- flet_ads/banner_ad.py,sha256=BKfjaV9OquqJ8E6J8QRnGI7C3mL63h4BU4m8J0kbc8o,695
3
- flet_ads/base_ad.py,sha256=dSbJCT8FWEUr8ZJe6rLw8FBivgBVa8oHvobB4zPYD1w,1823
4
- flet_ads/interstitial_ad.py,sha256=xEMRT5ntTDqm7OLpTW4PULRLxBHooZlmqfjUeJ-Xy1Q,343
5
- flet_ads/native_ad.py,sha256=sYLczErLjEQYXdJiBN9trx6BENiembl0sA0QFhSRJfI,768
2
+ flet_ads/banner_ad.py,sha256=IlJ6-07pCgbZFqq-3GFSniurnBg21yEoQTNRmXtig0c,725
3
+ flet_ads/base_ad.py,sha256=8jZhIEmtJNPHnJygF8MxH42iBEMgZ95ufCE2lgUdUJA,1929
4
+ flet_ads/interstitial_ad.py,sha256=Ep2ba5cIgNAP0PCYqq6Uw-v6zCHgSgyfq3i9Q2ySPeI,373
5
+ flet_ads/native_ad.py,sha256=OsOnXXspzQZZNK5jMKwHbWqD0AgBpJVgrpOmWqmBAIw,835
6
6
  flet_ads/types.py,sha256=MXAOSoYR5s8LtRYPv9zaD8L8jpReUT1tD7rhw5qDFg8,3212
7
- flet_ads-0.70.0.dev6365.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
7
+ flet_ads-0.70.0.dev6370.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
8
  flutter/flet_ads/analysis_options.yaml,sha256=32kjGAc-zF87inWaH5M46yGZWQDTwrwfvNLHeAocfG4,154
9
9
  flutter/flet_ads/pubspec.lock,sha256=yE-PcVNOCKWPEUjnVVp1Hc2yV6C5ymHUMNdkYm4f1VM,24481
10
10
  flutter/flet_ads/pubspec.yaml,sha256=qA5sskja1AMBw4W02P_irD7tADR6cjich-98bIz34Lw,376
@@ -15,7 +15,7 @@ flutter/flet_ads/lib/src/interstitial.dart,sha256=H1-DRdaOd-ZBy8F91iih-Wp6fm4tGf
15
15
  flutter/flet_ads/lib/src/native.dart,sha256=aV4XBl2xmOtesqbY-SLpsqGexp42aDk3w4RGRDK09Jg,2600
16
16
  flutter/flet_ads/lib/utils/ads.dart,sha256=ysJUvop1pTlnfHUlNWL57S_7AxKiD3hRf0K7XJZHTpo,464
17
17
  flutter/flet_ads/lib/utils/native.dart,sha256=iSIOUspBoUdtObDyrWOz-0Yuv4gs79ZyJYTe_-ZAFJQ,2013
18
- flet_ads-0.70.0.dev6365.dist-info/METADATA,sha256=eM14hdfyk7LWSWGn3ncrVsk13QiwMFswA-SOOQvNAZs,1861
19
- flet_ads-0.70.0.dev6365.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- flet_ads-0.70.0.dev6365.dist-info/top_level.txt,sha256=Pguk7IG_usM8ZGyS1kjv-mZZhGKthm_734FmTIqDLBE,17
21
- flet_ads-0.70.0.dev6365.dist-info/RECORD,,
18
+ flet_ads-0.70.0.dev6370.dist-info/METADATA,sha256=sLCK6UOSVsRTL5dvDMfzaevP1qxesLA7LNGumdICqGI,1861
19
+ flet_ads-0.70.0.dev6370.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ flet_ads-0.70.0.dev6370.dist-info/top_level.txt,sha256=Pguk7IG_usM8ZGyS1kjv-mZZhGKthm_734FmTIqDLBE,17
21
+ flet_ads-0.70.0.dev6370.dist-info/RECORD,,