Add icon, color, widget_builder, responsive for core module
This commit is contained in:
@@ -2,36 +2,24 @@ import 'package:flutter/widgets.dart';
|
||||
|
||||
class ResponsiveUtils {
|
||||
|
||||
static const int _minLargeWidth = 950;
|
||||
static const int _minMediumWidth = 600;
|
||||
static const int minDesktopWidth = 1200;
|
||||
static const int minTabletWidth = 600;
|
||||
|
||||
static const double _loginTextFieldWidthSmallScreen = 280.0;
|
||||
static const double _loginTextFieldWidthLargeScreen = 320.0;
|
||||
static const double _loginButtonWidth = 240.0;
|
||||
|
||||
double getSizeWidthScreen(BuildContext context) {
|
||||
return MediaQuery.of(context).size.width;
|
||||
}
|
||||
double getSizeWidthScreen(BuildContext context) => MediaQuery.of(context).size.width;
|
||||
|
||||
double getSizeHeightScreen(BuildContext context) {
|
||||
return MediaQuery.of(context).size.height;
|
||||
}
|
||||
double getSizeHeightScreen(BuildContext context) => MediaQuery.of(context).size.height;
|
||||
|
||||
bool isLargeScreen(BuildContext context) {
|
||||
return getSizeWidthScreen(context) >= _minLargeWidth;
|
||||
}
|
||||
bool isMobile(BuildContext context) => getSizeWidthScreen(context) < minTabletWidth;
|
||||
|
||||
bool isSmallScreen(BuildContext context) {
|
||||
return getSizeWidthScreen(context) < _minMediumWidth;
|
||||
}
|
||||
bool isTablet(BuildContext context) => getSizeWidthScreen(context) >= minTabletWidth && getSizeWidthScreen(context) < minDesktopWidth;
|
||||
|
||||
bool isMediumScreen(BuildContext context) {
|
||||
return getSizeWidthScreen(context) >= _minMediumWidth && getSizeWidthScreen(context) < _minLargeWidth;
|
||||
}
|
||||
bool isDesktop(BuildContext context) => getSizeWidthScreen(context) >= minDesktopWidth;
|
||||
|
||||
double getWidthLoginTextField(BuildContext context) => isSmallScreen(context)
|
||||
? _loginTextFieldWidthSmallScreen
|
||||
: _loginTextFieldWidthLargeScreen;
|
||||
double getWidthLoginTextField(BuildContext context) => isMobile(context) ? _loginTextFieldWidthSmallScreen : _loginTextFieldWidthLargeScreen;
|
||||
|
||||
double getWidthLoginButton() => _loginButtonWidth;
|
||||
}
|
||||
Reference in New Issue
Block a user