relatica/lib/utils/responsive_sizes_calculator...

25 wiersze
603 B
Dart
Czysty Zwykły widok Historia

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,
maxViewPortalHeight);
Size get _screenSize => MediaQuery.sizeOf(context);
}