1

I've been using Flutter for about 4 months now, but I do not have any experience in Javascript. I want to use the Soundcloud HTTP API and build an app with it. But I'm stuck with using JS in Flutter. I'm trying to make an user-interactive app that requires these features,

  1. Search music on Soundcloud. => The user gets to choose a song on Soundcloud.

  2. Post the selected music on a feed. => Then the selected song gets posted on the feed page as a music player-like Widget.

  3. Let other users play the music when it shows up on their feed. => The music player then can be seen by others with additional description and etc.

To wrap up, I'm trying to make a Soundcloud clone that can actually use Soundcloud source using Flutter but I do not know what to do since Soundcloud only provides API for Ruby, Python, and JS.

For example, I don't know how to implement the following JS code, an example code in the api document, which creates an embedded Soundcloud player.

<script src="https://connect.soundcloud.com/sdk/sdk-3.3.2.js"></script>
<script>
SC.initialize({
  client_id: 'YOUR_CLIENT_ID'
});

var track_url = 'https://soundcloud.com/forss/flickermood';
SC.oEmbed(track_url, { auto_play: true }).then(function(oEmbed) {
  console.log('oEmbed response: ', oEmbed);
});
</script>

I found out that using HTML and JS in Flutter web is possible, but I'm not sure if it works on mobile platforms also.

I hope to get some feedbacks from the experts in JS and Dart. Thank you.

2
  • 1
    For that, you would have to use webview Commented Sep 11, 2020 at 6:10
  • Thank you everyone for your answers. But I was hoping to get some examples on how I can implement this with some sample code... My issue was that I couldn't get the idea of how this can be implemented in code... Commented Sep 11, 2020 at 7:12

2 Answers 2

3

You can use flutter_js. You can try it once.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use Flutter JS plugin, but it is recommended to use dart for flutter, I hope this link helps https://www.filledstacks.com/post/create-and-deploy-a-flutter-web-app/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.