21 lines
864 B
Dart
21 lines
864 B
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
extension InsetsExtension on EdgeInsetsGeometry {
|
|
copyWith(EdgeInsetsGeometry g) => add(g);
|
|
//
|
|
EdgeInsetsDirectional resolveToDirectional(TextDirection direction) {
|
|
//
|
|
return EdgeInsetsDirectional.fromSTEB(direction == TextDirection.ltr ? resolve(direction).left : resolve(direction).right, resolve(direction).top,
|
|
direction == TextDirection.ltr ? resolve(direction).right : resolve(direction).left, resolve(direction).bottom);
|
|
//
|
|
}
|
|
}
|
|
|
|
extension InsetsNumExtension on num {
|
|
EdgeInsets get symH => EdgeInsets.symmetric(horizontal: toDouble());
|
|
EdgeInsets get symV => EdgeInsets.symmetric(vertical: toDouble());
|
|
EdgeInsets get padAll => EdgeInsets.all(toDouble());
|
|
EdgeInsets get padTop => EdgeInsets.only(top: toDouble());
|
|
EdgeInsets get padBot => EdgeInsets.only(bottom: toDouble());
|
|
}
|