2023-04-13 14:30:09 +00:00
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
import '../globals.dart';
|
|
|
|
|
|
|
|
class ResponsiveSizesCalculator {
|
|
|
|
final BuildContext context;
|
|
|
|
|
|
|
|
const ResponsiveSizesCalculator(this.context);
|
|
|
|
|
|
|
|
double get viewPortalWidth => min(_screenSize.width, maxViewPortalWidth);
|
|
|
|
|
|
|
|
double get maxThumbnailHeight =>
|
|
|
|
min(_screenSize.height * 0.5, maxViewPortalHeight);
|
|
|
|
|
|
|
|
double get maxThumbnailWidth => min(
|
|
|
|
_screenSize.width < 600
|
2024-12-20 13:48:04 +00:00
|
|
|
? _screenSize.width * 0.8
|
|
|
|
: _screenSize.width * 0.5,
|
2023-04-13 14:30:09 +00:00
|
|
|
maxViewPortalHeight);
|
|
|
|
|
2024-12-17 00:50:55 +00:00
|
|
|
Size get _screenSize => MediaQuery.sizeOf(context);
|
2023-04-13 14:30:09 +00:00
|
|
|
}
|