Showing
3 changed files
with
72 additions
and
59 deletions
| @@ -288,67 +288,72 @@ GetPlatform.isWeb | @@ -288,67 +288,72 @@ GetPlatform.isWeb | ||
| 288 | Get.height | 288 | Get.height |
| 289 | Get.width | 289 | Get.width |
| 290 | 290 | ||
| 291 | -// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. | ||
| 292 | -Get.context.width | ||
| 293 | -Get.context.height | ||
| 294 | - | ||
| 295 | // Gives the context of the screen in the foreground anywhere in your code. | 291 | // Gives the context of the screen in the foreground anywhere in your code. |
| 296 | Get.context | 292 | Get.context |
| 297 | 293 | ||
| 298 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. | 294 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. |
| 299 | Get.contextOverlay | 295 | Get.contextOverlay |
| 300 | 296 | ||
| 297 | +// Note: the following methods are extensions on context. Since you | ||
| 298 | +// have access to context in any place of your UI, you can use it anywhere in the UI code | ||
| 299 | + | ||
| 300 | +// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. | ||
| 301 | +context.width | ||
| 302 | +context.height | ||
| 303 | + | ||
| 304 | + | ||
| 305 | + | ||
| 301 | // gives you the power to define half the screen now, a third of it and so on. | 306 | // gives you the power to define half the screen now, a third of it and so on. |
| 302 | //Useful for responsive applications. | 307 | //Useful for responsive applications. |
| 303 | // param dividedBy (double) optional - default: 1 | 308 | // param dividedBy (double) optional - default: 1 |
| 304 | // param reducedBy (double) optional - default: 0 | 309 | // param reducedBy (double) optional - default: 0 |
| 305 | -Get.context.heightTransformer() | ||
| 306 | -Get.context.widthTransformer() | 310 | +context.heightTransformer() |
| 311 | +context.widthTransformer() | ||
| 307 | 312 | ||
| 308 | /// similar to MediaQuery.of(context).size | 313 | /// similar to MediaQuery.of(context).size |
| 309 | -Get.context.mediaQuerySize() | 314 | +context.mediaQuerySize() |
| 310 | 315 | ||
| 311 | /// similar to MediaQuery.of(context).padding | 316 | /// similar to MediaQuery.of(context).padding |
| 312 | -Get.context.mediaQueryPadding() | 317 | +context.mediaQueryPadding() |
| 313 | 318 | ||
| 314 | /// similar to MediaQuery.of(context).viewPadding | 319 | /// similar to MediaQuery.of(context).viewPadding |
| 315 | -Get.context.mediaQueryViewPadding() | 320 | +context.mediaQueryViewPadding() |
| 316 | 321 | ||
| 317 | /// similar to MediaQuery.of(context).viewInsets; | 322 | /// similar to MediaQuery.of(context).viewInsets; |
| 318 | -Get.context.mediaQueryViewInsets() | 323 | +context.mediaQueryViewInsets() |
| 319 | 324 | ||
| 320 | /// similar to MediaQuery.of(context).orientation; | 325 | /// similar to MediaQuery.of(context).orientation; |
| 321 | -Get.context.orientation() | 326 | +context.orientation() |
| 322 | 327 | ||
| 323 | /// check if device is on landscape mode | 328 | /// check if device is on landscape mode |
| 324 | -Get.context.isLandscape() | 329 | +context.isLandscape() |
| 325 | 330 | ||
| 326 | /// check if device is on portrait mode | 331 | /// check if device is on portrait mode |
| 327 | -Get.context.isPortrait() | 332 | +context.isPortrait() |
| 328 | 333 | ||
| 329 | /// similar to MediaQuery.of(context).devicePixelRatio; | 334 | /// similar to MediaQuery.of(context).devicePixelRatio; |
| 330 | -Get.context.devicePixelRatio() | 335 | +context.devicePixelRatio() |
| 331 | 336 | ||
| 332 | /// similar to MediaQuery.of(context).textScaleFactor; | 337 | /// similar to MediaQuery.of(context).textScaleFactor; |
| 333 | -Get.context.textScaleFactor() | 338 | +context.textScaleFactor() |
| 334 | 339 | ||
| 335 | /// get the shortestSide from screen | 340 | /// get the shortestSide from screen |
| 336 | -Get.context.mediaQueryShortestSide() | 341 | +context.mediaQueryShortestSide() |
| 337 | 342 | ||
| 338 | /// True if width be larger than 800 | 343 | /// True if width be larger than 800 |
| 339 | -Get.context.showNavbar() | 344 | +context.showNavbar() |
| 340 | 345 | ||
| 341 | /// True if the shortestSide is smaller than 600p | 346 | /// True if the shortestSide is smaller than 600p |
| 342 | -Get.context.isPhone() | 347 | +context.isPhone() |
| 343 | 348 | ||
| 344 | /// True if the shortestSide is largest than 600p | 349 | /// True if the shortestSide is largest than 600p |
| 345 | -Get.context.isSmallTablet() | 350 | +context.isSmallTablet() |
| 346 | 351 | ||
| 347 | /// True if the shortestSide is largest than 720p | 352 | /// True if the shortestSide is largest than 720p |
| 348 | -Get.context.isLargeTablet() | 353 | +context.isLargeTablet() |
| 349 | 354 | ||
| 350 | /// True if the current device is Tablet | 355 | /// True if the current device is Tablet |
| 351 | -Get.context.isTablet() | 356 | +context.isTablet() |
| 352 | ``` | 357 | ``` |
| 353 | 358 | ||
| 354 | ### Configuraciones globales opcionales | 359 | ### Configuraciones globales opcionales |
| @@ -318,61 +318,64 @@ Get.context | @@ -318,61 +318,64 @@ Get.context | ||
| 318 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. | 318 | // Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. |
| 319 | Get.contextOverlay | 319 | Get.contextOverlay |
| 320 | 320 | ||
| 321 | +// Note: the following methods are extensions on context. Since you | ||
| 322 | +// have access to context in any place of your UI, you can use it anywhere in the UI code | ||
| 323 | + | ||
| 321 | // If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. | 324 | // If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. |
| 322 | -Get.context.width | ||
| 323 | -Get.context.height | 325 | +context.width |
| 326 | +context.height | ||
| 324 | 327 | ||
| 325 | // gives you the power to define half the screen now, a third of it and so on. | 328 | // gives you the power to define half the screen now, a third of it and so on. |
| 326 | //Useful for responsive applications. | 329 | //Useful for responsive applications. |
| 327 | // param dividedBy (double) optional - default: 1 | 330 | // param dividedBy (double) optional - default: 1 |
| 328 | // param reducedBy (double) optional - default: 0 | 331 | // param reducedBy (double) optional - default: 0 |
| 329 | -Get.context.heightTransformer() | ||
| 330 | -Get.context.widthTransformer() | 332 | +context.heightTransformer() |
| 333 | +context.widthTransformer() | ||
| 331 | 334 | ||
| 332 | /// similar to MediaQuery.of(context).size | 335 | /// similar to MediaQuery.of(context).size |
| 333 | -Get.context.mediaQuerySize() | 336 | +context.mediaQuerySize() |
| 334 | 337 | ||
| 335 | /// similar to MediaQuery.of(context).padding | 338 | /// similar to MediaQuery.of(context).padding |
| 336 | -Get.context.mediaQueryPadding() | 339 | +context.mediaQueryPadding() |
| 337 | 340 | ||
| 338 | /// similar to MediaQuery.of(context).viewPadding | 341 | /// similar to MediaQuery.of(context).viewPadding |
| 339 | -Get.context.mediaQueryViewPadding() | 342 | +context.mediaQueryViewPadding() |
| 340 | 343 | ||
| 341 | /// similar to MediaQuery.of(context).viewInsets; | 344 | /// similar to MediaQuery.of(context).viewInsets; |
| 342 | -Get.context.mediaQueryViewInsets() | 345 | +context.mediaQueryViewInsets() |
| 343 | 346 | ||
| 344 | /// similar to MediaQuery.of(context).orientation; | 347 | /// similar to MediaQuery.of(context).orientation; |
| 345 | -Get.context.orientation() | 348 | +context.orientation() |
| 346 | 349 | ||
| 347 | /// check if device is on landscape mode | 350 | /// check if device is on landscape mode |
| 348 | -Get.context.isLandscape() | 351 | +context.isLandscape() |
| 349 | 352 | ||
| 350 | /// check if device is on portrait mode | 353 | /// check if device is on portrait mode |
| 351 | -Get.context.isPortrait() | 354 | +context.isPortrait() |
| 352 | 355 | ||
| 353 | /// similar to MediaQuery.of(context).devicePixelRatio; | 356 | /// similar to MediaQuery.of(context).devicePixelRatio; |
| 354 | -Get.context.devicePixelRatio() | 357 | +context.devicePixelRatio() |
| 355 | 358 | ||
| 356 | /// similar to MediaQuery.of(context).textScaleFactor; | 359 | /// similar to MediaQuery.of(context).textScaleFactor; |
| 357 | -Get.context.textScaleFactor() | 360 | +context.textScaleFactor() |
| 358 | 361 | ||
| 359 | /// get the shortestSide from screen | 362 | /// get the shortestSide from screen |
| 360 | -Get.context.mediaQueryShortestSide() | 363 | +context.mediaQueryShortestSide() |
| 361 | 364 | ||
| 362 | /// True if width be larger than 800 | 365 | /// True if width be larger than 800 |
| 363 | -Get.context.showNavbar() | 366 | +context.showNavbar() |
| 364 | 367 | ||
| 365 | /// True if the shortestSide is smaller than 600p | 368 | /// True if the shortestSide is smaller than 600p |
| 366 | -Get.context.isPhone() | 369 | +context.isPhone() |
| 367 | 370 | ||
| 368 | /// True if the shortestSide is largest than 600p | 371 | /// True if the shortestSide is largest than 600p |
| 369 | -Get.context.isSmallTablet() | 372 | +context.isSmallTablet() |
| 370 | 373 | ||
| 371 | /// True if the shortestSide is largest than 720p | 374 | /// True if the shortestSide is largest than 720p |
| 372 | -Get.context.isLargeTablet() | 375 | +context.isLargeTablet() |
| 373 | 376 | ||
| 374 | /// True if the current device is Tablet | 377 | /// True if the current device is Tablet |
| 375 | -Get.context.isTablet() | 378 | +context.isTablet() |
| 376 | ``` | 379 | ``` |
| 377 | 380 | ||
| 378 | ### Optional Global Settings and Manual configurations | 381 | ### Optional Global Settings and Manual configurations |
| @@ -299,7 +299,9 @@ Get.offNamedUntil() | @@ -299,7 +299,9 @@ Get.offNamedUntil() | ||
| 299 | // retorna qual é a plataforma | 299 | // retorna qual é a plataforma |
| 300 | //(Esse método é completamente compatível com o FlutterWeb, | 300 | //(Esse método é completamente compatível com o FlutterWeb, |
| 301 | //diferente do método do framework "Platform.isAndroid") | 301 | //diferente do método do framework "Platform.isAndroid") |
| 302 | -GetPlatform.isAndroid/isIOS/isWeb... | 302 | +GetPlatform.isAndroid |
| 303 | +GetPlatform.isIOS | ||
| 304 | +GetPlatform.isWeb | ||
| 303 | 305 | ||
| 304 | // 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) | 306 | // 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 | 307 | Get.height |
| @@ -308,54 +310,57 @@ Get.width | @@ -308,54 +310,57 @@ Get.width | ||
| 308 | // fornece o context da tela em qualquer lugar do seu código. | 310 | // fornece o context da tela em qualquer lugar do seu código. |
| 309 | Get.context | 311 | Get.context |
| 310 | 312 | ||
| 311 | -// Se você precisa de um width/height adaptável (como em navegadores em que a janela pode ser redimensionada) você precisa usar 'context' | ||
| 312 | -Get.context.width | ||
| 313 | -Get.context.height | ||
| 314 | - | ||
| 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 | +// Obs: os métodos a seguir são extensions do context. Já que se | ||
| 317 | +// tem acesso ao context em qualquer lugar do código da UI, você pode usar lá | ||
| 318 | + | ||
| 319 | +// Se você precisa de um width/height adaptável (como em navegadores em que a janela pode ser redimensionada) você precisa usar 'context' | ||
| 320 | +context.width | ||
| 321 | +context.height | ||
| 322 | + | ||
| 318 | /// similar to MediaQuery.of(this).padding | 323 | /// similar to MediaQuery.of(this).padding |
| 319 | -Get.context.mediaQueryPadding() | 324 | +context.mediaQueryPadding() |
| 320 | 325 | ||
| 321 | /// similar to MediaQuery.of(this).viewPadding | 326 | /// similar to MediaQuery.of(this).viewPadding |
| 322 | -Get.context.mediaQueryViewPadding() | 327 | +context.mediaQueryViewPadding() |
| 323 | 328 | ||
| 324 | /// similar to MediaQuery.of(this).viewInsets; | 329 | /// similar to MediaQuery.of(this).viewInsets; |
| 325 | -Get.context.mediaQueryViewInsets() | 330 | +context.mediaQueryViewInsets() |
| 326 | 331 | ||
| 327 | /// similar to MediaQuery.of(this).orientation; | 332 | /// similar to MediaQuery.of(this).orientation; |
| 328 | -Get.context.orientation() | 333 | +context.orientation() |
| 329 | 334 | ||
| 330 | /// check if device is on landscape mode | 335 | /// check if device is on landscape mode |
| 331 | -Get.context.isLandscape() | 336 | +context.isLandscape() |
| 332 | 337 | ||
| 333 | /// check if device is on portrait mode | 338 | /// check if device is on portrait mode |
| 334 | -Get.context.isPortrait() | 339 | +context.isPortrait() |
| 335 | 340 | ||
| 336 | /// similar to MediaQuery.of(this).devicePixelRatio; | 341 | /// similar to MediaQuery.of(this).devicePixelRatio; |
| 337 | -Get.context.devicePixelRatio() | 342 | +context.devicePixelRatio() |
| 338 | 343 | ||
| 339 | /// similar to MediaQuery.of(this).textScaleFactor; | 344 | /// similar to MediaQuery.of(this).textScaleFactor; |
| 340 | -Get.context.textScaleFactor() | 345 | +context.textScaleFactor() |
| 341 | 346 | ||
| 342 | /// get the shortestSide from screen | 347 | /// get the shortestSide from screen |
| 343 | -Get.context.mediaQueryShortestSide() | 348 | +context.mediaQueryShortestSide() |
| 344 | 349 | ||
| 345 | /// True if width be larger than 800 | 350 | /// True if width be larger than 800 |
| 346 | -Get.context.showNavbar() | 351 | +context.showNavbar() |
| 347 | 352 | ||
| 348 | /// True if the shortestSide is smaller than 600p | 353 | /// True if the shortestSide is smaller than 600p |
| 349 | -Get.context.isPhone() | 354 | +context.isPhone() |
| 350 | 355 | ||
| 351 | /// True if the shortestSide is largest than 600p | 356 | /// True if the shortestSide is largest than 600p |
| 352 | -Get.context.isSmallTablet() | 357 | +context.isSmallTablet() |
| 353 | 358 | ||
| 354 | /// True if the shortestSide is largest than 720p | 359 | /// True if the shortestSide is largest than 720p |
| 355 | -Get.context.isLargeTablet() | 360 | +context.isLargeTablet() |
| 356 | 361 | ||
| 357 | /// True if the current device is Tablet | 362 | /// True if the current device is Tablet |
| 358 | -Get.context.isTablet() | 363 | +context.isTablet() |
| 359 | ``` | 364 | ``` |
| 360 | 365 | ||
| 361 | ### Configurações Globais opcionais e configurações manuais | 366 | ### Configurações Globais opcionais e configurações manuais |
-
Please register or login to post a comment