nb_utils 3.3.4-nullsafety nb_utils: ^3.3.4-nullsafety copied to clipboard
This package helps you daily usable function with ease. Just add nb_utils with its latest version and that's it you are ready to use.
Show some love and like to support the project #
Intro #
This package helps you daily usable function with ease. Just add nb_utils with its latest version and that's it you are ready to use.
Documentation #
API Docs are available.
Installation #
add this line to pubspec.yaml
dependencies:
nb_utils: <latest_version>
import package
import 'package:nb_utils/nb_utils.dart';
Examples #
// Open a new screen
HomePage().launch(context);
// Remove all screens from back stack and opens new screen
launchNewScreenWithNewTask(context, 'tag');
// Back to previous screen
finish(context);
// Get Color from hex string
Color color = getColorFromHex('#FFFFF');
// Hide soft keyboard
hideKeyboard(context);
// Padding All, Apply TextStyle
Column(
children: <Widget>[
Text(item.title.validate(), style: boldTextStyle()),
],
).paddingAll(16)
// Check given String is not null
// validate() function verifies weather given String is null or not. if null then it returns blank String
// validate() function prevents null object
Text(item.title.validate()),
// Apply Bold TextStyle
Text(item.title.validate(), style: boldTextStyle())
// Apply Primary TextStyle
Text(item.title.validate(), style: primaryTextStyle())
// Apply Secondary TextStyle
Text(item.title.validate(), style: secondaryTextStyle())
// Rounded Image
Image.network(item.image, height: 250).cornerRadiusWithClipRRect(20)
// Show a Widget (for ex here Circular Progress Bar) only if data is loading or doing some background task
Center(child: CircularProgressIndicator()).visible(mIsLoading)
* mIsLoading is bool variable.
// Center Widget
CircularProgressIndicator().center()
// Apply Default Shadow to a Container Widget
Container(
height: 100,
color: Colors.white,
).withShadow()
// Apply Rounded Corner Radius to a Container Widget
Container(
height: 100,
color: Colors.white,
).withRoundedCorners()
// Click on ANY Widget
Container(
height: 100,
).onTap(() {
// Handle Click
})
// Check Email Validation
if(!emailController.text.validateEmail()) {
// Handle Email not valid
}
// Check Phone Number Validation
if(!phoneController.text.validatePhone()) {
// Handle Phone Number not valid
}
// Capitalize First Letter
'this is simple string'.capitalizeFirstLetter();
Bonus ( Android Studio (Eclipse Keymap) Most Needed Shortcuts) #
-
ALT + INSERT -> To Create a new File -> Open Project Window on Left Sidebar and press ALT + INSERT key to where you want to create new file. (After opening a window you can also search by typing keyword)
-
CTRL + H -> To find something anywhere in project
-
Scroll from source -> Locate a file in project (GIF)
- SHIFT + ALT + R -> Rename any variable or file name everywhere you used the same
💰 Donations #
If you would like to support the creator of this library or the continuous maintenance of this library, feel free to donate. Your donation is highly appreciated. Thank you!
PayPal
- Donate $5: Thank's for creating this project, here's a tea for you!
- Donate $10: Wow, I am stunned. Let me take you to the movies!
- Donate $15: I really appreciate your work, let's grab some lunch!
- Donate $25: That's some awesome stuff you did right there, dinner is on me!
- Donate $50: I really really want to support this project, great job!
- Donate $100: You are the man! This project saved me hours of struggle and hard work, simply awesome!
Getting Started #
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.