buildThreadsUri static method

Uri buildThreadsUri(
  1. String? username
)

Builds a URI for Threads.

Implementation

static Uri buildThreadsUri(String? username) {
  if (username == null || username.isEmpty) return Uri();
  if (isWebUrl(username)) return Uri.parse(username);
  return Uri.https(
    'www.threads.net',
    '/@${username.replaceFirst(RegExp(r"^@"), "")}',
  );
}