first commit
This commit is contained in:
21
lib/components/extensions/context.dart
Normal file
21
lib/components/extensions/context.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Подключение сторонней библиотеки
|
||||
/// Сделано для упрощения чтения импортов
|
||||
export 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
///
|
||||
/// Маштабирование в зависимости от контекста
|
||||
///
|
||||
extension ScaleFromContext on BuildContext {
|
||||
///
|
||||
/// Screen Width
|
||||
///
|
||||
double get sw => MediaQuery.of(this).size.width;
|
||||
|
||||
///
|
||||
/// Screen Height
|
||||
///
|
||||
double get sh => MediaQuery.of(this).size.height;
|
||||
}
|
||||
Reference in New Issue
Block a user