url_launcher
A Flutter plugin for launching a URL.
| Android | iOS | Linux | macOS | Web | Windows | |
|---|---|---|---|---|---|---|
| Support | SDK 16+ | 11.0+ | Any | 10.14+ | Any | Windows 10+ |
Usage
To use this plugin, add url_launcher as a dependency in your pubspec.yaml file.
Example
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Utils().getMaterialColor(
Color(0xFFAB8408),
),
),
home: SplashScreen(
appLogo: APP_LOGO,
appName: '',
appVersion: '',
background: SPLASH_BACKGROUND_IMAGE,
duLogo: DU_LOGO,
aswdcLogo: ASWDC_LOGO,
),
);
}
}
Browser vs in-app Handling
On some platforms, web URLs can be launched either in an in-app web view, or
in the default browser. The default behavior depends on the platform (see
launchUrl
for details), but a specific mode can be used on supported platforms by
passing a LaunchMode.