awesome_extensions 0.0.4
awesome_extensions: ^0.0.4 copied to clipboard
An extension to the widget that helps to reduce the boilerplate and adds some helpful methods.
awesome_extensions #

Let get started 💪 #
- Go to
pubspec.yaml - add a awesome_extensions and replace
[version]with the latest version:
dependencies:
awesome_extensions: ^[version]
- click the packages get button or flutter pub get
TextStyle Extensions #
.bold() #
Text('Hello World',
style: Theme.of(context).textTheme.caption.bold,
),
// or
Text('Hello World',
style: context.textTheme.caption.bold,
),
Similar text style extensions are:
mostThickThe most thick - FontWeight.w900extraBoldExtra-bold - FontWeight.w800boldBold - FontWeight.bold - FontWeight.w700semiBoldSemi-bold - FontWeight.w600mediumMedium - FontWeight.w500regularRegular - FontWeight.w400lightLight - FontWeight.w300extraLightExtra-light - FontWeight.w200thinThin, the least thick - FontWeight.w100
SizeBox Extensions #
This extension is reduced more code like:
SizedBox(
height : 20.0
)
you can done in 1 line code
// make space of 20.0 height
20.0.heightSizedBox
// for width
20.0.widthSizedBox
Date Extensions #
// for check two date are same or not
date.isSameDate(otherdate); // its return bool (true/false)
// for check date is today's date
date.isToday // its return bool (true/false)
// for check this date is yesterday's date
date.isYesterday // its return bool (true/false)
Padding Extensions #
for apply padding in widget you doing this:
Padding(
padding: const EdgeInsets.all(8.0),
child: Text("text"),
);
but using padding extension:
Text("text").paddingAll(8.0),
Similar padding extensions are:
paddingAllCreates insets from offsets from all side.paddingOnlyCreates insets with only the given values non-zero.paddingLTRBCreates insets from offsets from the left, top, right, and bottom.paddingSymmetricCreates insets with symmetrical vertical and horizontal offsets.paddingFromWindowPaddingCreates insets that match the given window padding.