Flutter Open One other App :
On this weblog, discover methods to leverage Flutter highly effective capabilities to seamlessly open one app from one other. Find out about deep linking strategies and finest practices for making a easy person expertise in your Flutter purposes.
Uncover methods to implement app-to-app communication effortlessly utilizing Flutter’s navigation options. Dive into sensible examples and step-by-step guides to grasp app navigation throughout the Flutter framework. Unlock the potential of connecting a number of apps and enhancing person interplay with this complete information to Flutter app-to-app navigation. Begin exploring the probabilities at this time!
Â
Flutter Open One other App Video Playlist :
Discover the curated playlist for Flutter App to App Navigation defined in detailed with steps defined.
Â
essential.dart :
Let’s begin with imports
import ‘dart:io’;
import ‘package deal:flutter/materials.dart’;
import ‘package deal:url_launcher/url_launcher.dart’;
Â
then create a essential operate to begin this system
void essential(){
runApp(MyApp());
}
Â
Now comes the essential facet i.e., launching app or redirecting to Playstore / Appstore if app isn’t put in on machine.
This performance is curated in a separate stand alone operate such that it may be simply re-used by out the app.
Right here you’ll be able to observe this operate will settle for a url that may be native or a ul the place app is positioned.
void _launchApp(String url) async{
if(await canLaunchUrl(Uri.parse(url))){
await launchUrl(Uri.parse(url));
}else if(Platform.isIOS){
_launchApp(“https://apps.apple.com/app/id544007664”);
}else if(Platform.isAndroid){
_launchApp(“https://play.google.com/retailer/apps/particulars?id=com.Abhishekapps.abhishek.VoicetoText”);
}
}
Â
Add a appBar
appBar: AppBar(title: const Textual content(“First App”),),
Â
Add a primary performance to make a button click on occasion such that we’re in a position to transfer to a second app.
Heart(
baby: ElevatedButton(
onPressed: () {
_launchApp(“amplifyabhi://launch”);
},
baby: const Textual content(“Navigate to One other App”),
),
),
Â
Full Code :
import ‘dart:io’;
import ‘package deal:flutter/materials.dart’;
import ‘package deal:url_launcher/url_launcher.dart’;
void essential(){
runApp(MyApp());
}
class MyApp extends StatelessWidget {
void _launchApp(String url) async{
if(await canLaunchUrl(Uri.parse(url))){
await launchUrl(Uri.parse(url));
}else if(Platform.isIOS){
_launchApp(“https://apps.apple.com/app/id544007664”);
}else if(Platform.isAndroid){
_launchApp(“https://play.google.com/retailer/apps/particulars?id=com.Abhishekapps.abhishek.VoicetoText”);
}
}
const MyApp({tremendous.key});
@override
Widget construct(BuildContext context) {
return MaterialApp(
dwelling: Scaffold(
appBar: AppBar(title: const Textual content(“First App”),),
physique: Heart(
baby: ElevatedButton(
onPressed: (){
_launchApp(“amplifyabhi://launch”);
},
baby: const Textual content(“Navigate to second app”),
),
),
),
);
}
}
Â
Flutter Android app integration :
To invoke one other app in Flutter i,e., to begin one other app from present app it is advisable to make some configurations on native app i..e, android for this weblog so right here we offer a configuration which lets you deal with flutter platform channels.
Flutter android app integration is a key issue that helps you in redirection so be sure you configure it correctly in order to keep away from points.
<intent-filter>
<motion android:identify=”android.intent.motion.VIEW”/>
<class android:identify=”android.intent.class.DEFAULT”/>
<class android:identify=”android.intent.class.BROWSABLE”/>
<information android:scheme=”amplifyabhi” android:host=”launch”/>
</intent-filter>
Â
Â
When you have any questions, be at liberty to drop them within the feedback beneath. Should you loved this tutorial, present us some love by liking and sharing for extra thrilling updates
Â