chooseVariant method Null safety

String chooseVariant(
  1. BuildContext context
)

Return the best choice of resolution variants for current device pixel ratio in the String type. Example: "1.5x"

Implementation

String chooseVariant(BuildContext context) {
  var currentRatio = MediaQuery.of(context).devicePixelRatio;
  String bestVariant =
      _AssetVariantChooser._findBestVariant(_candidates, currentRatio) ??
          _defaultRatioName;
  return bestVariant;
}