getPlatformClasses function Null safety

String getPlatformClasses(
  1. {List<Feature>? features,
  2. bool includeDefaults = true,
  3. List<String> existingClasses = const []}

Generates CSS classes based on the current browser, operatingSystem and optionally, features that your app may need conditional styling for in addition to the defaultFeatureCssClassDecorators that will have CSS classes present by default.

If you do not want defaultFeatureCssClassDecorators to be used, set includeDefaults to false.


String getPlatformClasses(
    {List<Feature>? features,
    bool includeDefaults = true,
    List<String> existingClasses = const []}) {
  var allFeatures = Set<Feature>.from(features ?? []);

  if (includeDefaults) allFeatures.addAll(defaultFeatureCssClassDecorators);

  var classes = <String>[]
    ..add(browserClassPrefix + browserClassName)
    ..add(osClassPrefix + osClassName)

  return listToClassNameString(classes);