Here is my code

```
void main() {

  String phoneNumber = '123456789';

  String formattedPhoneNumber = phoneNumber.replaceFirst("(\d{3})(\d{3})(\d+)", "(\$1) \$2-\$3");

  print('Formatted number ${formattedPhoneNumber}');

}

```

**Output:**

Formatted number 123456789

I want output as Formatted number (123) 456-6789