[DEV] Added infrastructure extension exports

This commit is contained in:
2024-10-02 13:04:47 +03:00
parent 4b330cb8d1
commit 664e03c0fe
9 changed files with 63 additions and 16 deletions

View File

@@ -0,0 +1,15 @@
import 'package:flutter/widgets.dart';
extension RadiusExtension on BorderRadiusGeometry {
copyWith(BorderRadiusGeometry g) => add(g);
//
BorderRadiusDirectional resolveToDirectional(TextDirection direction) {
//
return BorderRadiusDirectional.only(
topStart: direction == TextDirection.ltr ? resolve(direction).topLeft : resolve(direction).topRight,
topEnd: direction == TextDirection.rtl ? resolve(direction).topLeft : resolve(direction).topRight,
bottomEnd: direction == TextDirection.rtl ? resolve(direction).bottomRight : resolve(direction).bottomRight,
bottomStart: direction == TextDirection.ltr ? resolve(direction).bottomLeft : resolve(direction).bottomRight,
);
}
}