class Sizescaleconfig {
static final double refrenceheight = 715.0;
static final double referencewidth = 320.0;
static double screenheight;
static double screenwidth;
static double heightscaleratio;
static double widthscaleratio;
static double textscalefactor;
static void calculaterscaleratio() {
heightscaleratio = screenheight / refrenceheight;
widthscaleratio = screenwidth / referencewidth;
}
static double scalehightfactor(double actualheight) {
return actualheight * heightscaleratio;
}
static double scalewidthfactor(double actualwidth) {
return actualwidth * widthscaleratio;
}
static double scaletextfactor(double actualfontsize) {
return actualfontsize * heightscaleratio * textscalefactor;
}
}
void setsizescaleconfig(double screenheight, double screenwidth, double textscalefactor) {
Sizescaleconfig.screenheight = screenheight;
Sizescaleconfig.screenwidth = screenwidth;
Sizescaleconfig.textscalefactor = textscalefactor;
Sizescaleconfig.calculaterscaleratio();
}
-
Notifications
You must be signed in to change notification settings - Fork 0
rutvik110/ResponsiveSizing-In-Flutter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published