applyResponsiveStyle method

void applyResponsiveStyle({
  1. required BuildContext context,
  2. required Function applier,
  3. required RapidPrefixType prefixType,
})

Implementation

void applyResponsiveStyle({
  required BuildContext context,
  required Function applier,
  required RapidPrefixType prefixType,
}) {
  final Size deviceSize = MediaQuery.of(context).size;
  if (deviceSize.width < 600 && prefixType == RapidPrefixType.mobile) {
    applier();
  } else if (deviceSize.width > 600 && prefixType == RapidPrefixType.tab) {
    applier();
  } else if (deviceSize.width > 1200 &&
      prefixType == RapidPrefixType.laptop) {
    applier();
  } else if (deviceSize.width > 1400 &&
      prefixType == RapidPrefixType.desktop) {
    applier();
  }
}