|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
|
|
|
|
|
extension WidgetExtensions on Widget {
|
|
|
|
|
Widget onPress(VoidCallback onTap) => InkWell(onTap: onTap, child: this);
|
|
|
|
|
@ -7,12 +8,12 @@ extension WidgetExtensions on Widget {
|
|
|
|
|
|
|
|
|
|
Widget get center => Center(child: this);
|
|
|
|
|
|
|
|
|
|
Widget circle(double _value) => ClipRRect(borderRadius: BorderRadius.circular(_value), child: this);
|
|
|
|
|
Widget circle(double value) => ClipRRect(borderRadius: BorderRadius.circular(value), child: this);
|
|
|
|
|
|
|
|
|
|
Widget paddingAll(double _value) => Padding(padding: EdgeInsets.all(_value), child: this);
|
|
|
|
|
Widget paddingAll(double value) => Padding(padding: EdgeInsets.all(value), child: this);
|
|
|
|
|
|
|
|
|
|
Widget paddingOnly({double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) =>
|
|
|
|
|
Padding(padding: EdgeInsets.only(left: left, right: right, top: top, bottom: bottom), child: this);
|
|
|
|
|
Widget paddingOnly({int left = 0, int right = 0, int top = 0, int bottom = 0}) =>
|
|
|
|
|
Padding(padding: EdgeInsets.only(left: left.toScreenWidth, right: right.toScreenWidth, top: top.toScreenHeight, bottom: bottom.toScreenHeight), child: this);
|
|
|
|
|
|
|
|
|
|
Widget toExpanded({int flex = 1}) => Expanded(flex: flex, child: this);
|
|
|
|
|
}
|
|
|
|
|
|