flutter_utilsx 1.0.2
flutter_utilsx: ^1.0.2 copied to clipboard
It sort of 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 [...]
This package is contains basic methods for working with the Dart language. that are daily usage while developing a project.
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/mainfolder.
const
MaterialApp(
navigatorKey: AppCntx.navigatorKey,
home: Home(),
);
- display Dialogs & Bottom Sheets
- If you want display bottom sheet you can set just type as DialogType.bottomSheet
showFullWidthDialog(
child : "any widget",
type : DialogType.dialog,
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 : "height of the bottom sheet",
elevation : "elevation of the bottom sheet",
);
- check the value is null or not
isNotEmpty(dynamic value);
- Date Operations and formation
stringToDate("25/9/2023", DateFormates.YYYY_MM_DD);
convertTime24Formate("time");
- 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,
);
}
- 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
- Read Logs
- you can read logs by using the following code
logMessage("your message");
- Make your any widget Click able with the following code & give Beautiful animation
SweetButton(
onPressed: () { },
child: "Widget"
)
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.