refactor: asset grid
This commit is contained in:
@@ -20,6 +20,12 @@ extension BuildContextHelper on BuildContext {
|
||||
/// Get the [EdgeInsets] of [MediaQuery]
|
||||
EdgeInsets get viewInsets => MediaQuery.viewInsetsOf(this);
|
||||
|
||||
// Returns the current width from MediaQuery
|
||||
double get width => mediaQuerySize.width;
|
||||
|
||||
// Returns the current height from MediaQuery
|
||||
double get height => mediaQuerySize.height;
|
||||
|
||||
/// True if the current device is a Tablet
|
||||
bool get isTablet => (mediaQuerySize.width >= 600);
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension DarkenLightenExtension on Color {
|
||||
Color lighten({double amount = 0.1}) {
|
||||
return Color.alphaBlend(Colors.white.withOpacity(amount), this);
|
||||
}
|
||||
|
||||
Color darken({double amount = 0.1}) {
|
||||
return Color.alphaBlend(Colors.black.withOpacity(amount), this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user