Skip to content

Instantly share code, notes, and snippets.

@RemeJuan
Last active June 12, 2021 05:10
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