flutter_utilsx

Last updated:

0 purchases

flutter_utilsx Image
flutter_utilsx Images
Add to Cart

Description:

flutter utilsx

Flutter utilsx #



## Features
It contains a lot of methods that are daily usage while developing a project.
like display dialogs & bottom sheets, check the value is null or not, Date Operations and formation
It also helps you to reduce the code and make it more readable.
Usage #
This package is very easy to use. You can use it by adding the following code to your project.
to lib/main folder.

Set up the package in your MaterialApp add the following code to your lib/main folder.

const
MaterialApp(
navigatorKey: AppCntx.navigatorKey,
home: Home(),
);
copied to clipboard

display Dialogs & Bottom Sheets
If you want display bottom sheet you can set just type as DialogType.bottomSheet

Dialogs.showDialogX(
child : "any widget",
isCancelable: "click outside of the dialog to close",
context : "pass context if you don't pass the context"
" add your MaterialApp navigator key mentioned above",
);
copied to clipboard

If you want to check Dialog is open or not you can use the following code

Dialogs.isDialogOpen;
copied to clipboard

If you want to close Dialog you can use the following code

Dialogs.closeDialog();
copied to clipboard

If you want display bottom sheet you can just call this method
This boottom sheet is supported Material3

Dialogs.showBottomSheet(
child : "any widget",
isCancelable: "click outside of the dialog to close",
context : "pass context if you don't pass the context"
" add your MaterialApp navigator key mentioned above",
heightFactor = 0.5,
double elevation=0,
);
copied to clipboard

check the value is null or not

isNotEmpty(dynamic value);
copied to clipboard

Date Operations and formation

stringToDate("25/9/2023", DateFormates.YYYY_MM_DD);
convertTime24Formate("time");
copied to clipboard

validate your form
you can validate your form by using the following code

class anyName with ValidationMixn{
TextFormField(
validator: (value) => validateEmail(value),
);
TextFormField(
validator: validatePassword,
);
}
copied to clipboard

Give heigh and with of the widget
hp is for height percentage
wp is for width percentage
heightBox is for height

20.heightBox
10.widthBox
5.hp
copied to clipboard

Read Logs
you can read logs by using the following code

logMessage("your message");
copied to clipboard

Make your any widget Click able with the following code & give Beautiful animation

SweetButton(
onPressed: () { },
child: "Widget"
)
copied to clipboard

Get date with current month name formate like "23-September-2021"
you can pass any date to this method and it will return the date with current month name
you can also pass string date to this method and it will return the date with current month name

getDateByName(DateTime.now());
stringToDateByName("25-September-2021");
copied to clipboard

Get time Ago from the given date
you can pass any date to this method and it will return the time ago from the given date

calculateTimeDelayInMinutes(
required DateTime start,
required DateTime end
)
copied to clipboard

Get the current date and time
you can get the current date and time by using the following code

currentDate;
copied to clipboard

BuildContext Extension to get the theme, size, textTheme, colorScheme

context.theme;
context.size;
context.textTheme;
context.colorScheme;
copied to clipboard
Additional information #
This package is still under development.
If you have any suggestions or issues please raise them on GitHub.
Also, if you want to contribute to this package please feel free to fork this repository and contribute.
And if you like this package please give it a star.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.