Skip to content

Commit e871ec4

Browse files
committed
✨ Add padding extensions
1 parent 0611955 commit e871ec4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/src/constants/extensions.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ extension BuildContextExtension on BuildContext {
88
MediaQueryData get mediaQuery => MediaQuery.of(this);
99

1010
ThemeData get themeData => Theme.of(this);
11+
12+
double get topPadding => mediaQuery.padding.top;
13+
14+
double get bottomPadding => mediaQuery.padding.bottom;
15+
16+
double get bottomInsets => mediaQuery.viewInsets.bottom;
1117
}
1218

1319
extension BrightnessExtension on Brightness {
@@ -17,7 +23,7 @@ extension BrightnessExtension on Brightness {
1723
}
1824

1925
extension ColorExtension on Color {
20-
bool get isTransparent => this == Colors.transparent;
26+
bool get isTransparent => this == Colors.transparent || alpha == 0x00;
2127
}
2228

2329
extension ThemeDataExtension on ThemeData {

0 commit comments

Comments
 (0)