isweb_test

Last updated:

0 purchases

isweb_test Image
isweb_test Images
Add to Cart

Description:

isweb test

isWeb_test #

On Flutter 3.x exist the global variable kIsWeb indicating than the application was compiled to run on the web.
On multi platform applications this variable could be used for adapting UI to the different platforms, but, doesn't exist an override for doing test. So, when a test is running, kIsWeb is always false, because the platform that is running the tests is Linux, Windows or Mac.
This packages defines the global variable debugIsWeb and the function isWeb(). On your code, using the function isWeb() instead of kIwWeb, give you the possibility to run tests and emulate the web environment with debugIsWeb.
The package test_screen uses it for doing web tests.
Usage #
@override
Widget build(BuildContext context) {
return isWeb()
? _webSlider()
: _defaultSlider();
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.