responsive_widgets 0.1.1 responsive_widgets: ^0.1.1 copied to clipboard
This plugin helps to create responsive widgets, that makes an auto-size with the proportion between reference ScreenSize and the screen that the app is running.
Responsive Widgets #
MediaQuery.of(context).size.shortestSide;
ContainerResponsive
ContainerResponsive(
child: ,
height: ,
// double Responsive wight
heightResponsive: ,
// bool Enable/Disable Responsive height
width: ,
// double Responsive width
widthResponsive: ,
// bool Enable/Disable Responsive width
)
EdgeInsetsResponsive (Can be used in any widget with padding)
Padding(
child: ,
padding: EdgeInsetsResponsive.all(50),
// EdgeInsets Responsive padding
)
IconResponsive
IconResponsive(
icon
size: double,
// Responsive size
)
IconButtonResponsive
IconButtonResponsive(
icon
size: double,
// Responsive size
)
TextResponsive
TextResponsive(
text
// Responsive fontSize
)
Função para recalcular tamanho responsivelmente #
Existem casos especiais que não possuem Widgets Responsivos criados, um caso disso é o Positioned, para resolver o problema é apenas colocar essa função getSizeByDp(double size)
que retornará o valor correto para a tela.