DiscoverModule/lib/textScalar.dart

12 lines
336 B
Dart
Raw Permalink Normal View History

2024-05-21 08:40:44 +00:00
import 'dart:math';
import 'package:flutter/material.dart';
class ScaleSize {
static double textScaleFactor(BuildContext context,
{double maxTextScaleFactor = 2}) {
final width = MediaQuery.of(context).size.width;
double val = (width / 1400) * maxTextScaleFactor;
return max(1, min(val, maxTextScaleFactor));
}
}