Flag.fromCode constructor

const Flag.fromCode(
  1. FlagsCode countryCode, {
  2. Key? key,
  3. double? height,
  4. double? width,
  5. BoxFit fit = BoxFit.contain,
  6. Widget replacement = const SizedBox.shrink(),
  7. FlagSize flagSize = FlagSize.size_4x3,
  8. double? borderRadius,
})

Creates a flag widget.

If the fit argument is null, the text will use the BoxFit.contain.

The country parameter must not be null.

Implementation

const Flag.fromCode(
  this.countryCode, {
  Key? key,
  this.height,
  this.width,
  this.fit = BoxFit.contain,
  this.replacement = const SizedBox.shrink(),
  this.flagSize = FlagSize.size_4x3,
  this.borderRadius,
})  : assert(
        countryCode != FlagsCode.NULL,
        'A non-NULL Country Code must be provided to a Flag widget.',
      ),
      this.country = '',
      super(key: key);