25 lines
683 B
Dart
25 lines
683 B
Dart
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
bool isTablet = 1.sw >= 600;
|
|
Future<void> launchAnylUrl(Uri url) async {
|
|
try {
|
|
if (!await launchUrl(url, mode: LaunchMode.externalApplication)) {
|
|
throw Exception('Could not launch $url');
|
|
}
|
|
} catch (e) {}
|
|
}
|
|
|
|
// Future<void> launchAnylUrl(String urlString) async {
|
|
// final Uri url = Uri.parse(urlString);
|
|
// try {
|
|
// await launchUrl(
|
|
// url,
|
|
// mode: LaunchMode.externalApplication, // Opens in external browser
|
|
// );
|
|
// } catch (e) {
|
|
// // Simple error handling
|
|
// print('Could not launch $urlString: $e');
|
|
// }
|
|
// }
|