{"id":17178771,"url":"https://github.com/bhoominn/nb_utils","last_synced_at":"2025-05-16T07:06:27.266Z","repository":{"id":37853501,"uuid":"376810031","full_name":"bhoominn/nb_utils","owner":"bhoominn","description":"Collection of Widgets and helpful Methods that every developer needs.","archived":false,"fork":false,"pushed_at":"2025-04-04T08:06:40.000Z","size":55040,"stargazers_count":153,"open_issues_count":9,"forks_count":57,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-08T17:17:50.075Z","etag":null,"topics":["ai","chat-gpt","dart","dartlang","flutter","flutter-package","flutter-plugin","flutter-widget"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/nb_utils","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhoominn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["bhoominn"]}},"created_at":"2021-06-14T12:09:35.000Z","updated_at":"2025-04-04T08:06:44.000Z","dependencies_parsed_at":"2024-12-22T16:12:57.286Z","dependency_job_id":null,"html_url":"https://github.com/bhoominn/nb_utils","commit_stats":{"total_commits":160,"total_committers":12,"mean_commits":"13.333333333333334","dds":0.36875,"last_synced_commit":"32e1d7a9a250e1afb5a54739e8d5a71c4e78eae3"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoominn%2Fnb_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoominn%2Fnb_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoominn%2Fnb_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoominn%2Fnb_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhoominn","download_url":"https://codeload.github.com/bhoominn/nb_utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485063,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat-gpt","dart","dartlang","flutter","flutter-package","flutter-plugin","flutter-widget"],"created_at":"2024-10-15T00:09:23.374Z","updated_at":"2025-05-16T07:06:22.257Z","avatar_url":"https://github.com/bhoominn.png","language":"Dart","funding_links":["https://github.com/sponsors/bhoominn","https://www.buymeacoffee.com/bhoominn","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://pub.dev/packages/nb_utils/\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/nb_utils.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/Apache-2.0\" target=\"_blank\"\u003e\u003cimg src=\"https://badges.frapsoft.com/os/v1/open-source.svg?v=102\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bhoominn/nb_utils/issues\" target=\"_blank\"\u003e\u003cimg alt=\"GitHub: bhoominn\" src=\"https://img.shields.io/github/issues-raw/bhoominn/nb_utils?style=flat\" /\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/github/last-commit/bhoominn/nb_utils\" /\u003e\n\n\u003ca href=\"https://discord.com/channels/854023838136533063/854023838576672839\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/discord/854023838136533063\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bhoominn\"\u003e\u003cimg alt=\"GitHub: bhoominn\" src=\"https://img.shields.io/github/followers/bhoominn?label=Follow\u0026style=social\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bhoominn/nb_utils\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/bhoominn/nb_utils?style=social\" /\u003e\u003c/a\u003e\n\n\u003ca href=\"https://saythanks.io/to/bhoominn\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sponsors/bhoominn\"\u003e\u003cimg src=\"https://img.shields.io/github/sponsors/bhoominn\" /\u003e\u003c/a\u003e\n\n\u003ca href=\"https://www.buymeacoffee.com/bhoominn\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=bhoominn\u0026button_colour=5F7FFF\u0026font_colour=ffffff\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=FFDD00\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n## Show some love and like to support the project\n\n### Say Thanks Here\n\u003ca href=\"https://saythanks.io/to/bhoominn\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\"/\u003e\u003c/a\u003e\n\n### Follow Me on Twitter \n\u003ca href=\"https://twitter.com/bhoominnaik\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/bhoominnaik?color=1DA1F2\u0026label=Followers\u0026logo=twitter\" /\u003e\u003c/a\u003e\n\n## Platform Support\n\n| Android | iOS | MacOS  | Web | Linux | Windows |\n| :-----: | :-: | :---:  | :-: | :---: | :-----: |\n|   ✔️    | ✔️  |  ✔️   | ✔️  |  ✔️   |   ✔️   |\n\n## Installation\n\nAdd this package to `pubspec.yaml` as follows:\n\n```console\n$ flutter pub add nb_utils\n```\n\nImport package\n\n```dart\nimport 'package:nb_utils/nb_utils.dart';\n```\n\nInitialize nb_utils in main.dart file for initializing Shared Preferences and other variables.\nAlso you can assign your Chat GPT key here.\n\n```dart\nvoid main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n\n  await initialize();\n\n  chatGPTAPIkey = \"YOUR_KEY\";\n\n  runApp(MyApp());\n}\n```\n\nNow, add navigatorKey in your MaterialApp or CupertinoApp\n\n```dart\nreturn MaterialApp(\n  debugShowCheckedModeBanner: false,\n  navigatorKey: navigatorKey,\n  home: HomePage(),\n);\n```\n\n## Featured on Google's Dev Library\n\u003ca href=\"https://devlibrary.withgoogle.com/products/flutter/repos/bhoominn-nb_utils\" target=\"_blank\"\u003eCheckout here\u003c/a\u003e\n\n\u003ca href=\"https://devlibrary.withgoogle.com/authors\" target=\"_blank\"\u003eDev Library Contributors\u003c/a\u003e\n\n## Contents\n\n- [Useful Methods](#useful-methods-or-extensions-you-will-ever-need)\n- [Use of TextStyle](#textstyles)\n- [Shared Preference Example](#shared-preference-example)\n- [MaterialYou Theme](#materialyou-theme)\n- [Decorations](#decorations)\n- [Widgets](#widgets)\n- [Extensions](#extensions)\n  - [String Extensions](#string-extensions)\n  - [bool Extensions](#bool-extensions)\n  - [Color Extensions](#color-extensions)\n  - [BuildContext Extensions](#buildcontext-extensions)\n  - [DateTime Extensions](#datetime-extensions---utils)\n  - [Device Extensions](#device-extensions)\n  - [double Extensions](#double-extensions)\n  - [Duration Extensions](#duration-extensions)\n  - [int Extensions](#int-extensions)\n  - [List Extensions](#list-extensions)\n  - [num Extensions](#num-extensions)\n  - [ScrollController Extensions](#scrollcontroller-extensions)\n  - [Widget Extensions](#widget-extensions)\n- [System Methods](#systems-methods)\n- [Network Utils](#network-utils)\n- [JWT Decoder](#jwt-decoder)\n- [Dialog](#show-dialogs)\n- [Custom Dialogs](#custom-dialogs)\n\n## Useful methods or extensions you will ever need\n```dart\n/// Open a new screen\nHomePage().launch(context);\n\n/// Animate the new page (Slide, Rotate, Scale, Fade)\nHomePage().launch(context, pageRouteAnimation: PageRouteAnimation.Slide);\n\n/// Remove all screens from back stack and opens new screen\nHomePage().launch(context, isNewTask: true);\n\n// Returns to previous Screen\nfinish(context);\n\n// Returns to previous Screen with a result\nfinish(context, object);\n\n/// Toast a String\ntoast('This is a string');\n\n/// Prints only if in debug or profile mode - (parameter is Object)\nlog('Your string');\n\nvoid hideKeyboard(context)\n\n/// If you are opening Dialog in initState method and you want to use BuildContext but yet it is not created,\n/// You can use afterBuildLayout in initState method like this.\nafterBuildLayout(() {\n  // Get Callback after your build widget is rendered\n});\n\n/// Get Package Name from Native Platform (Android, iOS)\nawait getPackageName();\n\n/// Get Package Name, Version Code, Version Name (Android, iOS)\nawait getPackageInfo();\n\n/// Return true if Android OS version is above 12\nFuture\u003cbool\u003e isAndroid12Above()\n\n///  Handle error and loading widget when using FutureBuilder or StreamBuilder\n/// \"snap\" is the snapShot value we get from FutureBuilder or StreamBuilder\nreturn snapWidgetHelper(snap);\n\n/// See the example below. You can Use FutureBuilder or StreamBuilder.\nFutureBuilder(\n  builder(_, snap) {\n    if (snap.hasData) {\n      return YourWidget();\n    } else {\n      /// This function will handle loading and error automatically.\n      /// You can modify loading and error widget in parameters.\n  \n      return snapWidgetHelper(snap);\n    }\n  }\n),\n\n// Basic SnackBar\nsnackBar(context, title: 'Sample toast'),\n\n// Enhanced\nsnackBar(\n  context,\n  title: 'Sample toast',\n  textColor: Colors.blue,\n  backgroundColor: Colors.white,\n  elevation: 8,\n  shape: RoundedRectangleBorder(borderRadius: radius(30)),\n  margin: EdgeInsets.all(16),\n  duration: 3.seconds,\n);\n```\n\n## TextStyles\n```dart\n/// Apply Bold TextStyle\nText(item.title.validate(), style: boldTextStyle()),\n    \n/// Apply Primary TextStyle\nText(item.title.validate(), style: primaryTextStyle()),\n    \n/// Apply Secondary TextStyle\nText(item.title.validate(), style: secondaryTextStyle()),\n```\n\n## Shared Preference Example\n```dart\n/// To use SharedPreference, you must call initialize() method in main.dart file as mentioned in Installations section\n\n/// setValue method has (String key, dynamic value) parameters\n\n/// add a Double in SharedPref\nawait setValue(\"key\", 20.0);\n\n/// add a bool in SharedPref\nawait setValue(\"key\", false);\n\n/// add a int in SharedPref\nawait setValue(\"key\", 10);\n\n/// add a String in SharedPref\nawait setValue(\"key\", \"value\");\n\n/// add a String List in SharedPref\nawait setValue(\"key\", ['value', 'value', 'value']);\n\n/// Returns a Bool if exists in SharedPref\n/// You can set a default value if it returns null\ngetBoolAsync(\"key\");\n\n/// Returns a Double if exists in SharedPref\ngetDoubleAsync(\"key\");\n\n/// Returns a Int if exists in SharedPref\ngetIntAsync(\"key\");\n\n/// Returns a String if exists in SharedPref\ngetStringAsync(\"key\");\n\n/// Returns a JSON if exists in SharedPref\ngetJSONAsync(\"key\");\n\n/// Remove a key from SharedPref\nawait removeKey(\"key\");\n\n/// Returns List of Keys that matches with given Key\ngetMatchingSharedPrefKeys('key')\n```\n\n## MaterialYou Theme\n```dart\nFuture\u003cdynamic\u003e getMaterialYouColors()\nFuture\u003cColor\u003e getMaterialYouPrimaryColor()\n```\n\n## Decorations\n```dart\n\nBorderRadius radius([double? radius])\nRadius radiusCircular([double? radius])\nBorderRadius radiusOnly({double? topRight,double? topLeft,double? bottomRight,double? bottomLeft,})\n\nShapeBorder dialogShape([double? borderRadius])\n\n/// Apply default BoxDecoration with default shadow and border radius\nContainer(\n    decoration: boxDecorationDefault(), // You can modify based on your preference\n),\n\nInputDecoration defaultInputDecoration({String? hint, String? label, TextStyle? textStyle})\n```\n\n## Widgets\n```dart\n/// Give Blur effect to any widget\n/// Use Blur widget to know more properies\nBlur(\n  child: AnyWidget(),\n)\n```\n\n```dart\n/// Making an app for Web? You must have to perform something on mouse hover event.\n/// Use HoverWidget to get your widget is being hovering or not\nHoverWidget(\n  builder: (_, isHovering) {\n    return AnyWidget();\n  },\n),\n```\n\n```dart\n/// Wrap MaterialApp Widget with RestartAppWidget\n/// Use: RestartAppWidget.init(context);\n/// Call above line any where to restart your Flutter app.\nRestartAppWidget(\n  child: MaterialApp(),\n)\n```\n\n```dart\nDoublePressBackWidget(\n  child: AnyWidget(),\n  message: 'Your message' // Optional\n),\n```\n\n```dart\n/// Add a Google Logo\n/// Add size parameter for custom size - Default is 24\nGoogleLogoWidget(),\n```\n[Image](#googlelogowidget)\n\n```dart\n/// You can use your preferred State Management technique\nLoader().visible(mIsLoading),\n```\n[GIF](#loader-widget)\n\n```dart\n/// Read More Text Widget\n/// Use ReadMoreText Widget in your project to get more familiar with other properties \nReadMoreText(\n  'Long Text',\n),\n```\n\n```dart\n/// Timer widget\nTimerWidget(\n  function: () {\n    // Do something\n  },\n  child: Text('Your Widget'),\n  duration: 10.seconds,\n),\n```\n\n```dart\nSettingSection(\n  title: Text('Account Management', style: boldTextStyle(size: 24)),\n  subTitle: Text('Control your account', style: primaryTextStyle()), // Optional\n  items: [\n    SettingItemWidget(\n      title: 'Hibernate account',\n      subTitle: 'Temporary deactivate your account',\n      decoration: BoxDecoration(borderRadius: radius()),\n      trailing: Icon(Icons.keyboard_arrow_right_rounded, color: context.dividerColor),\n      onTap: () {\n        //\n      }\n    ),\n    SettingItemWidget(\n      title: 'Close account',\n      subTitle: 'Learn about your options, and close your account if you wish',\n      decoration: BoxDecoration(borderRadius: radius()),\n      trailing: Icon(Icons.keyboard_arrow_right_rounded, color: context.dividerColor),\n      onTap: () {\n        //\n      },\n    )\n  ],\n),\n```\n[Image](#settingsection)\n\n```dart\n//SettingItem\nSettingItemWidget(\n   title: \"Title\",\n   onTap: () {\n       //Your Logic\n   },\n   trailing: Icon(Icons.home_sharp), // Optional\n   leading: Icon(Icons.arrow_forward_ios_rounded), // Optional\n   subTitle: \"Subtitle\", // Optional\n),\n```\n[Image](#settingitemwidget)\n\n```dart\n/// Default AppButton\n/// Use AppButton on your app to try more properties\nAppButton(\n  text: \"Submit\",\n  color: Colors.green, // Optional\n  onTap: () {\n      //Your logic\n  },\n),\n```\n[GIF](#appbutton)\n\n```dart\n/// Use PlaceHolderWidget while your network image is loading\nPlaceHolderWidget(),\n```\n\n```dart\n/// Use GradientBorder while your network image is loading\nGradientBorder(\n  gradient: LinearGradient(\n    colors: [\n      Colors.orange,\n      Colors.yellow,\n      Colors.pink,\n    ],\n  ),\n  strokeWidth: 4.0,\n  child: AnyWidget(),\n)\n```\n\n```dart\n/// Use RoundedCheckBox widget to get nicely rounded check box\n/// It has many optional parameters to get personalized check box widget\nRoundedCheckBox(\n  isChecked: true,\n  text: 'Remember me',\n  onTap: (val) {\n    //\n  },\n),\n```\n\n```dart\n/// Use SizeListener widget to get callback when its child widget size changes\nSizeListener(\n  child: AnyWidget(),\n  onSizeChange: (size) {\n    log(size.width.toString());\n  },\n),\n```\n\n```dart\nUL(\n   symbolType: SymbolType.Numbered,\n   children: [\n       Text('Hi', style: primaryTextStyle()),\n       Text('Hello', style: primaryTextStyle()),\n       Text('How are you?', style: primaryTextStyle()),\n   ],\n),\n```\n[Image](#ul-widget)\n\n```dart\n/// Use AppTextField on your app to try more properties\n/// Use Form Validate to validate all AppTextField\n\n/// Inbuilt Email Validator, Automatic email keyboard type\nAppTextField(\n  controller: TextEditingController(), // Optional\n  textFieldType: TextFieldType.EMAIL,\n  decoration: InputDecoration(labelText: 'Email', border: OutlineInputBorder()),\n),\n\n/// Default Min Lines 4\nAppTextField(\n  controller: TextEditingController(), // Optional\n  textFieldType: TextFieldType.MULTILINE,\n  decoration: InputDecoration(labelText: 'Address', border: OutlineInputBorder()),\n),\n\n/// Automatic password obscure, Show/Hide Password Option\nAppTextField(\n  controller: TextEditingController(), // Optional\n  textFieldType: TextFieldType.PASSWORD,\n  decoration: InputDecoration(labelText: 'Password', border: OutlineInputBorder()),\n),\n```\n[Image](#apptextfield)\n\n```dart\n/// Add read more button to a long text\nReadMoreText(\n  'Long Text',\n),\n```\n\n```dart\n/// Build Horizontal List widget without giving specific height to it.\nHorizontalList(\n  itemBuilder: (BuildContext context, int index) {\n      return AnyWidget();\n  },\n  itemCount: 25,\n),\n```\n[GIF](#horizontallist-widget)\n\n```dart\nRatingBarWidget(\n  rating: initialRating,\n  onRatingChanged: (aRating) {\n      rating = aRating;\n  },\n),\n```\n[Image](#ratingbarwidget)\n\n```dart\n/// Make your Flutter App Responsive in any device out there with Responsive widget\nResponsive(\n  mobile: MobileWidget(),\n  tablet: TabletWidget(), // Optional\n  web: WebWidget(), // Optional\n),\n```\n[Image](#responsive-widget)\n\n```dart\nTextIcon(\n  text: 'Your text',\n  prefix: AnyWidget(), // Optional\n  suffix: AnyWidget(), // Optional\n),\n```\n\n```dart\nDotIndicator(\n  pageController: pageController,\n  pages: list,\n),\n```\n[GIF](#dotindicator-widget)\n\n```dart\n/// Use SnapHelperWidget to handle loading and error widget automatically\n/// Still you can specify custom Loader Widget and Error Widget\nSnapHelperWidget\u003cT\u003e(\n  future: future,\n  onSuccess: (data) {\n      return AnyWidget();\n  },\n),\n```\n\n```dart\nDottedBorderWidget(\n  child: Container(\n      height: 100,\n      width: 100,\n  ),\n),\n```\n[Image](#dottedborderwidget)\n\n```dart\nMarquee(\n  direction: Axis.horizontal,\n  animationDuration: Duration(milliseconds: 100),\n  pauseDuration: Duration(milliseconds: 100),\n  child: Text(\"Please enter a long text to see the effect of the marquee widget\"),\n),\n```\n\n# Extensions\n## String Extensions\n```dart\nString validate({String value = ''})\nbool validateEmail()\nbool validatePhone()\nbool validateURL()\n\nbool isDigit()\nbool isAlpha()\nbool isJson()\n\nbool get isInt\nbool get isImage\nbool get isAudio\nbool get isVideo\nbool get isTxt\nbool get isDoc\nbool get isExcel\nbool get isPPT\nbool get isApk\nbool get isPdf\nbool get isHtml\n\nString get reverse\n\nFuture\u003cvoid\u003e copyToClipboard()\n\nString capitalizeFirstLetter()\nString repeat(int n, {String separator = ''})\nString formatNumberWithComma({String seperator = ','})\nString toYouTubeId({bool trimWhitespaces = true})\nString getYouTubeThumbnail()\nString removeAllWhiteSpace()\nString getNumericOnly({bool aFirstWordOnly = false})\nString toSlug({String delimiter = '_'})\n\nColor toColor({Color? defaultColor})\n\nList\u003cString\u003e toList()\nList\u003cString\u003e setSearchParam()\n\nint toInt({int defaultValue = 0})\nint countWords()\n\ndouble toDouble({double defaultValue = 0.0})\ndouble calculateReadTime({int wordsPerMinute = 200})\n```\n\n## bool Extensions\n```dart\nbool validate({bool value = false})\n\nint getIntBool({bool value = false})\n```\n\n## Color Extensions\n```dart\nString toHex({bool leadingHashSign = true, bool includeAlpha = false})\n\nbool isDark()\n\nbool isLight()\n\ndouble getBrightness()\n\ndouble getLuminance()\n```\n\n## BuildContext Extensions\n```dart\nSize size()\n\n/// return screen width\ndouble width()\n/// return screen height\ndouble height()\n\ndouble pixelRatio()\n\nBrightness platformBrightness()\n\ndouble get statusBarHeight\ndouble get navigationBarHeight\n\nThemeData get theme\nTextTheme get textTheme\nDefaultTextStyle get defaultTextStyle\nFormState? get formState\nScaffoldState get scaffoldState\nOverlayState? get overlayState\n\nColor get primaryColor\nColor get accentColor\nColor get scaffoldBackgroundColor\nColor get cardColor\nColor get dividerColor\nColor get iconColor\n\nvoid requestFocus(FocusNode focus)\n\nbool isPhone()\nbool isTablet()\nbool isDesktop()\n\n```\n\n## DateTime Extensions - Utils\n```dart\n\n/// You can use .timeAgo on a DateTime object like this\nString result = DateTime.now().timeAgo;\n\nbool get isToday\nbool get isYesterday\nbool get isTomorrow\n\n/// return current time in milliseconds\nint currentMillisecondsTimeStamp()\n\n/// return current timestamp\nint currentTimeStamp()\n\nbool leapYear(int year)\n\n/// returns how much time ago from timestamp\nString formatTime(int timestamp)\n\n/// returns number of days in given month\nint daysInMonth(int monthNum, int year)\n```\n\n## Device Extensions\n```dart\nDeviceSize get device\n    \nbool get isWeb\nbool get isMobile\nbool get isDesktop\nbool get isApple\nbool get isGoogle\nbool get isAndroid\nbool get isIOS\nbool get isMacOS\nbool get isLinux\nbool get isWindows\n    \nString get operatingSystemName\nString get operatingSystemVersion\n```\n\n## Double Extensions\n```dart\ndouble validate({double value = 0.0})\n\nbool isBetween(num first, num second)\n    \nSize get size\n```\n\n## Duration Extensions\n```dart\n/// await Duration(seconds: 1).delay();\nFuture\u003cvoid\u003e get delay\n```\n\n## int Extensions\n```dart\n/// Validate given int is not null and returns given value if null.\nint validate({int value = 0})\n\n/// Leaves given height of space ex: 16.height,\nWidget get height\n/// Leaves given width of space ex: 16.width,\nWidget get width\n\n/// HTTP status code\nbool isSuccessful()\n\nBorderRadius borderRadius([double? val])\n\n/// Returns microseconds duration\n/// 5.microseconds\nDuration get microseconds\nDuration get milliseconds\nDuration get seconds\nDuration get minutes\nDuration get hours\nDuration get days\n\nbool isBetween(num first, num second)\n\nSize get size\n\n// return suffix (th,st,nd,rd) of the given month day number\nString toMonthDaySuffix()\n\n// returns month name from the given int\nString toMonthName({bool isHalfName = false})\n\n// returns WeekDay from the given int\nString toWeekDay({bool isHalfName = false})\n```\n\n## List Extensions\n```dart\n/// Validate given List is not null and returns blank list if null.\nList\u003cT\u003e validate()\n\n/// Generate forEach but gives index for each element\nvoid forEachIndexed(void action(T element, int index))\n\nint sumBy(int Function(T) selector)\n\ndouble sumByDouble(num Function(T) selector)\n\ndouble? averageBy(num Function(T) selector)\n```\n\n## num Extensions\n```dart\n/// Validate given double is not null and returns given value if null.\nnum validate({num value = 0})\n\n/// Returns price with currency\nString toCurrencyAmount()\n```\n\n## ScrollController Extensions\n```dart\nScrollController scrollController = ScrollController();\n\n/// animate to top\nscrollController.animToTop();\n/// animate to Bottom\nscrollController.animToBottom();\n/// animate to specific position\nscrollController.animateToPosition(20.0);\n/// jump to the start of the list without animation\nscrollController.jumpToTop();\n/// jump to the end of the list without animation\nscrollController.jumpToBottom();\n```\n\n## Widget Extensions\n```dart\nWidget onTap(Function? function, {BorderRadius? borderRadius, Color? splashColor,Color? hoverColor, Color? highlightColor})\nFuture\u003cT?\u003e launch\u003cT\u003e(BuildContext context,{bool isNewTask = false, PageRouteAnimation? pageRouteAnimation,Duration? duration})\n\nWidget expand({flex = 1})\nWidget flexible({flex = 1, FlexFit? fit})\nWidget fit({BoxFit? fit, AlignmentGeometry? alignment})\nWidget withTooltip({required String msg})\nWidget center({double? heightFactor, double? widthFactor})\nWidget visible(bool visible, {Widget? defaultWidget})\n\nSizedBox withSize({double width = 0.0, double height = 0.0})\nSizedBox withWidth(double width)\nSizedBox withHeight(double height)\nPadding paddingTop(double top)\nPadding paddingLeft(double left)\nPadding paddingRight(double right)\nPadding paddingBottom(double bottom\nPadding paddingAll(double padding)\nPadding paddingOnly({double top = 0.0,double left = 0.0,double bottom = 0.0,double right = 0.0})\nPadding paddingSymmetric({double vertical = 0.0, double horizontal = 0.0})\n\n/// Make Image Circular with these extension\nClipRRect cornerRadiusWithClipRRectOnly({int bottomLeft = 0,int bottomRight = 0,int topLeft = 0,int topRight = 0})\nClipRRect cornerRadiusWithClipRRect(double radius)\n\nWidget opacity({required double opacity,int durationInSecond = 1,Duration? duration})\nWidget rotate({required double angle,bool transformHitTests = true,Offset? origin})\nWidget scale({required double scale,Offset? origin,AlignmentGeometry? alignment,bool transformHitTests = true})\nWidget translate({required Offset offset,bool transformHitTests = true,Key? key})\n```\n\n## Systems Methods\n```dart\n/// Change status bar Color and Brightness\nsetStatusBarColor(Colors.blue);\n\nsetDarkStatusBar();\nsetLightStatusBar();\n\n/// Show Status Bar\nshowStatusBar();\n\n/// Hide Status Bar\nhideStatusBar();\n\n/// Set orientation to portrait\nsetOrientationPortrait();\n\n/// Set orientation to landscape\nsetOrientationLandscape();\n\n/// Get current PlatformName as a String\nString platformName();\n\n/// Enter FullScreen Mode (Hides Status Bar and Navigation Bar)\nenterFullScreen();\n\n/// Unset Full Screen to normal state (Now Status Bar and Navigation Bar Are Visible)\nexitFullScreen();\n\n/// Returns a string from Clipboard\nFuture\u003cString\u003e paste();\n\n/// Invoke Native method and get result\nvar data = await invokeNativeMethod(CHANNEL_NAME, METHOD_NAME, [dynamic arguments]);\n```\n\n## Network Utils\n```dart\nFuture\u003cbool\u003e isNetworkAvailable()\nFuture\u003cbool\u003e isConnectedToMobile()\nFuture\u003cbool\u003e isConnectedToWiFi()\n```\n\n## JWT Decoder\n```dart\n/// Pass your token here to get Map\u003cString, dynamic\u003e\nMap\u003cString, dynamic\u003e JwtDecoder.decode(token);\n\nbool JwtDecoder.isExpired(token);\nDateTime JwtDecoder.getExpirationDate(token);\nDuration JwtDecoder.getTokenTime(token);\nDuration JwtDecoder.getRemainingTime(token);\n```\n\n## Show Dialogs\n```dart\n\n/// Show Dialog with Default Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget());\n\n/// Show Dialog with Rotate Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.ROTATE);\n\n/// Show Dialog with Scale Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.SCALE);\n\n/// Show Dialog with Top to Bottom Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.SLIDE_TOP_BOTTOM);\n\n/// Show Dialog with Bottom to Top Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.SLIDE_BOTTOM_TOP);\n\n/// Show Dialog with Left to Right Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.SLIDE_LEFT_RIGHT);\n\n/// Show Dialog with Right to Left Animation\nshowInDialog(context, builder: (context) =\u003e AnyWidget(), dialogAnimation: DialogAnimation.SLIDE_RIGHT_LEFT);\n\n/// Show Confirmation Dialog\n/// Second parameter is Title\nshowConfirmDialog(\n  context,\n  'Do you want to logout from the app?',\n  onAccept: (context) {\n    //\n  },\n);\n```\n\n## Custom Dialogs\n```dart\nAppButton(\n  text: \"Add\",\n  onTap: () {\n    showConfirmDialogCustom(\n      context,\n      title: \"Do you want to add this item?\",\n      dialogType: DialogType.ADD,\n      onAccept: () {\n        snackBar(context, title: 'Added');\n      },\n    );\n  },\n),\n```\n![Add Confirmation Dialog](https://github.com/bhoominn/nb_utils/blob/main/screenshots/add_confirmation_dialog.gif)\n\n```dart\nAppButton(\n  text: \"Delete\",\n  onTap: () {\n    showConfirmDialogCustom(\n      context,\n      title: \"Delete 89 files permanent?\",\n      dialogType: DialogType.DELETE,\n      onAccept: () {\n        snackBar(context, title: 'Deleted');\n      },\n    );\n  },\n),\n```\n![Delete Confirmation Dialog](https://github.com/bhoominn/nb_utils/blob/main/screenshots/delete_confirmation_dialog.gif)\n\n```dart\nAppButton(\n  text: \"Update\",\n  onTap: () {\n    showConfirmDialogCustom(\n      context,\n      title: \"Do you want to update this item?\",\n      dialogType: DialogType.UPDATE,\n      onAccept: () {\n        snackBar(context, title: 'Updated');\n      },\n    );\n  },\n),\n```\n![Update Confirmation Dialog](https://github.com/bhoominn/nb_utils/blob/main/screenshots/update_confirmation_dialog.gif)\n\n```dart\nAppButton(\n  text: \"Confirmation with Custom Image\",\n  onTap: () async {\n    showConfirmDialogCustom(\n      context,\n      title: \"Do you want to logout from the app?\",\n      dialogType: DialogType.CONFIRMATION,\n      centerImage: 'URL',\n      onAccept: () {\n        //\n      },\n      onCancel: () {\n        //\n      },\n      height: 300,\n      width: 400,\n    );\n  },\n),\n```\n![Custom Confirmation Dialog](https://github.com/bhoominn/nb_utils/blob/main/screenshots/custom_confirmation_dialog.gif)\n\n```dart\nAppButton(\n  text: \"Confirmation\",\n  onTap: () {\n    showConfirmDialogCustom(\n      context,\n      onAccept: () {\n        snackBar(\n          context,\n          title: 'Confirmed',\n          snackBarAction: SnackBarAction(label: 'label', onPressed: () {}),\n        );\n      },\n    );\n  },\n),\n```\n![Default Confirmation Dialog](https://github.com/bhoominn/nb_utils/blob/main/screenshots/default_confirmation_dialog.gif)\n\n# Image Previews\n\n## GoogleLogoWidget \n![GoogleLogoWidget](https://github.com/bhoominn/nb_utils/blob/main/screenshots/google_logo_widget.gif)\n\n## Loader Widget\n![Loader](https://github.com/bhoominn/nb_utils/blob/main/screenshots/loader_widget.gif)\n\n## SettingSection\n![SettingSection](https://github.com/bhoominn/nb_utils/blob/main/screenshots/setting_section_widget.jpg)\n\n## SettingItemWidget\n![SettingItemWidget](https://github.com/bhoominn/nb_utils/blob/main/screenshots/setting_item_widget.jpg)\n\n## AppButton\n![AppButton](https://github.com/bhoominn/nb_utils/blob/main/screenshots/app_button.gif)\n\n## UL Widget\n![UL](https://github.com/bhoominn/nb_utils/blob/main/screenshots/ul_widget.jpg)\n\n## AppTextField\n![AppTextField](https://github.com/bhoominn/nb_utils/blob/main/screenshots/app_text_field_widget.jpg)\n\n## HorizontalList Widget\n![HorizontalList](https://github.com/bhoominn/nb_utils/blob/main/screenshots/horizontal_widget.gif)\n\n## RatingBarWidget\n![RatingBarWidget](https://github.com/bhoominn/nb_utils/blob/main/screenshots/rating_bar_widget.gif)\n\n## Responsive Widget\n![Responsive](https://github.com/bhoominn/nb_utils/blob/main/screenshots/responsive_widget.gif)\n\n## DotIndicator Widget\n![DotIndicator](https://github.com/bhoominn/nb_utils/blob/main/screenshots/dot_indicator.gif)\n\n## DottedBorderWidget\n![DottedBorderWidget](https://github.com/bhoominn/nb_utils/blob/main/screenshots/dotted_border_widget.jpg)\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/bhoominn/nb_utils/issues\n\n## ⭐ If you like the package, a star to the repo will mean a lot.\n\n## You can also contribute by adding new widgets or helpful methods.\n\n## If you want to give suggestion, please contact me via email - bhoominn@gmail.com\n\n## Thank you ❤\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoominn%2Fnb_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhoominn%2Fnb_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoominn%2Fnb_utils/lists"}