Search code examples
flutterdartflutter-layoutflutter-animation

I have a button in my Flutter project that I want the phone number to appear when pressed by the user


I have a button in my Flutter project that I want the phone number to appear when it's pressed by the user, and when the number appears, the user can copy the number and use it, or when pressing the button, it goes to a direct call process with the phone number

Is there a way or a widget by which I can achieve this?


Solution

  • You can use URL launcher in every where you want, like this:

    Center(
      child: TextButton(
          onPressed: () => launch("tel://21213123123"),
          child: Text("Call me")),
      ),
    )