I want to open a bunch of music app links using links data I have in firebase. I want to open, amazonPrimeMusic, Ganna, Spotify, Wynk, JioSavaan to name some.
Widget buildResultCard(data) {
List items = [Text(data['Ganna']),
IconButton(icon:Icon(Icons.all_inclusive),
onPressed: ()=> {Text("Ganna")}
),
Text(data['Wynk']),
IconButton(icon:Icon(Icons.all_inclusive),
onPressed: ()=> {Text("Ganna")}
),
Text(data['JioSavaan']),
IconButton(icon:Icon(Icons.all_inclusive),
onPressed: ()=> {Text("Ganna")}
),
Text(data['PrimeMusic']),
IconButton(icon:Icon(Icons.all_inclusive),
onPressed: ()=> {Text("Ganna")}
)
];
return ListView.builder(
padding: EdgeInsets.only(top: 20),
itemCount: items.length,
itemBuilder: (BuildContext context, int index) {
return items[index];
},
);
}
when I tap the button in the list it should open up the particular app for which the link is, for example for AmazonPrimeMusic link, it should open the Amazon music app.
You can use flutter_appavailability package. This plugin allows you to check if an app is installed in mobile and using this plugin you can launch an app.
If already installed then launch otherwise open link in WebView using url_launcher.