adapt method
Using the current FlexAdaptive configuration, should the theme feature use this adaptive configuration?
Returns true if the adaptive theme feature should be used.
You can provide a platformOverride
and web override isWebOverride
for
development and testing purposes.
Implementation
bool adapt([TargetPlatform? platformOverride, bool? isWebOverride]) {
if (isWebOverride ?? overrideIsWeb ?? kIsWeb) {
switch (platformOverride ?? defaultTargetPlatform) {
case TargetPlatform.android:
return androidWeb;
case TargetPlatform.fuchsia:
return fuchsiaWeb;
case TargetPlatform.iOS:
return iOSWeb;
case TargetPlatform.linux:
return linuxWeb;
case TargetPlatform.macOS:
return macOSWeb;
case TargetPlatform.windows:
return windowsWeb;
}
} else {
switch (platformOverride ?? defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.fuchsia:
return fuchsia;
case TargetPlatform.iOS:
return iOS;
case TargetPlatform.linux:
return linux;
case TargetPlatform.macOS:
return macOS;
case TargetPlatform.windows:
return windows;
}
}
}