Closed aytunch closed 1 year ago
SmartBannerScaffold
is already relying on kIsWeb
to display the banner but yeah it might be better to allow the dev to override the property 🤔
I am glad you find there is a use case too.
I understand the reasoning behind not showing banners on native apps.
But when we use kIsWeb
it shows the banner in desktop web, which does not make sense since user cant download the app from desktop Safari or Chrome. So developers can choose in which Platforms to show it. Furthermore, maybe the app is already installed.
Another valid use case is if we don't want to show the banner every time the user visits the web app. We can decide how many times to show it before giving up, not to be annoying, in Hive or somewhere similar.
@TesteurManiak thank you :) When can we see the release on pub.dev? I see it still shows the old version.
It has been released just now 😉 https://pub.dev/packages/smart_banner/versions/0.2.2 Note that you can also point directly to the git repo if you don't want to wait the release on pub.dev:
dependencies:
smart_banner:
git:
url: https://github.com/TesteurManiak/smart_banner
ref: main
If we had a boolean property for the
SmartBannerScaffold
likeisShown
, then we could only show it forkIsWeb
and mobile browsers. Our code base support native mobile and web so we only need to show it on the web mobile browsers. What do you think of this idea? A workaround is to conditionally wrapSmartBannerScaffold
but it is not very clean imo.