Committed by
GitHub
Merge pull request #323 from Nipodemos/more_docs_update
[Docs] documenting some undocumented Get methods
Showing
3 changed files
with
192 additions
and
24 deletions
| @@ -242,38 +242,112 @@ MaterialApp( | @@ -242,38 +242,112 @@ MaterialApp( | ||
| 242 | ``` | 242 | ``` |
| 243 | 243 | ||
| 244 | ```dart | 244 | ```dart |
| 245 | -Get.arguments // give the current args from currentScreen | 245 | +// give the current args from currentScreen |
| 246 | +Get.arguments | ||
| 246 | 247 | ||
| 247 | -Get.previousArguments // give arguments of previous route | 248 | +// give arguments of previous route |
| 249 | +Get.previousArguments | ||
| 248 | 250 | ||
| 249 | -Get.previousRoute // give name of previous route | 251 | +// give name of previous route |
| 252 | +Get.previousRoute | ||
| 250 | 253 | ||
| 251 | -Get.rawRoute // give the raw route to access for example, rawRoute.isFirst() | 254 | +// give the raw route to access for example, rawRoute.isFirst() |
| 255 | +Get.rawRoute | ||
| 252 | 256 | ||
| 253 | -Get.routing // give access to Rounting API from GetObserver | 257 | +// give access to Rounting API from GetObserver |
| 258 | +Get.routing | ||
| 254 | 259 | ||
| 255 | -Get.isSnackbarOpen // check if snackbar is open | 260 | +// check if snackbar is open |
| 261 | +Get.isSnackbarOpen | ||
| 256 | 262 | ||
| 257 | -Get.isDialogOpen // check if dialog is open | 263 | +// check if dialog is open |
| 264 | +Get.isDialogOpen | ||
| 258 | 265 | ||
| 259 | -Get.isBottomSheetOpen // check if bottomsheet is open | 266 | +// check if bottomsheet is open |
| 267 | +Get.isBottomSheetOpen | ||
| 260 | 268 | ||
| 261 | -Get.removeRoute() // remove one route. | 269 | +// remove one route. |
| 270 | +Get.removeRoute() | ||
| 262 | 271 | ||
| 263 | -Get.until() // back repeatedly until the predicate returns true. | 272 | +// back repeatedly until the predicate returns true. |
| 273 | +Get.until() | ||
| 264 | 274 | ||
| 265 | -Get.offUntil() // go to next route and remove all the previous routes until the predicate returns true. | 275 | +// go to next route and remove all the previous routes until the predicate returns true. |
| 276 | +Get.offUntil() | ||
| 266 | 277 | ||
| 267 | -Get.offNamedUntil() // go to next named route and remove all the previous routes until the predicate returns true. | 278 | +// go to next named route and remove all the previous routes until the predicate returns true. |
| 279 | +Get.offNamedUntil() | ||
| 268 | 280 | ||
| 269 | -GetPlatform.isAndroid/isIOS/isWeb... //(This method is completely compatible with FlutterWeb, unlike the framework. "Platform.isAndroid") | 281 | +//Check in what platform the app is running |
| 282 | +GetPlatform.isAndroid | ||
| 283 | +GetPlatform.isIOS | ||
| 284 | +GetPlatform.isWeb | ||
| 270 | 285 | ||
| 271 | -Get.height / Get.width // Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. If you need a changeable height/width (like browser windows that can be scaled) you will need to use context.height and context.width | 286 | +// Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. |
| 287 | +Get.height | ||
| 288 | +Get.width | ||
| 272 | 289 | ||
| 273 | -Get.context // Gives the context of the screen in the foreground anywhere in your code. | 290 | +// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. |
| 291 | +Get.context.width | ||
| 292 | +Get.context.height | ||
| 274 | 293 | ||
| 275 | -Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. | 294 | +// Gives the context of the screen in the foreground anywhere in your code. |
| 295 | +Get.context | ||
| 276 | 296 | ||
| 297 | +// Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. | ||
| 298 | +Get.contextOverlay | ||
| 299 | + | ||
| 300 | +// gives you the power to define half the screen now, a third of it and so on. | ||
| 301 | +//Useful for responsive applications. | ||
| 302 | +// param dividedBy (double) optional - default: 1 | ||
| 303 | +// param reducedBy (double) optional - default: 0 | ||
| 304 | +Get.context.heightTransformer() | ||
| 305 | +Get.context.widthTransformer() | ||
| 306 | + | ||
| 307 | +/// similar to MediaQuery.of(context).size | ||
| 308 | +Get.context.mediaQuerySize() | ||
| 309 | + | ||
| 310 | +/// similar to MediaQuery.of(context).padding | ||
| 311 | +Get.context.mediaQueryPadding() | ||
| 312 | + | ||
| 313 | +/// similar to MediaQuery.of(context).viewPadding | ||
| 314 | +Get.context.mediaQueryViewPadding() | ||
| 315 | + | ||
| 316 | +/// similar to MediaQuery.of(context).viewInsets; | ||
| 317 | +Get.context.mediaQueryViewInsets() | ||
| 318 | + | ||
| 319 | +/// similar to MediaQuery.of(context).orientation; | ||
| 320 | +Get.context.orientation() | ||
| 321 | + | ||
| 322 | +/// check if device is on landscape mode | ||
| 323 | +Get.context.isLandscape() | ||
| 324 | + | ||
| 325 | +/// check if device is on portrait mode | ||
| 326 | +Get.context.isPortrait() | ||
| 327 | + | ||
| 328 | +/// similar to MediaQuery.of(context).devicePixelRatio; | ||
| 329 | +Get.context.devicePixelRatio() | ||
| 330 | + | ||
| 331 | +/// similar to MediaQuery.of(context).textScaleFactor; | ||
| 332 | +Get.context.textScaleFactor() | ||
| 333 | + | ||
| 334 | +/// get the shortestSide from screen | ||
| 335 | +Get.context.mediaQueryShortestSide() | ||
| 336 | + | ||
| 337 | +/// True if width be larger than 800 | ||
| 338 | +Get.context.showNavbar() | ||
| 339 | + | ||
| 340 | +/// True if the shortestSide is smaller than 600p | ||
| 341 | +Get.context.isPhone() | ||
| 342 | + | ||
| 343 | +/// True if the shortestSide is largest than 600p | ||
| 344 | +Get.context.isSmallTablet() | ||
| 345 | + | ||
| 346 | +/// True if the shortestSide is largest than 720p | ||
| 347 | +Get.context.isLargeTablet() | ||
| 348 | + | ||
| 349 | +/// True if the current device is Tablet | ||
| 350 | +Get.context.isTablet() | ||
| 277 | ``` | 351 | ``` |
| 278 | 352 | ||
| 279 | ### Configuraciones globales opcionales | 353 | ### Configuraciones globales opcionales |
| @@ -297,16 +297,71 @@ GetPlatform.isIOS | @@ -297,16 +297,71 @@ GetPlatform.isIOS | ||
| 297 | GetPlatform.isWeb | 297 | GetPlatform.isWeb |
| 298 | 298 | ||
| 299 | // Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. | 299 | // Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. |
| 300 | -// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. | ||
| 301 | Get.height | 300 | Get.height |
| 302 | Get.width | 301 | Get.width |
| 303 | 302 | ||
| 303 | +// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. | ||
| 304 | +Get.context.width | ||
| 305 | +Get.context.height | ||
| 306 | + | ||
| 307 | + | ||
| 304 | // Gives the context of the screen in the foreground anywhere in your code. | 308 | // Gives the context of the screen in the foreground anywhere in your code. |
| 305 | Get.context | 309 | Get.context |
| 306 | 310 | ||
| 307 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. | 311 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. |
| 308 | Get.contextOverlay | 312 | Get.contextOverlay |
| 309 | 313 | ||
| 314 | +// gives you the power to define half the screen now, a third of it and so on. | ||
| 315 | +//Useful for responsive applications. | ||
| 316 | +// param dividedBy (double) optional - default: 1 | ||
| 317 | +// param reducedBy (double) optional - default: 0 | ||
| 318 | +Get.context.heightTransformer() | ||
| 319 | +Get.context.widthTransformer() | ||
| 320 | + | ||
| 321 | +/// similar to MediaQuery.of(context).size | ||
| 322 | +Get.context.mediaQuerySize() | ||
| 323 | + | ||
| 324 | +/// similar to MediaQuery.of(context).padding | ||
| 325 | +Get.context.mediaQueryPadding() | ||
| 326 | + | ||
| 327 | +/// similar to MediaQuery.of(context).viewPadding | ||
| 328 | +Get.context.mediaQueryViewPadding() | ||
| 329 | + | ||
| 330 | +/// similar to MediaQuery.of(context).viewInsets; | ||
| 331 | +Get.context.mediaQueryViewInsets() | ||
| 332 | + | ||
| 333 | +/// similar to MediaQuery.of(context).orientation; | ||
| 334 | +Get.context.orientation() | ||
| 335 | + | ||
| 336 | +/// check if device is on landscape mode | ||
| 337 | +Get.context.isLandscape() | ||
| 338 | + | ||
| 339 | +/// check if device is on portrait mode | ||
| 340 | +Get.context.isPortrait() | ||
| 341 | + | ||
| 342 | +/// similar to MediaQuery.of(context).devicePixelRatio; | ||
| 343 | +Get.context.devicePixelRatio() | ||
| 344 | + | ||
| 345 | +/// similar to MediaQuery.of(context).textScaleFactor; | ||
| 346 | +Get.context.textScaleFactor() | ||
| 347 | + | ||
| 348 | +/// get the shortestSide from screen | ||
| 349 | +Get.context.mediaQueryShortestSide() | ||
| 350 | + | ||
| 351 | +/// True if width be larger than 800 | ||
| 352 | +Get.context.showNavbar() | ||
| 353 | + | ||
| 354 | +/// True if the shortestSide is smaller than 600p | ||
| 355 | +Get.context.isPhone() | ||
| 356 | + | ||
| 357 | +/// True if the shortestSide is largest than 600p | ||
| 358 | +Get.context.isSmallTablet() | ||
| 359 | + | ||
| 360 | +/// True if the shortestSide is largest than 720p | ||
| 361 | +Get.context.isLargeTablet() | ||
| 362 | + | ||
| 363 | +/// True if the current device is Tablet | ||
| 364 | +Get.context.isTablet() | ||
| 310 | ``` | 365 | ``` |
| 311 | 366 | ||
| 312 | ### Optional Global Settings and Manual configurations | 367 | ### Optional Global Settings and Manual configurations |
| @@ -299,22 +299,61 @@ Get.offNamedUntil() | @@ -299,22 +299,61 @@ Get.offNamedUntil() | ||
| 299 | //diferente do método do framework "Platform.isAndroid") | 299 | //diferente do método do framework "Platform.isAndroid") |
| 300 | GetPlatform.isAndroid/isIOS/isWeb... | 300 | GetPlatform.isAndroid/isIOS/isWeb... |
| 301 | 301 | ||
| 302 | -// Equivalente ao método: MediaQuery.of(context).size.height, mas é imutável. | ||
| 303 | -// Se você precisa de um height adaptável (como em navegadores em que a janela pode ser redimensionada) | ||
| 304 | -// você precisa usar 'context.height' | 302 | +// Equivalente ao método: MediaQuery.of(context).size.width ou height, mas é imutável. Significa que não irá atualizar mesmo que o tamanho da tela mude (como em navegadores ou app desktop) |
| 305 | Get.height | 303 | Get.height |
| 306 | - | ||
| 307 | -// Equivalente ao método: MediaQuery.of(context).size.width, mas é imutável. | ||
| 308 | -// Se você precisa de um width adaptável (como em navegadores em que a janela pode ser redimensionada) | ||
| 309 | -// você precisa usar 'context.width' | ||
| 310 | Get.width | 304 | Get.width |
| 311 | 305 | ||
| 306 | +// Se você precisa de um width/height adaptável (como em navegadores em que a janela pode ser redimensionada) você precisa usar 'context' | ||
| 307 | +Get.context.width | ||
| 308 | +Get.context.height | ||
| 309 | + | ||
| 312 | // forncece o context da tela em qualquer lugar do seu código. | 310 | // forncece o context da tela em qualquer lugar do seu código. |
| 313 | Get.context | 311 | Get.context |
| 314 | 312 | ||
| 315 | // fornece o context de snackbar/dialog/bottomsheet em qualquer lugar do seu código. | 313 | // fornece o context de snackbar/dialog/bottomsheet em qualquer lugar do seu código. |
| 316 | Get.contextOverlay | 314 | Get.contextOverlay |
| 317 | 315 | ||
| 316 | +/// similar to MediaQuery.of(this).padding | ||
| 317 | +Get.mediaQueryPadding() | ||
| 318 | + | ||
| 319 | +/// similar to MediaQuery.of(this).viewPadding | ||
| 320 | +Get.mediaQueryViewPadding() | ||
| 321 | + | ||
| 322 | +/// similar to MediaQuery.of(this).viewInsets; | ||
| 323 | +Get.mediaQueryViewInsets() | ||
| 324 | + | ||
| 325 | +/// similar to MediaQuery.of(this).orientation; | ||
| 326 | +Get.orientation() | ||
| 327 | + | ||
| 328 | +/// check if device is on landscape mode | ||
| 329 | +Get.isLandscape() | ||
| 330 | + | ||
| 331 | +/// check if device is on portrait mode | ||
| 332 | +Get.isPortrait() | ||
| 333 | + | ||
| 334 | +/// similar to MediaQuery.of(this).devicePixelRatio; | ||
| 335 | +Get.devicePixelRatio() | ||
| 336 | + | ||
| 337 | +/// similar to MediaQuery.of(this).textScaleFactor; | ||
| 338 | +Get.textScaleFactor() | ||
| 339 | + | ||
| 340 | +/// get the shortestSide from screen | ||
| 341 | +Get.mediaQueryShortestSide() | ||
| 342 | + | ||
| 343 | +/// True if width be larger than 800 | ||
| 344 | +Get.showNavbar() | ||
| 345 | + | ||
| 346 | +/// True if the shortestSide is smaller than 600p | ||
| 347 | +Get.isPhone() | ||
| 348 | + | ||
| 349 | +/// True if the shortestSide is largest than 600p | ||
| 350 | +Get.isSmallTablet() | ||
| 351 | + | ||
| 352 | +/// True if the shortestSide is largest than 720p | ||
| 353 | +Get.isLargeTablet() | ||
| 354 | + | ||
| 355 | +/// True if the current device is Tablet | ||
| 356 | +Get.isTablet() | ||
| 318 | ``` | 357 | ``` |
| 319 | 358 | ||
| 320 | ### Configurações Globais opcionais e configurações manuais | 359 | ### Configurações Globais opcionais e configurações manuais |
-
Please register or login to post a comment