🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / FLUTTER / url_launcher ile whatsapp telefon mail google haritalar vs yönlendirme

1-) FLUTTER - url_launcher ile whatsapp telefon mail google haritalar vs yönlendirme

 

flutter pub add url_launcher

 

import 'package:url_launcher/url_launcher.dart';

 

1-) Whatsapp

 

Future<void> whatsapgit() async {
  
String url = 'https://wa.me/905511472017?text=Merhabalar';
  
if (!await launchUrl(Uri.parse(url),
      mode:
LaunchMode.externalApplication)) {
    
throw 'Could not launch $url';
  }
}

 

 

2-) Telefon

 

Future<void> makePhoneCall() async {
  
String phoneNumber = 'tel:+905511472017'; // Telefon numarasını buraya ekleyin

  
if (await canLaunch(phoneNumber)) {
    
await launch(phoneNumber);
  }
else {
    
throw 'Telefon araması başlatılamadı: $phoneNumber';
  }
}

 

 

3-) Mail

 

Future<void> mailgit() async {
  
String url = "mailto:ramazanhaberr@gmail.com";
  
if (!await launchUrl(Uri.parse(url))) {
    
throw 'Could not launch $url';
  }
}

 

 

4-) Web Sitesine Yönlendirme

 

Future<void> webgit() async {
  
String url = 'https://www.roketnot.com';
  
if (!await launchUrl(Uri.parse(url))) {
    
throw 'Could not launch $url';
  }
}

 

 

5-) Google Haritalar

 

Future<void> _launchMap() async {
   
String url = 'https://goo.gl/maps/xRkiLmB4kLrdmWtp8';
  if (!await launchUrl(Uri.parse(url),
      mode:
LaunchMode.externalApplication)) {
    
throw 'Could not launch $url';
  }
}

 

 

6-) Mavi Renkte olması için tıklanabilir link

Widget tiklanabilirLink(String body) {
  
return InkWell(
    onTap:
webgit,
    child:
Text(
      body,
      style:
TextStyle(
        decoration:
TextDecoration.underline,
        color:
Colors.blue,
      ),
    ),
  );
}

 

 

 2023 Ağustos 28 Pazartesi
 334