getDefaultDesignLanguage function

DesignLanguage getDefaultDesignLanguage()

A top level function taht obtains DesignLanguage based on the PlatformType.

If the PlatformType is android or fuchsia, it will be material. If the PlatformType is iOS or macOS, it will be cupertino. If the PlatformType is windows, it will be fluent. If the PlatformType is linux or web, it will be material.

See also:

Implementation

DesignLanguage getDefaultDesignLanguage() {
  if (kIsWeb) return DesignLanguage.material;

  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
      return DesignLanguage.material;
    case TargetPlatform.iOS:
    case TargetPlatform.macOS:
      return DesignLanguage.cupertino;
    case TargetPlatform.windows:
      return DesignLanguage.fluent;
    default:
      return DesignLanguage.material;
  }
}