Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have created an app on all 3 platforms: iOS, Android and Web. I also have manifest.json and other things required for PWA. I have deployed it to firebase hosting. Now what I want to do is manually trigger the Add to Home screen on tap of a button. The real problem is though all the articles shows code to be paste on JS side while I have all the UI in dart so How do I listen for beforeinstallprompt and trigger add to home screen manually ? I'm struggling with this from last 3 days but no luck. I have this package installed universal_html: ^1.2.3. If anyone knows how to do this please help me out.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
559 views
Welcome To Ask or Share your Answers For Others

1 Answer

What about writing those code in normal JavaScript, and then call it from Dart(flutter web).

There are many resources about that. For example, Flutter Web : How to run javascript using dart js

In addition, do not forget that, when you are writing Flutter web, you have the full control over the HTML/JS/CSS/Dart. Thus nothing can stop you from writing JS code :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...