refactor: launch url

This commit is contained in:
Rongjian Zhang
2019-09-29 13:32:53 +08:00
parent 3506609024
commit 2ce2384578
8 changed files with 24 additions and 21 deletions

View File

@@ -184,3 +184,13 @@ class PrimerBranchName extends StatelessWidget {
);
}
}
launchUrl(String url) async {
if (url == null) return;
if (await canLaunch(url)) {
await launch(url);
} else {
// TODO: fallback
}
}