Skip to content

Instantly share code, notes, and snippets.

@RemeJuan
Last active Jun 12, 2021
Embed
What would you like to do?
Unit Testing a Utility function that returns a Widget (Code)
dynamic launchURL(BuildContext context, String url) async {
if (url == 'about:blank') return;
if (url.startsWith('internal://')) {
final isGroups = url.contains('/groups');
if (isGroups) return _handleUnsupported(context);
}
}
void _handleUnsupported(BuildContext context) {
SnackBarUtil.error(
context: context,
message: LocalePathUtils.errorsLocalePath('unknownRoute'),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment