handy_extensions 0.0.3 copy "handy_extensions: ^0.0.3" to clipboard
handy_extensions: ^0.0.3 copied to clipboard

Handy Extension is just a simple library with extensions to the core libraries to make them more handy and quicker to use.

HandyExtensions #

Handy Extension is just a simple library with extensions to the core libraries to make them more handy and quicker to use.

I don't know how "deadly" this is but I just use it anyway.

Extensions On: #

Getting started #

Add as a dependency #

dependencies:
  handy_extensions: ^0.0.2

Usage #

BuildContext #

context.goTo(page: const Home());
context.goTo(page: const Home(), replace: true);

Go Back To The Previous Page

context.goBack();
context.goToRefresh(page: const Login());

Notify The User Using A SnackBar

context.notify(message: 'Hello World', isError: false); // You can pass the isError argument or leave it, it will default to false

Get Screen Size (based on MediaQuery)

// Height
context.height;
// Width
context.width;

double #

Makes use of this package money_formatter

Get Your Double Formatted As Money using the money property

10.money.symbolOnLeft; // => $ 10.00 (String)
1000.money.compactSymbolOnLeft; // => $ 1K (String)

Get comparison methods on your double using the compare property

10.compare.isEqual(10); // => true (bool)

Available methods for comparison:

Iteration #

firstWhereOrNull

List<String> list = ['a', 'b', 'c'];
String? character = list.firstWhereOrNull( (String item) => item == 'a'); // => 'a' (String) or null (null)

String #

Country Emoji

String country = 'ZW';
String emoji = country.countryEmoji; // => πŸ‡ΏπŸ‡Ό (String)

Title Case

String title = 'hello world';
String titleCase = title.titleCase; // => Hello world

Heading Case

String heading = 'hello world';
String headingCase = heading.headingCase; // => Hello World

Additional information #

You can add in more extensions of your own -> share with the rest of the world.

5
likes
0
pub points
72%
popularity

Publisher

verified publisheriamngoni.co.zw

Handy Extension is just a simple library with extensions to the core libraries to make them more handy and quicker to use.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, money_formatter

More

Packages that depend on handy_extensions