Unit Testing a Utility function that returns a Widget (Code)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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