setBasePlatformMode function
Must call this method before building baseApp set the platform
Implementation
void setBasePlatformMode({
BasePlatformMode? basePlatformMode = const BasePlatformMode(),
}) {
const BasePlatformMode defalutPlatformMode = BasePlatformMode();
// web
if (kIsWeb && basePlatformMode!.web != null) {
_currentBaseMode = basePlatformMode.web!;
return;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
_currentBaseMode = basePlatformMode!.android;
defaultBaseMode = defalutPlatformMode.android;
break;
case TargetPlatform.fuchsia:
_currentBaseMode = basePlatformMode!.fuchsia;
defaultBaseMode = defalutPlatformMode.fuchsia;
break;
case TargetPlatform.iOS:
_currentBaseMode = basePlatformMode!.iOS;
defaultBaseMode = defalutPlatformMode.iOS;
break;
case TargetPlatform.linux:
_currentBaseMode = basePlatformMode!.linux;
defaultBaseMode = defalutPlatformMode.linux;
break;
case TargetPlatform.macOS:
_currentBaseMode = basePlatformMode!.macOS;
defaultBaseMode = defalutPlatformMode.macOS;
break;
case TargetPlatform.windows:
_currentBaseMode = basePlatformMode!.windows;
defaultBaseMode = defalutPlatformMode.windows;
break;
default:
_currentBaseMode = basePlatformMode!.others;
defaultBaseMode = defalutPlatformMode.others;
}
}