Grock class

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

context BuildContext
Context for get context
no setter
deviceHeight double
no setter
deviceSize Size
no setter
deviceWidth double
Device Screen Size
no setter
empty Widget
Empty Widget
no setter
height double
no setter
hideKeyboard → void
Hide keyboard function.
no setter
isAndroid bool
Device Information
no setter
isDarkTheme bool
getter/setter pair
isFuchsia bool
no setter
isIOS bool
no setter
isLinux bool
no setter
isMacOS bool
no setter
isOpenSnackbar bool
no setter
isWindows bool
no setter
NavigationKey for navigation Added in MaterialApp => navigatorKey: Grock.navigationKey, Grock Navigation, extensions, and more features are available in this key
no setter
scaffoldMessengerKey GlobalKey<ScaffoldMessengerState>
ScaffoldMessengerKey for show snackbar Added in MaterialApp => scaffoldMessengerKey: Grock.scaffoldMessengerKey,
no setter
width double
no setter

Static Methods

adaptiveDialogButton({Key? key, required Widget child, required VoidCallback onPressed, bool isDefaultAction = false, bool isDestructiveAction = false}) Widget
------ Grock Widget Extensions ------
back({Object? result}) → void
Grock.back(result: "Result String Data");
clearMaterialBanner() → void
closeGrockOverlay() → void
Grock Overlay close overlay
dialog<T>({required Widget builder(BuildContext grockContext), bool barrierDismissible = true, Color? barrierColor = Colors.black54, String? barrierLabel, bool useSafeArea = true, bool useRootNavigator = true, RouteSettings? routeSettings}) Future<T?>
fullScreenDialog({required Widget child, Duration openDuration = const Duration(milliseconds: 600), Duration closeDuration = const Duration(milliseconds: 300), Tween<double>? closeTween, bool isCloseScaleAnimation = false, bool isMatrixAnimation = false, bool isHorizontalSlideAnimation = true, double closureRate = 0.24, Alignment openAlignment = Alignment.bottomLeft, Alignment closeAlignment = Alignment.bottomLeft, bool isSlideOpacity = true, int matrixRotateValue = 1000, Key? key}) → void
fullScreenModal<T extends Object?>({required Widget builder(BuildContext, Animation<double>, Animation<double>), bool isSlideTransition = true, bool isScaleTransition = false, bool isFadeTranssition = true, bool isRotateTransition = false, bool isVerticalGestureClose = false, Alignment scaleAlignment = Alignment.topCenter, SlideTransitionType slideTransitionType = SlideTransitionType.fromTop, Duration openDuration = const Duration(milliseconds: 500), bool isOpaque = false, bool isBarrierDismissible = false, Color barrierColorValue = Colors.black54, String? barrierLabelValue, bool isMaintainState = true}) Future<T?>
isOpenGrockOverlay() bool
Grock Overlay is open or not
loadingPopup({Key? key, Color? backgroundColor, String? text, Widget? child, TextStyle? style, Color? color, double? height, double? width, BorderRadiusGeometry? borderRadius, bool isScale = true, double strokeWidth = 4, double startScale = 1.0, double endScale = 0.6, Gradient? gradient}) Widget
normalizeValue(double value, double minValue, double maxValue) double
Grock.normalizeValue(10, 0, 100).printer; normalize value
randomColor() Color
Random Color from Colors.primaries
rndColor() Color
Random Color from Colors.primaries
showGrockOverlay({required Widget child}) → void
Grock Overlay show overlay widget
showMaterialBanner({Key? key, required Widget content, TextStyle? contentTextStyle, List<Widget>? actions, double? elevation, Widget? leading, Color? backgroundColor, Color? surfaceTintColor, Color? shadowColor, Color? dividerColor, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? leadingPadding, bool forceActionsBelow = false, OverflowBarAlignment overflowAlignment = OverflowBarAlignment.end, Animation<double>? animation, void onVisible()?}) → void
snackBar({required String title, required String description, Color? color, dynamic onTap()?, Widget? body, SnackbarPosition position = SnackbarPosition.top, Duration duration = const Duration(seconds: 4), Curve curve = Curves.fastLinearToSlowEaseIn, BorderRadiusGeometry? borderRadius, double? blur, Duration openDuration = const Duration(milliseconds: 600), double? opacity, double? width, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 15, vertical: 15), EdgeInsetsGeometry? margin, EdgeInsetsGeometry? leadingPadding, EdgeInsetsGeometry? trailingPadding, EdgeInsetsGeometry? titlePadding, EdgeInsetsGeometry? descriptionPadding, Widget? leading, Widget? trailing, double? itemSpaceHeight, Color? titleColor, Color? descriptionColor, double? titleSize, double? descriptionSize, TextStyle? titleStyle, TextStyle? descriptionStyle, BoxBorder? border}) → void
The best snackbar widget
to(Widget page, {NavType? type, Widget? childCurrent, BuildContext? ctx, bool inheritTheme = false, Curve curve = Curves.linear, Alignment? alignment, Duration duration = const Duration(milliseconds: 300), Duration reverseDuration = const Duration(milliseconds: 300), bool fullscreenDialog = false, bool opaque = false}) Future
Navigation
toast({String? text, Widget? child, Widget? widget, AlignmentGeometry alignment = Alignment.bottomCenter, Curve curve = Curves.bounceOut, Function? onTap, Duration? duration, Duration openDuration = const Duration(milliseconds: 600), BorderRadiusGeometry? borderRadius, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, Color? backgroundColor, Color? textColor, List<BoxShadow>? boxShadow, TextStyle? textStyle, BoxBorder? border, double? width, TextAlign textAlign = TextAlign.center, TextOverflow overflow = TextOverflow.clip, int? maxLines}) → void
Toast widget, no context required
toRemove(Widget page, {NavType? type, Widget? childCurrent, BuildContext? ctx, bool inheritTheme = false, Curve curve = Curves.linear, Alignment? alignment, Duration duration = const Duration(milliseconds: 300), Duration reverseDuration = const Duration(milliseconds: 300), bool fullscreenDialog = false, bool opaque = false}) Future
Grock.toRemove( HomeScreen(), type: NavType.fade, curve: Curves.easeInOut, duration: Duration(milliseconds: 600), );
uniqId({int length = 11, GrockUniqIdType type = GrockUniqIdType.numbers}) String
Grock.uniqId(length: 11).printer; generate uniq id Response => dart 34576890876
widgetBinding(Function function) → void