12 lines
336 B
Dart
12 lines
336 B
Dart
|
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));
|
||
|
}
|
||
|
}
|