Masamune logo

Katana Shorten

Follow on Twitter Follow on Threads Maintained with Melos

GitHub Sponsor


[GitHub](https://github.com/mathrunet) | [YouTube](https://www.youtube.com/c/mathrunetchannel) | [Packages](https://pub.dev/publishers/mathru.net/packages) | [Twitter](https://twitter.com/mathru) | [Threads](https://threads.net/@mathrunet) | [LinkedIn](https://www.linkedin.com/in/mathrunet/) | [mathru.net](https://mathru.net)


Introduction

Duration and EdgeInsets are classes that are often used to implement Flutter.

Surprisingly, there are many characters to describe, and even though there is auto-completion, it takes a lot of time and effort to type the characters.

Therefore, I have created a package of extensions that can shorten them.

It can be easily written as follows

Padding(
  padding: 16.p, // EdgeInsets.all(16)
  child: Text("text")
);

Future.delayed(100.ms); // Duration(milliseconds: 100)

Installation

Import the following packages

flutter pub add katana_shorten

How to use

Duration

The following can be substituted.

100.ms // Duration(milliseconds: 100)
100.s  // Duration(seconds: 100)
100.m  // Duration(minutes: 100)
100.h  // Duration(hours: 100)
100.d  // Duration(days: 100)

EdgeInsets(Padding / Margin)

The following can be substituted.

100.p  // EdgeInsets.all(100)
100.px // EdgeInsets.symmetric(horizontal: 100)
100.py // EdgeInsets.symmetric(vertical: 100)
100.pt // EdgeInsets.only(top: 100)
100.pb // EdgeInsets.only(bottom: 100)
100.pl // EdgeInsets.only(left: 100)
100.pr // EdgeInsets.only(right: 100)

Space(SizedBox)

The following can be substituted.

100.sx // SizedBox(width: 100)
100.sy // SizedBox(height: 100)

Empty() // SizedBox.shrink()

GitHub Sponsors

Sponsors are always welcome. Thank you for your support!

https://github.com/sponsors/mathrunet

Libraries

katana_shorten
Flutter package to write Duration, EdgeInsets, etc. in short descriptions. Simple widgets are also provided.