skip to Main Content

plase assist

on the emulator the url_launcher working very well, but after deploy not working at all,


  // Function to launch URLs
  void _launchUrl(Uri url) async {
    print('Attempting to launch URL: $url');
    try {
      if (await canLaunchUrl(url)) {
        print('Launching...');
        await launchUrl(url);
        print('Launched successfully');
      } else {
        print('Could not launch $url');
      }
    } catch (e) {
      print('Error launching URL: $e');
    }
  }
///////////////////////kava/////////////////////
  final String kfacebookUrl = 'https://www.example.com/companyname/';
  final String kInstaUrl = 'https://www.example.com/companyname/';
  final String kWhatsappUrl = 'https://example.me/123456789';
  final String kEmailAddress = '[email protected]';
  final String kPhoneNumber = '123456789';
  final String kMap = 'https://example.com/xcvg9ccQFdXexNHn6';
  final String kWeb =
      'https://example.web.app/'; // Ensure to include 'https://'

want the url working please

2

Answers


  1. Chosen as BEST ANSWER

    I managed to solve the issue. I'm not sure exactly what it is that went wrong but cleaning the build with "flutter clean" and rebuilding resolved the issue for me. I also forced "flutter upgrade" perhaps that had something to do with it


  2. https://stackoverflow.com/a/66762732/21271613

    You can resolve the issue you’re facing by following the approach mentioned in this answer. It explains how to handle the problem

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search