KonectarApp/lib/contacts_module/textScalar.dart

12 lines
336 B
Dart
Raw Permalink Normal View History

2024-10-08 12:01:59 +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));
}
}