Created
April 3, 2020 00:45
-
-
Save VB10/7e176360f580f43d7cf4645b7640a16c to your computer and use it in GitHub Desktop.
Shoppi - BaseState
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:shoppingapp/core/constants/app_constants.dart'; | |
| import 'package:shoppingapp/core/constants/app_strings.dart'; | |
| abstract class BaseState<T extends StatefulWidget> extends State<T> { | |
| ThemeData get currentTheme => Theme.of(context); | |
| AppStrings get appStrings => AppStrings.instance; | |
| AppConstants get appConstants => AppConstants.instance; | |
| double dynamicHeight(double val) => MediaQuery.of(context).size.height * val; | |
| double dynamicWidth(double val) => MediaQuery.of(context).size.width * val; | |
| EdgeInsets insetsAll(double val) => EdgeInsets.all(dynamicHeight(val)); | |
| EdgeInsets insetHorizontal(double val) => | |
| EdgeInsets.symmetric(horizontal: dynamicHeight(val)); | |
| EdgeInsets insetVertical(double val) => | |
| EdgeInsets.symmetric(horizontal: dynamicHeight(val)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment