Gitsunmin

TIL

TIL
(=Today I Learned)

How to go store

flutter에서 deeplink를 이용해서 스토어를 찾아가는 방법이 있습니다.

저는 url_launcher를 이용해서 구현했습니다.

Android

dart code

const url = Uri.parse('market://details/?id=패키지명'); // (예: com.example.flutter.flavor)

if (await canLaunch(url)) {
  await launch(url);
} else {
  throw 'Could not launch $url';
}

iOS

dart code

const url = Uri.parse('https://apps.apple.com/kr/app/362057947'); // (예: com.example.flutter.flavor)

if (await canLaunch(url)) {
  await launch(url);
} else {
  throw 'Could not launch $url';
}