SizeConfig class
Screen size configuration.
Usage:
class SplashScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
// You have to call it on your starting screen
SizeConfig().init(context);
return Scaffold(
body: Container(
width: getProportionateScreenWidth(80),
height: getProportionateScreenHeight(80),
),
);
}
}
Refrence https://github.com/abuanwar072/E-commerce-Complete-Flutter-UI/blob/master/lib/size_config.dart
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
init(
BuildContext context) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- orientation ↔ Orientation?
-
getter/setter pair
- screenHeight ↔ double
-
getter/setter pair
- screenWidth ↔ double
-
getter/setter pair