softSize static method

SliverGridDelegate softSize(
  1. BuildContext context,
  2. double size, {
  3. double childAspectRatio = 1,
  4. double crossAxisSpacing = 0,
  5. double mainAxisSpacing = 0,
  6. int minimumCrossAxisCount = 1,
  7. int countComputer(
    1. double size
    )?,
})

Implementation

static SliverGridDelegate softSize(BuildContext context, double size,
        {double childAspectRatio = 1,
        double crossAxisSpacing = 0,
        double mainAxisSpacing = 0,
        int minimumCrossAxisCount = 1,
        int Function(double size)? countComputer}) =>
    SliverGridDelegateWithFixedCrossAxisCount(
      crossAxisCount: max(
          (countComputer?.call(MediaQuery.of(context).size.width) ??
              MediaQuery.of(context).size.width ~/ size),
          minimumCrossAxisCount),
      childAspectRatio: childAspectRatio,
      crossAxisSpacing: crossAxisSpacing,
      mainAxisSpacing: mainAxisSpacing,
    );