State management package that i use

in WORLD OF XPILAR3 years ago

get

this package has various option not only for state management but also for route and dependency management.

The Three pillars

  1. State management
    Reactive State Manager
  2. Route management
  3. Dependency management

PRODUCTIVITY, PERFORMANCE AND ORGANIZATION these are three principal of Getx.

We can use routes/snackbars/dialogs/bottomsheets without context.

Navigate to a new screen:
Get.to(NextScreen());

Navigate to new screen with name
Get.toNamed('/details');

To close snackbars, dialogs, bottomsheets, or anything you would normally close with Navigator.pop(context) but we can use Get.back()

To go to the next screen and no option to go back to the previous screen Get.off(NextScreen()) is used

Get.offAll(NextScreen()) to go to the next screen and cancel all previous routes.

// give the current args from currentScreen
Get.arguments

// give name of previous route
Get.previousRoute

// give the raw route to access for example, rawRoute.isFirst()
Get.rawRoute

// give access to Routing API from GetObserver
Get.routing

// check if snackbar is open
Get.isSnackbarOpen

// check if dialog is open
Get.isDialogOpen

// check if bottomsheet is open
Get.isBottomSheetOpen

// remove one route.
Get.removeRoute()

// back repeatedly until the predicate returns true.
Get.until()

// go to next route and remove all the previous routes until the predicate returns true.
Get.offUntil()

// go to next named route and remove all the previous routes until the predicate returns true.
Get.offNamedUntil()

//Check in what platform the app is running
GetPlatform.isAndroid
GetPlatform.isIOS
GetPlatform.isMacOS
GetPlatform.isWindows
GetPlatform.isLinux
GetPlatform.isFuchsia

//Check the device type
GetPlatform.isMobile
GetPlatform.isDesktop
//All platforms are supported independently in web!
//You can tell if you are running inside a browser
//on Windows, iOS, OSX, Android, etc.
GetPlatform.isWeb

// Equivalent to : MediaQuery.of(context).size.height,
// but immutable.
Get.height
Get.width

// Gives the current context of the Navigator.
Get.context

// Gives the context of the snackbar/dialog/bottomsheet in the foreground, anywhere in your code.
Get.contextOverlay

// Note: the following methods are extensions on context. Since you
// have access to context in any place of your UI, you can use it anywhere in the UI code

// If you need a changeable height/width (like Desktop or browser windows that can be scaled) you will need to use context.
context.width
context.height

// Gives you the power to define half the screen, a third of it and so on.
// Useful for responsive applications.
// param dividedBy (double) optional - default: 1
// param reducedBy (double) optional - default: 0
context.heightTransformer()
context.widthTransformer()

/// Similar to MediaQuery.of(context).size
context.mediaQuerySize()

/// Similar to MediaQuery.of(context).padding
context.mediaQueryPadding()

/// Similar to MediaQuery.of(context).viewPadding
context.mediaQueryViewPadding()

/// Similar to MediaQuery.of(context).viewInsets;
context.mediaQueryViewInsets()

/// Similar to MediaQuery.of(context).orientation;
context.orientation()

/// Check if device is on landscape mode
context.isLandscape()

/// Check if device is on portrait mode
context.isPortrait()

/// Similar to MediaQuery.of(context).devicePixelRatio;
context.devicePixelRatio()

/// Similar to MediaQuery.of(context).textScaleFactor;
context.textScaleFactor()

/// Get the shortestSide from screen
context.mediaQueryShortestSide()

/// True if width be larger than 800
context.showNavbar()

/// True if the shortestSide is smaller than 600p
context.isPhone()

/// True if the shortestSide is largest than 600p
context.isSmallTablet()

/// True if the shortestSide is largest than 720p
context.isLargeTablet()

/// True if the current device is Tablet
context.isTablet()

/// Returns a value according to the screen size
/// can give value for:
/// watch: if the shortestSide is smaller than 300
/// mobile: if the shortestSide is smaller than 600
/// tablet: if the shortestSide is smaller than 1200
/// desktop: if width is largest than 1200

{SOURCE PUB.DEV}

This package will surely make your production easier both in terms of time and effort.

for more info visit

Sort:  

Welcome to Steem!

There are many growing communities here that you may want to join, here is the latest list of communities prepared by randulakoralage.

For general information about what is happening on Steem follow @steemitblog.


Here is a post that explains everything steps by steps that will help you understand more about Steemit ecosystem, wallet security, Newcomers Achievement Program, list of tutorials, how to use tag in your post, how to claim your reward, how to exchange SBD to Steem, and many useful information. Click here to view this post.


There is a set of achievements prepared by cryptokannon for new comers.

  1. First go to New Comers Community

  2. Read this summary about achievements.

  3. First achievement is a self introduction. THESE are the rules for the post.

  4. Likewise, you can do all achievements. You can learn about steemit related things and get rewarded as well.

Regards,
@neerajkr03

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.029
BTC 69389.89
ETH 3686.50
USDT 1.00
SBD 3.37