fluda 1.1.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

Fluda is a library which makes Flutter application development faster and easier. It makes your code clean and easy to read.

Fluda

Fluda is a library which makes Flutter application development faster and easier. It makes your code clean and easy to read.

Note: Fluda is still under development. Feedback and Pull Requests are most welcome!

Usage

Extensions

BuildContext

ExtensionExample UsageOriginal Equivalent
MediaQueryData get querycontext.queryMediaQuery.of(context)
FocusScopeNode get focuscontext.focusFocusScope.of(context)
ThemeData get themecontext.themeTheme.of(context)
NavigatorState get navigatorcontext.navigatorNavigator.of(context)

FocusScopedNode

ExtensionExample UsageOriginal Equivalent
hideKeyboard()context.focus.hideKeyboard()if (!FocusScope.of(context).hasPrimaryFocus) FocusScope.of(context).unfocus()

Boolean

ExtensionExample UsageOriginal Equivalent
ifTrue(yes, [no])someBool.ifTrue(Text("Hello"))someBool ? Text("Hello") : SizedBox()
someBool.ifTrue(firstVariable, secondVariable)someBool ? firstVariable : secondVariable

Number

ExtensionExample UsageOriginal Equivalent
bool get isEven5.isEven(5 % 2 == 0)
bool get isOdd5.isOdd(5 % 2 != 0)
bool get isPositive5.isPositive(5 > 0)
bool get isNegative5.isNegative(5 < 0)
Iterable<int> to(int end, {int step = 1})2.to(5)[2, 3, 4, 5]

String

ExtensionExample UsageOriginal Equivalent
bool get isEmptyOrNull"Hello".isEmptyOrNull"Hello" == null ⎮⎮ "Hello".isEmpty
bool get isNotEmptyOrNull"Hello".isNotEmptyOrNull"Hello" != null && "Hello".isNotEmpty
int toInt()"23".toInt()int.parse("23")
double toDouble()"23.3".toDouble()double.parse("23.3")
bool validate()"Simon Pham".validate(RegexUtils.name)RegExp(nameRegex).hasMatch("Simon Pham")
bool validateEmail()"email@email.com".validateEmail()RegExp(emailRegex).hasMatch("email@email.com")
Future launch()"https://some.url".launch()if (await url.canLaunch("https://some.url")) url.launch("https://some.url")
Future dial()"0987654321".dial()if (await url.canLaunch("tel:0987654321")) url.launch("tel:0987654321")
Future sendMail()"me@email.com".sendMail()if (await url.canLaunch("mailto:me@email.com")) url.launch("mailto:me@email.com")

PageController

ExtensionExample UsageDescription
Future<void> goTo(int page)pageController.goTo(2)Animate PageView to page index 2 smoothly

ScrollController

ExtensionExample UsageDescription
Future<void> goTo(double position)scrollController.goTo(233.99)Animate Scroll widget to position 233.99 smoothly

TextEditingController

ExtensionExample UsageDescription
void selectAll()textEditingController.selectAll()Select all text in the text field

Constants

ConstantValue
FludaX.x0_54.0
FludaX.x8.0
FludaX.x216.0
FludaX.x324.0
FludaX.x432.0
FludaX.x540.0
FludaX.x648.0
FludaX.x756.0
FludaX.x864.0
Constant (Duration)Value
FludaDuration.ms100ms
FludaDuration.ms2200ms
FludaDuration.ms3300ms
FludaDuration.ms4400ms
FludaDuration.ms5500ms
FludaDuration.ms6600ms
FludaDuration.ms7700ms
FludaDuration.ms8800ms

Issues

Please file Fluda specific issues, bugs, or feature requests in our issue tracker.

Plugin issues that are not specific to Fluda can be filed in the Flutter issue tracker.

Contributing

If you wish to contribute a change to any of the existing plugins in this repo, please review our contribution guide, and send a pull request.