-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b888b2
commit aaa854a
Showing
6 changed files
with
319 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:devotion/core/constants/sizes.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class TSpacingStyle { | ||
static EdgeInsetsGeometry paddingWithAppBarHeight = const EdgeInsets.only( | ||
top: TSizes.appBarHeight, | ||
left: TSizes.defaultSpace, | ||
bottom: TSizes.defaultSpace, | ||
right: TSizes.defaultSpace, | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
class TSizes { | ||
//padding and margin heights | ||
static const double xs = 4.0; | ||
static const double sm = 8.0; | ||
static const double md = 16.0; | ||
static const double lg = 24.0; | ||
static const double xl = 32.0; | ||
|
||
// Icon sizes | ||
|
||
static const double iconXs = 12.0; | ||
static const double iconSm = 16.0; | ||
static const double iconMd = 24.0; | ||
static const double iconLg = 32.0; | ||
|
||
// Font sizes | ||
|
||
static const double fontSizeSm = 14.0; | ||
static const double fontSizeMd = 16.0; | ||
static const double fontSizeLg = 18.0; | ||
|
||
// ButtonSizes | ||
|
||
static const double buttonHeight = 18.0; | ||
static const double buttonRadius = 12.0; | ||
static const double buttonWidth = 120.0; | ||
static const double buttonElevation = 4.0; | ||
|
||
//AppBar height | ||
|
||
static const double appBarHeight = 56.0; | ||
|
||
//ImageSizes | ||
|
||
static const double imageThumbSize = 80.0; | ||
|
||
//default spacing between sections | ||
|
||
static const double defaultSpace = 24.0; | ||
static const double spaceBtwItems = 16.0; | ||
static const double spaceBtwSections = 32.0; | ||
|
||
//BorderRadius | ||
|
||
static const double borderRadiusSm = 4.0; | ||
static const double borderRadiusMd = 8.0; | ||
static const double borderRadiusLg = 12.0; | ||
|
||
//Divider Height | ||
static const double dividerHeight = 1.0; | ||
|
||
//InputField | ||
|
||
static const double inputFieldRadius = 12.0; | ||
static const double spaceBtwinputFields = 16.0; | ||
|
||
//Card Sizes | ||
|
||
static const double cardRadiusLg = 16.0; | ||
static const double cardRadiusMd = 12.0; | ||
static const double cardRadiusSm = 10.0; | ||
static const double cardRadiusXs = 6.0; | ||
static const double cardElevation = 2.0; | ||
|
||
//image Carousel height | ||
static const double imageCarouselHeight = 200.0; | ||
|
||
//Loading indicator Size | ||
static const double loadingIndicatorSize = 36.0; | ||
|
||
// grid view spacing | ||
|
||
static const double gridViewSpacing = 16.0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:url_launcher/url_launcher_string.dart'; | ||
|
||
class TDeviceUtils { | ||
static void hideKeyboard(BuildContext context) { | ||
FocusScope.of(context).requestFocus(FocusNode()); | ||
} | ||
|
||
static Future<void> setStatusBarColor(Color color) async { | ||
SystemChrome.setSystemUIOverlayStyle( | ||
SystemUiOverlayStyle(statusBarColor: color)); | ||
} | ||
|
||
static bool isLandscapeOrientation(BuildContext context) { | ||
final viewInsets = View.of(context).viewInsets; | ||
return viewInsets.bottom == 0; | ||
} | ||
|
||
static bool isPortraitOrientation(BuildContext context) { | ||
final viewInsets = View.of(context).viewInsets; | ||
return viewInsets.bottom != 0; | ||
} | ||
|
||
static void setFullScreen(bool enable) { | ||
SystemChrome.setEnabledSystemUIMode( | ||
enable ? SystemUiMode.immersiveSticky : SystemUiMode.edgeToEdge); | ||
} | ||
|
||
// static double getScreenHeight() { | ||
// return MediaQuery.of(Get.context!).size.height; | ||
// } | ||
|
||
// static double getScreenWidth(BuildContext context) { | ||
// return MediaQuery.of(context).size.width; | ||
// } | ||
|
||
// static double getPixelRatio() { | ||
// return MediaQuery.of(Get.context!).devicePixelRatio; | ||
// } | ||
|
||
// static double getStatusBarHeight() { | ||
// return MediaQuery.of(Get.context!).padding.top; | ||
// } | ||
|
||
// static bool isIos() { | ||
// return Platform.isIos; | ||
// } | ||
|
||
// static bool isndroid() { | ||
// return Platform.isAndroid; | ||
// } | ||
|
||
static void launchUrl(String url) async { | ||
if (await canLaunchUrlString(url)) { | ||
await launchUrlString(url); | ||
} else { | ||
throw 'could not launch $url'; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.