Stefan de Vogelaere

Merge remote-tracking branch 'upstream/master'

Showing 100 changed files with 899 additions and 2591 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

@@ -6,6 +6,7 @@ labels: '' @@ -6,6 +6,7 @@ labels: ''
6 assignees: jonataslaw 6 assignees: jonataslaw
7 7
8 --- 8 ---
  9 +**ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION.**
9 **Fill in the template. Issues that do not respect the model will be closed.** 10 **Fill in the template. Issues that do not respect the model will be closed.**
10 11
11 **Describe the bug** 12 **Describe the bug**
@@ -27,8 +28,8 @@ If applicable, add screenshots to help explain your problem. @@ -27,8 +28,8 @@ If applicable, add screenshots to help explain your problem.
27 **Flutter Version:** 28 **Flutter Version:**
28 Enter the version of the Flutter you are using 29 Enter the version of the Flutter you are using
29 30
30 -**Get Version:**  
31 -Enter the version of the Get you are using 31 +**Getx Version:**
  32 +Enter the version of the Getx you are using
32 33
33 **Describe on which device you found the bug:** 34 **Describe on which device you found the bug:**
34 ex: Moto z2 - Android. 35 ex: Moto z2 - Android.
@@ -6,6 +6,7 @@ labels: '' @@ -6,6 +6,7 @@ labels: ''
6 assignees: '' 6 assignees: ''
7 7
8 --- 8 ---
  9 +**ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR FEATURE REQUESTS**
9 10
10 **Is your feature request related to a problem? Please describe.** 11 **Is your feature request related to a problem? Please describe.**
11 A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
@@ -17,11 +17,10 @@ jobs: @@ -17,11 +17,10 @@ jobs:
17 # https://github.com/marketplace/actions/flutter-action 17 # https://github.com/marketplace/actions/flutter-action
18 - uses: subosito/flutter-action@v1 18 - uses: subosito/flutter-action@v1
19 with: 19 with:
20 - flutter-version: '1.17.1' 20 + flutter-version: '1.20.2'
21 channel: 'stable' 21 channel: 'stable'
22 - run: flutter pub get 22 - run: flutter pub get
23 - # run static analys code  
24 - #- run: flutter analyze 23 + - run: flutter analyze
25 # run flutter widgets tests and unit tests 24 # run flutter widgets tests and unit tests
26 - run: flutter test --coverage 25 - run: flutter test --coverage
27 # Upload coverage reports to Codecov 26 # Upload coverage reports to Codecov
1 # See https://www.dartlang.org/guides/libraries/private-files 1 # See https://www.dartlang.org/guides/libraries/private-files
2 2
  3 +# See https://www.dartlang.org/guides/libraries/private-files
  4 +
3 # Files and directories created by pub 5 # Files and directories created by pub
4 .dart_tool/ 6 .dart_tool/
5 .packages 7 .packages
6 build/ 8 build/
7 # If you're building an application, you may want to check-in your pubspec.lock 9 # If you're building an application, you may want to check-in your pubspec.lock
8 pubspec.lock 10 pubspec.lock
  11 +.pub/
9 12
10 # Directory created by dartdoc 13 # Directory created by dartdoc
11 # If you don't generate documentation locally you can remove this line. 14 # If you don't generate documentation locally you can remove this line.
@@ -25,3 +28,49 @@ example/android/ @@ -25,3 +28,49 @@ example/android/
25 example/ios/ 28 example/ios/
26 example/.dart_tool/ 29 example/.dart_tool/
27 example/.packages 30 example/.packages
  31 +
  32 +# IntelliJ
  33 +*.iml
  34 +.idea/*
  35 +#.idea/workspace.xml
  36 +#.idea/tasks.xml
  37 +#.idea/gradle.xml
  38 +#.idea/assetWizardSettings.xml
  39 +#.idea/dictionaries
  40 +#.idea/libraries
  41 +#.idea/caches
  42 +
  43 +# User-specific stuff
  44 +.idea/**/workspace.xml
  45 +.idea/**/tasks.xml
  46 +.idea/**/dictionaries
  47 +.idea/**/shelf
  48 +
  49 +# Sensitive or high-churn files
  50 +.idea/**/dataSources/
  51 +.idea/**/dataSources.ids
  52 +.idea/**/dataSources.local.xml
  53 +.idea/**/sqlDataSources.xml
  54 +.idea/**/dynamic.xml
  55 +.idea/**/uiDesigner.xml
  56 +.idea/**/dbnavigator.xml
  57 +
  58 +# Gradle
  59 +.idea/**/gradle.xml
  60 +.idea/**/libraries
  61 +
  62 +# Android Studio Navigation editor temp files
  63 +.navigation/
  64 +
  65 +# Android Studio captures folder
  66 +captures/
  67 +
  68 +# External native build folder generated in Android Studio 2.2 and later
  69 +.externalNativeBuild
  70 +
  71 +### https://raw.github.com/github/gitignore/80a8803b004013d17291196825a327b9e871f009/Global/VisualStudioCode.gitignore
  72 +.vscode/*
  73 +!.vscode/settings.json
  74 +!.vscode/tasks.json
  75 +!.vscode/launch.json
  76 +!.vscode/extensions.json
  1 +## [3.10.1]
  2 +- Fix analyzer
  3 +
  4 +## [3.10.0]
  5 +Getx 3.10 released with CLI and Get Server.
  6 +- Added: analyser + effective dart (@Grohden)
  7 +- Added TextStyle to generalDialog title and message (@roipeker)
  8 +- renamed and added defaults transition duration and types in "GetInterface" (@roipeker)
  9 +- added missing parameters in Get.to/Get.offAll (@roipeker)
  10 +- added optional transitionDuration and transitionCurve to Get.dialog() (@roipeker)
  11 +- Changed HashMap<int,GetStateUpdate> to HashSet<GetStateUpdate> and allow update IDs groups on GetBuilder (@roipeker)
  12 +- Added a internal VoidCallback in GetStateUpdaterMixin::getUpdate (@roipeker)
  13 +- Added Curve property to routes (@roipeker)
  14 +- Improve docs, code cleanup, new GetStateUpdaterMixin and GetStateUpdate in favour of StateSetter on GetxController, GetBuilder, SimpleBuilder. (@roipeker)
  15 +- Added RxBool.toggle() as an easy shortcut for switching true/false values. (@roipeker)
  16 +- Added _RxImp.nil() to easily set the value to null (@roipeker)
  17 +- Added missing docs to Rx classes. (@roipeker)
  18 +- Added Get.delete(force:false) to Get extensions (@roipeker)
  19 +- Added Docs and comments (@nipodemos)
  20 +- Added docs to PT-br and fix typos (@eduardoflorence)
  21 +- Cleanup route code (@justkawal)
  22 +- Extension to facilitate insert widgets inside a CustomScrollView (@alexkharech)
  23 +- Fix docs .obs examples (@kai-oswald)
  24 +- Added tag capability to GetView
  25 +- Improve code separation of RouteManagement and Internacionalization
  26 +
  27 +## [3.8.0]
  28 +- Added: Snackbar Status: Open, Opening, Closing and Closed
  29 +example:
  30 +```dart
  31 + Get.snackbar('title', 'message', snackbarStatus: (status) {
  32 + if (status == SnackbarStatus.CLOSED) {
  33 + // made anything
  34 + }
  35 + });
  36 +```
  37 +
  38 +## [3.7.0]
  39 +- Added: RxSet. Sets can now also be reactive.
  40 +- Added isDesktop/isMobile (@roipeker)
  41 +- Improve GetPlatform: It is now possible to know which device the user is using if GetPlatform.isWeb is true.
  42 +context.responsiveValue used device orientation based on web and non-web applications. Now it checks if it is a desktop application (web or desktop application) to do the responsiveness calculation. (@roipeker)
  43 +- Change: The documentation previously stated that Iterables should not access the ".value" property.
  44 +However, many users did not pay attention to this fact, and ended up generating unnecessary issues and bugs in their application.
  45 +In this version, we focus on code security. Now ".value" is protected, so it cannot be accessed externally by Lists, Maps or Sets.
  46 +- Change: Observable lists are now Dart Lists.
  47 +There is no difference in your use:
  48 +`RxList list = [].obs;`
  49 +And you use
  50 +`List list = [].obs;`
  51 +- Change: You do not need to access the ".value" property of primitives.
  52 +For Strings you need interpolation.
  53 +For num, int, double, you will have the normal operators, and use it as dart types.
  54 +This way, `.value` can be used exclusively in ModelClasses.
  55 +Example:
  56 +
  57 +```dart
  58 +var name = "Jonny" .obs;
  59 +// usage:
  60 +Text ("$name");
  61 +
  62 +var count = 0.obs;
  63 +// usage:
  64 +increment() => count ++;
  65 +Text("$count");
  66 +```
  67 +
  68 +Thus: List, Map, Set, num, int, double and String, as of this release, will no longer use the .value property.
  69 +
  70 +NOTE:
  71 +The changes were not break changes, however, you may have missed the details of the documentation, so if you faced the message: "The member 'value' can only be used within instance members of subclasses of 'rx_list.dart' "you just need to remove the" .value "property from your list, and everything will work as planned.
  72 +The same goes for Maps and Sets.
  73 +
  74 +## [3.6.2]
  75 +- Fix more formatting issues
  76 +
  77 +## [3.6.1]
  78 +- Fix formatting issues
  79 +
  80 +## [3.6.0]
  81 +- Added RxSet
  82 +- Change default logger to developer.log (@jorgegaticav)
  83 +- Added BindingsBuilder, ValueBuilder, and ObxValue (@roipeker)
  84 +- Fix fallback locale not working if missing country code (@thaihuynhxyz)
  85 +- Fix validation of email ".com.br"
  86 +
  87 +## [3.5.1]
  88 +- Remove unnecessary whitespaces
  89 +
  90 +## [3.5.0]
  91 +- Added logwritter (@stefandevo)
  92 +- Added responsiveValue (@juanjoseleca)
  93 +- Fixed ghost url for snackbar, bottomsheets, and dialogs and unnamed navigation.
  94 +
1 ## [3.4.6] 95 ## [3.4.6]
2 - Fix TextField dispose throw on last Flutter hotfix 96 - Fix TextField dispose throw on last Flutter hotfix
3 97
@@ -6,7 +100,8 @@ @@ -6,7 +100,8 @@
6 - Remove initialization console print 100 - Remove initialization console print
7 101
8 ## [3.4.4] 102 ## [3.4.4]
9 -- Fix exception 'isInit called null' when tags are used in conjunction with dependencies. (@djade007) 103 +- Fix exception 'isInit called null' when tags are used in conjunction with dependencies. (@djade007)
  104 +- Fix typos (@tiagocpeixoto)
10 105
11 ## [3.4.3] 106 ## [3.4.3]
12 - Fix onInit fired only first time 107 - Fix onInit fired only first time
@@ -4,61 +4,68 @@ @@ -4,61 +4,68 @@
4 4
5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get) 5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get)
6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg) 6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg)
7 -[![Gitter](https://badges.gitter.im/flutter_get/community.svg)](https://gitter.im/flutter_get/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 7 +[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart)
  8 +[![Discord Shield](https://img.shields.io/discord/722900883784073290.svg?logo=discord)](https://discord.com/invite/9Hpt99N)
  9 +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://communityinviter.com/apps/getxworkspace/getx)
  10 +[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
8 <a href="https://github.com/Solido/awesome-flutter"> 11 <a href="https://github.com/Solido/awesome-flutter">
9 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" /> 12 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" />
10 </a> 13 </a>
11 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a> 14 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
  15 +
12 ![](getx.png) 16 ![](getx.png)
13 17
14 -<h3>We are sorry for the inconsistency in the translation. The GetX package is updated quite often and translations to docs may not come as fast. So in order for this documentation still has all content, i'll leave here all new untranslated texts (I consider is better to have the english docs then to not have at all), so if anyone wants to translate, it would be very helpful 😁</h3> 18 +<h3>Lamentamos la inconsistencia en la traducción. El paquete GetX se actualiza con bastante frecuencia y es posible que las traducciones a documentos no sean tan rápidas. Entonces, para que esta documentación aún tenga todo el contenido, dejaré aquí todos los textos nuevos sin traducir (considero que es mejor tener los documentos en inglés que no tenerlos), por lo que si alguien quiere traducir, sería de gran ayuda 😁</h3>
15 19
16 - [Communication and support channels:](#communication-and-support-channels) 20 - [Communication and support channels:](#communication-and-support-channels)
17 - [Sobre GetX](#sobre-getx) 21 - [Sobre GetX](#sobre-getx)
18 - [Como contribuir](#como-contribuir) 22 - [Como contribuir](#como-contribuir)
19 -- [Installing](#installing)  
20 -- [Proyeto Counter no GetX](#proyeto-counter-no-getx) 23 +- [Instalando](#installing)
  24 +- [Proyecto Counter en GetX](#proyeto-counter-no-getx)
21 - [Los tres pilares](#los-tres-pilares) 25 - [Los tres pilares](#los-tres-pilares)
22 - [Gestión del Estado](#gestión-del-estado) 26 - [Gestión del Estado](#gestión-del-estado)
23 - - [Reactivo STATE_MANAGER](#reactivo-state_manager) 27 + - [STATE_MANAGER Reactivo](#reactivo-state_manager)
24 - [Más detalles sobre la gestión del estado.](#más-detalles-sobre-la-gestión-del-estado) 28 - [Más detalles sobre la gestión del estado.](#más-detalles-sobre-la-gestión-del-estado)
25 - - [Video explanation about state management](#video-explanation-about-state-management) 29 + - [Explicación en video sobre state management](#video-explanation-about-state-management)
26 - [Gestión de Rutas](#gestión-de-rutas) 30 - [Gestión de Rutas](#gestión-de-rutas)
27 - [Más detalles sobre la gestión de rutas.](#más-detalles-sobre-la-gestión-de-rutas) 31 - [Más detalles sobre la gestión de rutas.](#más-detalles-sobre-la-gestión-de-rutas)
28 - - [Video Explanation](#video-explanation) 32 + - [Explicación del video](#video-explanation)
29 - [Gestión de dependencias](#gestión-de-dependencias) 33 - [Gestión de dependencias](#gestión-de-dependencias)
30 - [Más detalles sobre la gestión de dependencias.](#más-detalles-sobre-la-gestión-de-dependencias) 34 - [Más detalles sobre la gestión de dependencias.](#más-detalles-sobre-la-gestión-de-dependencias)
31 -- [Utils](#utils) 35 +- [Utilidades](#utils)
32 - [Cambiar de tema](#cambiar-de-tema) 36 - [Cambiar de tema](#cambiar-de-tema)
33 - [Otras API avanzadas y configuraciones manuales](#otras-api-avanzadas-y-configuraciones-manuales) 37 - [Otras API avanzadas y configuraciones manuales](#otras-api-avanzadas-y-configuraciones-manuales)
34 - [Configuraciones globales opcionales](#configuraciones-globales-opcionales) 38 - [Configuraciones globales opcionales](#configuraciones-globales-opcionales)
35 - - [Video explanation of Other GetX Features](#video-explanation-of-other-getx-features) 39 + - [Explicación en video de Other GetX Features](#video-explanation-of-other-getx-features)
36 - [Rompiendo cambios desde 2.0](#rompiendo-cambios-desde-20) 40 - [Rompiendo cambios desde 2.0](#rompiendo-cambios-desde-20)
37 - [¿Por qué Getx?](#por-qué-getx) 41 - [¿Por qué Getx?](#por-qué-getx)
38 42
39 # Communication and support channels: 43 # Communication and support channels:
40 44
41 -[**Slack (English)**](https://communityinviter.com/apps/getxworkspace/getx) 45 +[**Slack (Inglés)**](https://communityinviter.com/apps/getxworkspace/getx)
42 46
43 -[**Discord (English and Portuguese)**](https://discord.com/invite/9Y3wK9) 47 +[**Discord (Ingles y Portugués)**](https://discord.com/invite/9Y3wK9)
44 48
45 -[**Telegram (Portuguese)**](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g) 49 +[**Telegram (Portugués)**](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
46 50
47 # Sobre GetX 51 # Sobre GetX
48 52
49 -- GetX es una solución extra ligera y potente para Flutter. Combina gestión de estádo de alto rendimiento, inyección de dependencia inteligente y gestión de rutas, de forma rápida y práctica. 53 +- GetX es una solución extra ligera y potente para Flutter. Combina gestión de estádo de alto rendimiento, inyección de dependencia inteligente y gestión de rutas, de forma rápida y práctica.
50 54
51 -- GetX no es para todos, se enfoca en el consumo mínimo de recursos (rendimiento) ([Mira los puntos de referencia](https://github.com/jonataslaw/benchmarks)), usando una sintaxis fácil y agradable (productividad), que permite el desacoplamiento total de la vista y la lógica de negocio (organización). 55 +- GetX tiene 3 principios básicos, esto significa que esta es la prioridad para todos los recursos de la biblioteca.
  56 + **PERFORMANCE:** GetX se centra en el rendimiento y el consumo mínimo de recursos. Los puntos de referencia casi siempre no son importantes en el mundo real, pero si lo desea, aquí hay un indicador de consumo.([benchmarks](https://github.com/jonataslaw/benchmarks)), donde GetX lo hace mejor que otros enfoques de gestión estatal, por ejemplo. La diferencia no es grande, pero muestra nuestra preocupación por no desperdiciar sus recursos.
  57 + **PRODUCTIVITY:** GetX utiliza una sintaxis fácil y agradable.
  58 + **ORGANIZATION:** GetX permite el desacoplamiento total de la vista de la lógica empresarial.
52 59
53 -- GetX permite ahorrar horas de desarrollo, extraer el máximo rendimiento de una aplicación, siendo tatno fácil de implementar para principiantes como precisa para expertos. Navegue sin contexto, abra dialogs, snackbars y bottomsheets desde cualquier parte de su código, gestione estados e inyecte dependencias de una manera fácil y práctica. GetX es seguro, estable, actualizado y ofrece una amplia gama de APIs que no están presentes en el framework por defecto. 60 +* GetX ahorrará horas de desarrollo y extraerá el máximo rendimiento que su aplicación puede ofrecer, siendo fácil para los principiantes y precisa para los expertos. Navega sin contexto, abre diálogos, snackbars o bottomsheets desde cualquier lugar de tu código, gestiona estados e inyecta dependencias de forma fácil y práctica. Get es seguro, estable, actualizado y ofrece una amplia gama de API que no están presentes en el marco predeterminado.
54 61
55 -- Tiene una multitud de funciones que le permiten comenzar a programar sin preocuparse por nada. Cada una de estas funciones se encuentra en contenedores separados y solo se inicia después de su uso. Si solo usa State Management, solo State Management se compilará. Si solo usa rutas, no se compilará nada de gestión de estado. Puede compilar el repositorio de referencia, y verá que usando solo la gestión de estado de GetX, la aplicación compilada se ha vuelto más pequeña que todas las demás aplicaciones de otros paquetes que solo tienen la gestión de estado, porque nada de lo que no se use se compilará en su código, y cada solución GetX fue diseñada para ser extra liviana. El mérito aquí también proviene del AOT de Flutter, que es increíble y logra eliminar los recursos no utilizados como ningún otro framework lo hace. 62 +- GetX no es bloated. Tiene una multitud de características que le permiten comenzar a programar sin preocuparse por nada, pero cada una de estas características se encuentran en contenedores separados y solo se inician después de su uso. Si solo usa State Management, solo se compilará State Management. Si solo usa rutas, no se compilará nada de la administración estatal. Puede compilar el repositorio de referencia y verá que al usar solo la administración de estado de Get, la aplicación compilada con Get se ha vuelto más pequeña que todas las demás aplicaciones que solo tienen la administración de estado de otros paquetes, porque nada que no se use se compilará en su código, y cada solución GetX fue diseñada para ser muy liviana. El mérito aquí también proviene del movimiento del árbol de Flutter, que es increíble y logra eliminar los recursos no utilizados como ningún otro marco lo hace.
56 63
57 **GetX hace que su desarrollo sea productivo, pero ¿quiere hacerlo aún más productivo? [Agregue la extensión a su VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets)** 64 **GetX hace que su desarrollo sea productivo, pero ¿quiere hacerlo aún más productivo? [Agregue la extensión a su VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets)**
58 65
59 # Como contribuir 66 # Como contribuir
60 67
61 -*¿Quieres contribuir al proyecto? Estaremos orgullosos de destacarte como uno de nuestros colaboradores. Aquí hay algunos puntos en los que puede contribuir y hacer que GetX (y Flutter) sea aún mejor.* 68 +_¿Quieres contribuir al proyecto? Estaremos orgullosos de destacarte como uno de nuestros colaboradores. Aquí hay algunos puntos en los que puede contribuir y hacer que GetX (y Flutter) sea aún mejor._
62 69
63 - Ayudando a traducir el archivo Léame a otros idiomas. 70 - Ayudando a traducir el archivo Léame a otros idiomas.
64 71
@@ -79,15 +86,15 @@ dependencies: @@ -79,15 +86,15 @@ dependencies:
79 get: 86 get:
80 ``` 87 ```
81 88
82 -Import get in files that it will be used: 89 +Importar archivos get que se utilizarán:
83 90
84 ```dart 91 ```dart
85 import 'package:get/get.dart'; 92 import 'package:get/get.dart';
86 ``` 93 ```
87 94
88 -# Proyeto Counter no GetX 95 +# Proyecto Counter no GetX
89 96
90 -Vea una explicación más detallada de la administración del estado [aquí](./docs/es_ES/state_management.md). Allí verá más ejemplos y también la diferencia entre el Gestión del Estado simple y el Gestión del Estado reactivo 97 +Vea una explicación más detallada de la administración del estado [aquí](./documentation/es_ES/state_management.md). Allí verá más ejemplos y también la diferencia entre el Gestión del Estado simple y el Gestión del Estado reactivo
91 98
92 El proyecto "contador" creado por defecto en un nuevo proyecto en Flutter tiene más de 100 líneas (con comentarios). Para mostrar el poder de GetX, demostraré cómo hacer un "contador" cambiando el estado con cada clic, cambiando de página y compartiendo el estado entre pantallas, todo de manera organizada, separando la vista de la lógica de negocio, SOLO 26 LÍNEAS DE CÓDIGO INCLUIDOS COMENTARIOS. 99 El proyecto "contador" creado por defecto en un nuevo proyecto en Flutter tiene más de 100 líneas (con comentarios). Para mostrar el poder de GetX, demostraré cómo hacer un "contador" cambiando el estado con cada clic, cambiando de página y compartiendo el estado entre pantallas, todo de manera organizada, separando la vista de la lógica de negocio, SOLO 26 LÍNEAS DE CÓDIGO INCLUIDOS COMENTARIOS.
93 100
@@ -100,10 +107,10 @@ void main() => runApp(GetMaterialApp(home: Home())); @@ -100,10 +107,10 @@ void main() => runApp(GetMaterialApp(home: Home()));
100 107
101 **Nota**: esto no modifica el MaterialApp del Flutter, GetMaterialApp no es una MaterialApp modificado, es solo un Widget preconfigurado, que tiene como child un MaterialApp por defecto. Puede configurar esto manualmente, pero definitivamente no es necesario. GetMaterialApp creará rutas, las inyectará, inyectará traducciones, inyectará todo lo que necesita para la navegación de rutas. Si usa Get solo para la gestión de estado o dependencias, no es necesario usar GetMaterialApp. GetMaterialApp es necesario para rutas, snackbars, internacionalización, bottomSheets, diálogos y APIs de alto nivel relacionadas con rutas y ausencia de contexto. 108 **Nota**: esto no modifica el MaterialApp del Flutter, GetMaterialApp no es una MaterialApp modificado, es solo un Widget preconfigurado, que tiene como child un MaterialApp por defecto. Puede configurar esto manualmente, pero definitivamente no es necesario. GetMaterialApp creará rutas, las inyectará, inyectará traducciones, inyectará todo lo que necesita para la navegación de rutas. Si usa Get solo para la gestión de estado o dependencias, no es necesario usar GetMaterialApp. GetMaterialApp es necesario para rutas, snackbars, internacionalización, bottomSheets, diálogos y APIs de alto nivel relacionadas con rutas y ausencia de contexto.
102 109
103 -**Note²:** This step in only necessary if you gonna use route management (`Get.to()`, `Get.back()` and so on). If you not gonna use it then it is not necessary to do step 1 110 +**Note²:** Este paso solo es necesario si vas a usar route management (`Get.to()`, `Get.back()` y así). Si no lo va a usar, no es necesario que realice el paso 1
104 111
105 - Paso 2: 112 - Paso 2:
106 -Cree su clase con la lógica de negocio colocando todas las variables, métodos y controladores dentro de ella. Puede hacer que cualquier variable sea observable usando un simple ".obs". 113 + Cree su clase con la lógica de negocio colocando todas las variables, métodos y controladores dentro de ella. Puede hacer que cualquier variable sea observable usando un simple ".obs".
107 114
108 ```dart 115 ```dart
109 class Controller extends GetxController { 116 class Controller extends GetxController {
@@ -113,20 +120,20 @@ class Controller extends GetxController { @@ -113,20 +120,20 @@ class Controller extends GetxController {
113 ``` 120 ```
114 121
115 - Paso 3: 122 - Paso 3:
116 -Cree su vista, use StatelessWidget y ahorre algo de RAM, con GetX ya no necesitará usar StatefulWidget. 123 + Cree su vista, use StatelessWidget y ahorre algo de RAM, con GetX ya no necesitará usar StatefulWidget.
117 124
118 ```dart 125 ```dart
119 class Home extends StatelessWidget { 126 class Home extends StatelessWidget {
120 127
121 - // Instantiate your class using Get.put() to make it available for all "child" routes there. 128 + // Cree una instancia de su clase usando Get.put() para que esté disponible para todas las rutas "secundarias" allí.
122 final Controller c = Get.put(Controller()); 129 final Controller c = Get.put(Controller());
123 130
124 @override 131 @override
125 Widget build(context) => Scaffold( 132 Widget build(context) => Scaffold(
126 - // Use Obx(()=> to update Text() whenever count is changed. 133 + // Utilice Obx(()=> para actualizar Text() siempre que se cambie el recuento.
127 appBar: AppBar(title: Obx(() => Text("Clicks: " + c.count.string))), 134 appBar: AppBar(title: Obx(() => Text("Clicks: " + c.count.string))),
128 135
129 - // Replace the 8 lines Navigator.push by a simple Get.to(). You don't need context 136 + // Reemplace el Navigator.push de 8 líneas por un simple Get.to(). No necesitas contexto
130 body: Center(child: RaisedButton( 137 body: Center(child: RaisedButton(
131 child: Text("Go to Other"), onPressed: () => Get.to(Other()))), 138 child: Text("Go to Other"), onPressed: () => Get.to(Other()))),
132 floatingActionButton: 139 floatingActionButton:
@@ -134,12 +141,12 @@ class Home extends StatelessWidget { @@ -134,12 +141,12 @@ class Home extends StatelessWidget {
134 } 141 }
135 142
136 class Other extends StatelessWidget { 143 class Other extends StatelessWidget {
137 - // You can ask Get to find a Controller that is being used by another page and redirect you to it. 144 + // Puede pedirle a Get que busque un controlador que está siendo utilizado por otra página y le redirija a él.
138 final Controller c = Get.find(); 145 final Controller c = Get.find();
139 146
140 @override 147 @override
141 Widget build(context){ 148 Widget build(context){
142 - // Access the updated count variable 149 + // Acceder a la variable de recuento actualizada
143 return Scaffold(body: Center(child: Text(c.count.string))); 150 return Scaffold(body: Center(child: Text(c.count.string)));
144 } 151 }
145 } 152 }
@@ -188,14 +195,13 @@ Obx(() => Text (controller.name)); @@ -188,14 +195,13 @@ Obx(() => Text (controller.name));
188 195
189 ### Más detalles sobre la gestión del estado. 196 ### Más detalles sobre la gestión del estado.
190 197
191 -**Vea una explicación más detallada de la administración del estado [aquí](./docs/es_ES/state_management.md). Allí verá más ejemplos y también la diferencia entre el Gestión del Estado simple y el Gestión del Estado reactivo**  
192 -  
193 -### Video explanation about state management 198 +**Vea una explicación más detallada de la administración del estado [aquí](./documentation/es_ES/state_management.md). Allí verá más ejemplos y también la diferencia entre el Gestión del Estado simple y el Gestión del Estado reactivo**
194 199
  200 +### Explicación en video sobre state management
195 201
196 -Amateur Coder did an awesome video about state management! Link: [Complete GetX State Management](https://www.youtube.com/watch?v=CNpXbeI_slw) 202 +Darwin Morocho hizo una increíble serie de videos sobre state management! Link: [Complete GetX State Management](https://www.youtube.com/watch?v=PTjj0DFK8BA&list=PLV0nOzdUS5XtParoZLgKoVwNSK9zROwuO)
197 203
198 -You will get a good idea of GetX power. 204 +Obtendrá una buena idea de la potencia de GetX.
199 205
200 ## Gestión de Rutas 206 ## Gestión de Rutas
201 207
@@ -231,11 +237,11 @@ var data = await Get.to(Payment()); @@ -231,11 +237,11 @@ var data = await Get.to(Payment());
231 237
232 ### Más detalles sobre la gestión de rutas. 238 ### Más detalles sobre la gestión de rutas.
233 239
234 -**Vea una explicación más detallada de la Gestión de Rutas [aquí](./docs/es_ES/route_management.md).** 240 +**Vea una explicación más detallada de la Gestión de Rutas [aquí](./documentation/es_ES/route_management.md).**
235 241
236 -### Video Explanation 242 +### Explicación del video
237 243
238 -Amateur Coder did an excellent video that cover route management with Get! here is the link: [Complete Getx Navigation](https://www.youtube.com/watch?v=RaqPIoJSTtI) 244 +Amateur Coder hizo un excelente video que cubre route management con Get! aquí esta el link: [Complete Getx Navigation](https://www.youtube.com/watch?v=RaqPIoJSTtI)
239 245
240 ## Gestión de dependencias 246 ## Gestión de dependencias
241 247
@@ -253,11 +259,11 @@ En lugar de crear una instancia de su clase dentro de la clase que está utiliza @@ -253,11 +259,11 @@ En lugar de crear una instancia de su clase dentro de la clase que está utiliza
253 controller.fetchApi(); 259 controller.fetchApi();
254 ``` 260 ```
255 261
256 -Imagine que ha navegado a través de numerosas rutas y necesita datos que quedaron en su controlador, necesitaría un gestor de estado combinado con Providere o Get_it, ¿correcto? No con GetX. Solo necesita pedirle a GetX que "encuentre" su controlador, no necesita dependencias adicionales: 262 +Imagine que ha navegado a través de numerosas rutas y necesita datos que quedaron en su controlador, necesitaría un gestor de estado combinado con Provider o Get_it, ¿correcto? No con GetX. Solo necesita pedirle a GetX que "encuentre" su controlador, no necesita dependencias adicionales:
257 263
258 ```dart 264 ```dart
259 Controller controller = Get.find(); 265 Controller controller = Get.find();
260 -//Yes, it looks like Magic, Get will find your controller, and will deliver it to you. You can have 1 million controllers instantiated, Get will always give you the right controller. 266 +//Sí, parece que es magia, Get encontrará su controlador y se lo entregará. Puede tener 1 millón de controladores instanciados, Get siempre le dará el controlador correcto.
261 ``` 267 ```
262 268
263 Y luego podrá recuperar los datos de su controlador que se obtuvieron allí: 269 Y luego podrá recuperar los datos de su controlador que se obtuvieron allí:
@@ -270,20 +276,20 @@ Text(controller.textFromApi); @@ -270,20 +276,20 @@ Text(controller.textFromApi);
270 276
271 ```dart 277 ```dart
272 Get.lazyPut<Service>(()=> ApiMock()); 278 Get.lazyPut<Service>(()=> ApiMock());
273 -/// ApiMock will only be called when someone uses Get.find<Service> for the first time 279 +/// ApiMock solo se llamará cuando alguien use Get.find<Service> por primera vez
274 ``` 280 ```
275 281
276 ### Más detalles sobre la gestión de dependencias. 282 ### Más detalles sobre la gestión de dependencias.
277 283
278 -**Vea una explicación más detallada de la Gestión de dependencias [aquí](./docs/es_ES/dependency_management.md).** 284 +**Vea una explicación más detallada de la Gestión de dependencias [aquí](./documentation/es_ES/dependency_management.md).**
279 285
280 -# Utils 286 +# Utilidades
281 287
282 ## Cambiar de tema 288 ## Cambiar de tema
283 289
284 No utilice ningún widget de nivel superior que GetMaterialApp para actualizarlo. Esto puede activar claves duplicadas. Mucha gente está acostumbrada al enfoque prehistórico de crear un widget "ThemeProvider" solo para cambiar el tema de su aplicación, y esto definitivamente NO es necesario con GetX. 290 No utilice ningún widget de nivel superior que GetMaterialApp para actualizarlo. Esto puede activar claves duplicadas. Mucha gente está acostumbrada al enfoque prehistórico de crear un widget "ThemeProvider" solo para cambiar el tema de su aplicación, y esto definitivamente NO es necesario con GetX.
285 291
286 -Puede crear su tema personalizado y simplemente agregarlo dentro de Get.changeTheme sin ningun boilerplate para eso: 292 +Puede crear su tema personalizado y simplemente agregarlo dentro de Get.changeTheme sin ningún boilerplate para eso:
287 293
288 ```dart 294 ```dart
289 Get.changeTheme(ThemeData.light()); 295 Get.changeTheme(ThemeData.light());
@@ -322,116 +328,116 @@ MaterialApp( @@ -322,116 +328,116 @@ MaterialApp(
322 ``` 328 ```
323 329
324 ```dart 330 ```dart
325 -// give the current args from currentScreen 331 +// dar los argumentos actuales de currentScreen
326 Get.arguments 332 Get.arguments
327 333
328 -// give arguments of previous route 334 +// dar argumentos de la ruta anterior
329 Get.previousArguments 335 Get.previousArguments
330 336
331 -// give name of previous route 337 +// dar el nombre de la ruta anterior
332 Get.previousRoute 338 Get.previousRoute
333 339
334 -// give the raw route to access for example, rawRoute.isFirst() 340 +// dar la ruta sin procesar para acceder, por ejemplo, rawRoute.isFirst()
335 Get.rawRoute 341 Get.rawRoute
336 342
337 -// give access to Rounting API from GetObserver 343 +// dar acceso a Routing API desde GetObserver
338 Get.routing 344 Get.routing
339 345
340 -// check if snackbar is open 346 +// comprobar si la cafetería está abierta
341 Get.isSnackbarOpen 347 Get.isSnackbarOpen
342 348
343 -// check if dialog is open 349 +// comprobar si el diálogo está abierto
344 Get.isDialogOpen 350 Get.isDialogOpen
345 351
346 -// check if bottomsheet is open 352 +// comprobar si bottomsheet está abierto
347 Get.isBottomSheetOpen 353 Get.isBottomSheetOpen
348 354
349 -// remove one route. 355 +// eliminar una ruta.
350 Get.removeRoute() 356 Get.removeRoute()
351 357
352 -// back repeatedly until the predicate returns true. 358 +// volver repetidamente hasta que predicate devuelva verdadero.
353 Get.until() 359 Get.until()
354 360
355 -// go to next route and remove all the previous routes until the predicate returns true. 361 +//ir a la siguiente ruta y eliminar todas las rutas anteriores hasta que predicate devuelva verdadero.
356 Get.offUntil() 362 Get.offUntil()
357 363
358 -// go to next named route and remove all the previous routes until the predicate returns true. 364 +// ir a la siguiente ruta con nombre y eliminar todas las rutas anteriores hasta que predicate devuelve verdadero.
359 Get.offNamedUntil() 365 Get.offNamedUntil()
360 366
361 -//Check in what platform the app is running 367 +//Verifique en qué plataforma se ejecuta la aplicación
362 GetPlatform.isAndroid 368 GetPlatform.isAndroid
363 GetPlatform.isIOS 369 GetPlatform.isIOS
364 GetPlatform.isWeb 370 GetPlatform.isWeb
365 371
366 -// Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. 372 +// Equivalente al método: MediaQuery.of(context).size.height, pero son inmutables.
367 Get.height 373 Get.height
368 Get.width 374 Get.width
369 375
370 -// Gives the context of the screen in the foreground anywhere in your code. 376 +// Da el contexto de la pantalla en primer plano en cualquier parte de su código.
371 Get.context 377 Get.context
372 378
373 -// Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. 379 +// Da el contexto de la barra de bocadillos / diálogo / hoja inferior en primer plano en cualquier parte de su código.
374 Get.contextOverlay 380 Get.contextOverlay
375 381
376 -// Note: the following methods are extensions on context. Since you  
377 -// have access to context in any place of your UI, you can use it anywhere in the UI code 382 +// Note: los siguientes métodos son extensiones de context. Desde que tu
  383 +// tiene acceso al contexto en cualquier lugar de su interfaz de usuario, puede usarlo en cualquier lugar del código de la interfaz de usuario
378 384
379 -// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. 385 +// Si necesita un cambiable height/width (como las ventanas del navegador que se pueden escalar) necesitará usar context.
380 context.width 386 context.width
381 context.height 387 context.height
382 388
383 389
384 390
385 -// gives you the power to define half the screen now, a third of it and so on.  
386 -//Useful for responsive applications. 391 +// le da el poder de definir la mitad de la pantalla ahora, un tercio y así sucesivamente.
  392 +// Útil para aplicaciones receptivas.
387 // param dividedBy (double) optional - default: 1 393 // param dividedBy (double) optional - default: 1
388 // param reducedBy (double) optional - default: 0 394 // param reducedBy (double) optional - default: 0
389 context.heightTransformer() 395 context.heightTransformer()
390 context.widthTransformer() 396 context.widthTransformer()
391 397
392 -/// similar to MediaQuery.of(context).size 398 +/// Similar a MediaQuery.of(context).size
393 context.mediaQuerySize() 399 context.mediaQuerySize()
394 400
395 -/// similar to MediaQuery.of(context).padding 401 +/// similar a MediaQuery.of(context).padding
396 context.mediaQueryPadding() 402 context.mediaQueryPadding()
397 403
398 -/// similar to MediaQuery.of(context).viewPadding 404 +/// similar a MediaQuery.of(context).viewPadding
399 context.mediaQueryViewPadding() 405 context.mediaQueryViewPadding()
400 406
401 -/// similar to MediaQuery.of(context).viewInsets; 407 +/// similar a MediaQuery.of(context).viewInsets;
402 context.mediaQueryViewInsets() 408 context.mediaQueryViewInsets()
403 409
404 -/// similar to MediaQuery.of(context).orientation; 410 +/// similar a MediaQuery.of(context).orientation;
405 context.orientation() 411 context.orientation()
406 412
407 -/// check if device is on landscape mode 413 +/// comprobar si el dispositivo esta en landscape mode
408 context.isLandscape() 414 context.isLandscape()
409 415
410 -/// check if device is on portrait mode 416 +/// comprobar si el dispositivo esta en portrait mode
411 context.isPortrait() 417 context.isPortrait()
412 418
413 -/// similar to MediaQuery.of(context).devicePixelRatio; 419 +/// similar a MediaQuery.of(context).devicePixelRatio;
414 context.devicePixelRatio() 420 context.devicePixelRatio()
415 421
416 -/// similar to MediaQuery.of(context).textScaleFactor; 422 +/// similar a MediaQuery.of(context).textScaleFactor;
417 context.textScaleFactor() 423 context.textScaleFactor()
418 424
419 -/// get the shortestSide from screen 425 +/// obtener el lado más corto de la pantalla
420 context.mediaQueryShortestSide() 426 context.mediaQueryShortestSide()
421 427
422 -/// True if width be larger than 800 428 +/// Verdadero si el ancho es mayor que 800
423 context.showNavbar() 429 context.showNavbar()
424 430
425 -/// True if the shortestSide is smaller than 600p 431 +/// Verdadero si el lado más corto es menor que 600p
426 context.isPhone() 432 context.isPhone()
427 433
428 -/// True if the shortestSide is largest than 600p 434 +/// Verdadero si el lado más corto es más grande que 600p
429 context.isSmallTablet() 435 context.isSmallTablet()
430 436
431 -/// True if the shortestSide is largest than 720p 437 +/// Verdadero si el lado más corto es mayor que 720p
432 context.isLargeTablet() 438 context.isLargeTablet()
433 439
434 -/// True if the current device is Tablet 440 +/// Verdadero si el dispositivo actual es una tableta
435 context.isTablet() 441 context.isTablet()
436 ``` 442 ```
437 443
@@ -456,10 +462,26 @@ Get.config( @@ -456,10 +462,26 @@ Get.config(
456 ) 462 )
457 ``` 463 ```
458 464
459 -## Video explanation of Other GetX Features 465 +Opcionalmente, puede redirigir todos los mensajes de registro de Get. Si desea utilizar su propio paquete de registro favorito y desea capturar los registros allí.
460 466
  467 +```dart
  468 +GetMaterialApp(
  469 + enableLog: true,
  470 + logWriterCallback: localLogWriter,
  471 +);
  472 +
  473 +void localLogWriter(String text, {bool isError = false}) {
  474 + // pase el mensaje a su paquete de registro favorito aquí
  475 + //Nota: incluso si los mensajes de registro están desactivados
  476 + // con el comando "enableLog: false", los mensajes seguirán pasando por aquí
  477 + // Debe verificar esta configuración manualmente aquí si desea respetarla
  478 +}
  479 +
  480 +```
  481 +
  482 +## Video explanation of Other GetX Features
461 483
462 -Amateur Coder did an awesome video about utils, storage, bindings and other features! Link: [GetX Other Features](https://youtu.be/ttQtlX_Q0eU) 484 +Amateur Coder hizo un video asombroso sobre utilidades, almacenamiento, enlaces y otras características! Link: [GetX Other Features](https://youtu.be/ttQtlX_Q0eU)
463 485
464 # Rompiendo cambios desde 2.0 486 # Rompiendo cambios desde 2.0
465 487
@@ -469,7 +491,7 @@ Antes: StringX ahora: RxString @@ -469,7 +491,7 @@ Antes: StringX ahora: RxString
469 491
470 Antes: IntX ahora: RxInt 492 Antes: IntX ahora: RxInt
471 493
472 -Antes: MapX ahora: RxMax 494 +Antes: MapX ahora: RxMap
473 495
474 Antes: ListX ahora: RxList 496 Antes: ListX ahora: RxList
475 497
@@ -496,7 +518,7 @@ Ahora: @@ -496,7 +518,7 @@ Ahora:
496 ```dart 518 ```dart
497 GetMaterialApp( 519 GetMaterialApp(
498 getPages: [ 520 getPages: [
499 - GetPage(name: '/', page:()=> Home()), 521 + GetPage(name: '/', page: () => Home()),
500 ] 522 ]
501 ) 523 )
502 ``` 524 ```
@@ -512,7 +534,7 @@ GetStorage box = GetStorage(); @@ -512,7 +534,7 @@ GetStorage box = GetStorage();
512 534
513 GetMaterialApp( 535 GetMaterialApp(
514 getPages: [ 536 getPages: [
515 - GetPage(name: '/', page:(){ 537 + GetPage(name: '/', page:(){
516 return box.hasData('token') ? Home() : Login(); 538 return box.hasData('token') ? Home() : Login();
517 }) 539 })
518 ] 540 ]
@@ -521,13 +543,13 @@ GetMaterialApp( @@ -521,13 +543,13 @@ GetMaterialApp(
521 543
522 # ¿Por qué Getx? 544 # ¿Por qué Getx?
523 545
524 -1- Después de una actualización de Flutter, muchos paquetes suelen romperse. A veces se producen errores de compilación, errores de los que aún no hay respuestas y el desarrollador necesita saber el origen del error, poder rastrearlo, y solo entonces intentar abrir un issue en el repositorio correspondiente, para finalmente ver su problema resuelto. Getx centraliza los principales recursos para el desarrollo (gestión de estado, dependencia y rutas), lo que le permite agregar un único paquete a su pubspec y comenzar a trabajar. Después de una actualización de Flutter, lo único que debe hacer es actualizar la dependencia Get y ponerse a trabajar. Get también resuelve problemas de compatibilidad. ¿Cuántas veces una versión de un paquete no es compatible con la versión de otro, porque una usa una dependencia en una versión y la otra en otra? Tampoco es una preocupación usando Get, ya que todo estará en el mismo paquete y será totalmente compatible. 546 +1- Después de una actualización de Flutter, muchos paquetes suelen romperse. A veces se producen errores de compilación, errores de los que aún no hay respuestas y el desarrollador necesita saber el origen del error, poder rastrear, y solo entonces intentar abrir un issue en el repositorio correspondiente, para finalmente ver su problema resuelto. Getx centraliza los principales recursos para el desarrollo (gestión de estado, dependencia y rutas), lo que le permite agregar un único paquete a su pubspec y comenzar a trabajar. Después de una actualización de Flutter, lo único que debe hacer es actualizar la dependencia Get y ponerse a trabajar. Get también resuelve problemas de compatibilidad. ¿Cuántas veces una versión de un paquete no es compatible con la versión de otro, porque una usa una dependencia en una versión y la otra en otra? Tampoco es una preocupación usando Get, ya que todo estará en el mismo paquete y será totalmente compatible.
525 547
526 -2- Flutter es fácil, Flutter es increíble, pero todavía tiene algo repetitivo que puede ser no deseado para la mayoría de los desarrolladores, como `Navigator.of(context).push (context, bulder [...]`. Get simplifica el desarrollo. En lugar de escribir 8 líneas de código para simplemente llamar a una ruta, simplemente puede hacerlo: `Get.to(Home())` y listo, irá a la página siguiente. Algo doloroso de hacer con Flutter actualmente, mientras que con GetX es estúpidamente simple. Gestionar estados en Flutter y dependencias también es algo que genera mucho debate, ya que hay cientos de patrones en el pub. Pero no hay nada tan fácil como agregar un ".obs" al final de su variable, y colocar su widget dentro de un Obx, y eso es todo, todas las actualizaciones de esa variable se actualizarán automáticamente en la pantalla. 548 +2- Flutter es fácil, Flutter es increíble, pero todavía tiene algo repetitivo que puede ser no deseado para la mayoría de los desarrolladores, como `Navigator.of(context).push (context, builder [...]`. Get simplifica el desarrollo. En lugar de escribir 8 líneas de código para simplemente llamar a una ruta, simplemente puede hacerlo: `Get.to(Home())` y listo, irá a la página siguiente. Algo doloroso de hacer con Flutter actualmente, mientras que con GetX es estúpidamente simple. Gestionar estados en Flutter y dependencias también es algo que genera mucho debate, ya que hay cientos de patrones en el pub. Pero no hay nada tan fácil como agregar un ".obs" al final de su variable, y colocar su widget dentro de un Obx, y eso es todo, todas las actualizaciones de esa variable se actualizarán automáticamente en la pantalla.
527 549
528 3- Facilidad sin preocuparse por el rendimiento. El rendimiento de Flutter ya es sorprendente, pero imagine que usa un gestor de estado y un localizador para distribuir sus clases de bloc/stores/controllers/ etc. Tendrá que llamar manualmente a la exclusión de esa dependencia cuando no la necesite. Pero, ¿alguna vez pensó en simplemente usar el controlador, y cuando ya no sea necesario, simplemente se elimine de la memoria? Eso es lo que hace GetX. Con SmartManagement, todo lo que no se está utilizando se elimina de la memoria, y no debería tener que preocuparse por nada más que la programación. Se le garantiza el consumo mínimo de recursos, sin siquiera haber creado una lógica para esto. 550 3- Facilidad sin preocuparse por el rendimiento. El rendimiento de Flutter ya es sorprendente, pero imagine que usa un gestor de estado y un localizador para distribuir sus clases de bloc/stores/controllers/ etc. Tendrá que llamar manualmente a la exclusión de esa dependencia cuando no la necesite. Pero, ¿alguna vez pensó en simplemente usar el controlador, y cuando ya no sea necesario, simplemente se elimine de la memoria? Eso es lo que hace GetX. Con SmartManagement, todo lo que no se está utilizando se elimina de la memoria, y no debería tener que preocuparse por nada más que la programación. Se le garantiza el consumo mínimo de recursos, sin siquiera haber creado una lógica para esto.
529 551
530 -4- Desacoplamiento real. Es posible que haya escuchado la idea de "separar la vista de la lógica de negocio". Esta no es una peculiaridad de BLoC,MVC,MVVM, cualquier otro estándar en el mercado tiene este concepto. Sin embargo, a menudo se puede mitigar en Flutter debido al uso del contexto. 552 +4- Desacoplamiento real. Es posible que haya escuchado la idea de "separar la vista de la lógica de negocio". Esta no es una peculiaridad de BLoC, MVC, MVVM, cualquier otro estándar en el mercado tiene este concepto. Sin embargo, a menudo se puede mitigar en Flutter debido al uso del contexto.
531 Si necesita contexto para encontrar un InheritedWidget, lo necesita en la vista o pasado por parámetro. En particular, encuentro esta solución muy fea, y para trabajar en equipo siempre tendremos una dependencia de la lógica de negocios de la vista. Getx no es ortodoxo con el enfoque estándar, y aunque no prohíbe completamente el uso de StatefulWidgets, InitState, etc., siempre tiene un enfoque similar que puede ser más limpio. Los controladores tienen ciclos de vida, y cuando necesita hacer una solicitud API REST, por ejemplo, no depende de nada en la vista. Puede usar onInit para iniciar la llamada http, y cuando lleguen los datos, se rellenarán las variables. Como GetX es completamente reactivo (realmente, y funciona bajo streams), una vez que se llenan los elementos, todos los widgets que usan esa variable se actualizarán automáticamente en la vista. Esto permite que las personas con experiencia en IU trabajen solo con widgets y no tengan que enviar nada a la lógica de negocios que no sean eventos de usuario (como hacer clic en un botón), mientras que las personas que trabajan con lógica de negocios podrán crearla y probarla por separado. 553 Si necesita contexto para encontrar un InheritedWidget, lo necesita en la vista o pasado por parámetro. En particular, encuentro esta solución muy fea, y para trabajar en equipo siempre tendremos una dependencia de la lógica de negocios de la vista. Getx no es ortodoxo con el enfoque estándar, y aunque no prohíbe completamente el uso de StatefulWidgets, InitState, etc., siempre tiene un enfoque similar que puede ser más limpio. Los controladores tienen ciclos de vida, y cuando necesita hacer una solicitud API REST, por ejemplo, no depende de nada en la vista. Puede usar onInit para iniciar la llamada http, y cuando lleguen los datos, se rellenarán las variables. Como GetX es completamente reactivo (realmente, y funciona bajo streams), una vez que se llenan los elementos, todos los widgets que usan esa variable se actualizarán automáticamente en la vista. Esto permite que las personas con experiencia en IU trabajen solo con widgets y no tengan que enviar nada a la lógica de negocios que no sean eventos de usuario (como hacer clic en un botón), mientras que las personas que trabajan con lógica de negocios podrán crearla y probarla por separado.
532 554
533 Esta librería siempre se actualizará e implementará nuevas características. Siéntase libre de ofrecer PRs y contribuir a ellas. 555 Esta librería siempre se actualizará e implementará nuevas características. Siéntase libre de ofrecer PRs y contribuir a ellas.
@@ -4,7 +4,10 @@ @@ -4,7 +4,10 @@
4 4
5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get) 5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get)
6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg) 6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg)
7 -[![Gitter](https://badges.gitter.im/flutter_get/community.svg)](https://gitter.im/flutter_get/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 7 +[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart)
  8 +[![Discord Shield](https://img.shields.io/discord/722900883784073290.svg?logo=discord)](https://discord.com/invite/9Hpt99N)
  9 +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://communityinviter.com/apps/getxworkspace/getx)
  10 +[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
8 <a href="https://github.com/Solido/awesome-flutter"> 11 <a href="https://github.com/Solido/awesome-flutter">
9 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" /> 12 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" />
10 </a> 13 </a>
@@ -12,7 +15,6 @@ @@ -12,7 +15,6 @@
12 15
13 ![](getx.png) 16 ![](getx.png)
14 17
15 -- [Communication and support channels:](#communication-and-support-channels)  
16 - [About Get](#about-get) 18 - [About Get](#about-get)
17 - [Installing](#installing) 19 - [Installing](#installing)
18 - [Counter App with GetX](#counter-app-with-getx) 20 - [Counter App with GetX](#counter-app-with-getx)
@@ -28,39 +30,39 @@ @@ -28,39 +30,39 @@
28 - [More details about dependency management](#more-details-about-dependency-management) 30 - [More details about dependency management](#more-details-about-dependency-management)
29 - [How to contribute](#how-to-contribute) 31 - [How to contribute](#how-to-contribute)
30 - [Utils](#utils) 32 - [Utils](#utils)
  33 + - [Internationalization](#internationalization)
31 - [Change Theme](#change-theme) 34 - [Change Theme](#change-theme)
32 - [Other Advanced APIs](#other-advanced-apis) 35 - [Other Advanced APIs](#other-advanced-apis)
33 - [Optional Global Settings and Manual configurations](#optional-global-settings-and-manual-configurations) 36 - [Optional Global Settings and Manual configurations](#optional-global-settings-and-manual-configurations)
34 - - [Video explanation of Other GetX Features](#video-explanation-of-other-getx-features) 37 + - [Video explanation of Other GetX Features](#video-explanation-of-other-getx-features)
35 - [Breaking changes from 2.0](#breaking-changes-from-20) 38 - [Breaking changes from 2.0](#breaking-changes-from-20)
36 - [Why Getx?](#why-getx) 39 - [Why Getx?](#why-getx)
37 40
38 41
39 -# Communication and support channels:  
40 -  
41 -[**Slack (English)**](https://communityinviter.com/apps/getxworkspace/getx)  
42 -  
43 -[**Discord (English and Portuguese)**](https://discord.com/invite/9Hpt99N)  
44 -  
45 -[**Telegram (Portuguese)**](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)  
46 -  
47 # About Get 42 # About Get
48 43
49 - GetX is an extra-light and powerful solution for Flutter. It combines high performance state management, intelligent dependency injection, and route management in a quick and practical way. 44 - GetX is an extra-light and powerful solution for Flutter. It combines high performance state management, intelligent dependency injection, and route management in a quick and practical way.
50 45
51 -  
52 - GetX has 3 basic principles, this means that this is the priority for all resources in the library 46 - GetX has 3 basic principles, this means that this is the priority for all resources in the library
53 -**PERFORMANCE:** GetX is focused on performance and minimum consumption of resources. Benchmarks are almost always not important in the real world, but if you want, there is a consumption indicator here([benchmarks](https://github.com/jonataslaw/benchmarks)), where GetX does better than other state management approaches, for example. The difference is not large, but it shows our concern not to waste its resources.  
54 -**PRODUCTIVITY:** GetX uses an easy and pleasant syntax.  
55 -**ORGANIZATION:** GetX allows total decoupling of the View from the business logic. 47 + - **PERFORMANCE:** GetX is focused on performance and minimum consumption of resources. Benchmarks are almost always not important in the real world, but if you want, there is a consumption indicator here([benchmarks](https://github.com/jonataslaw/benchmarks)), where GetX does better than other state management approaches, for example. The difference is not large, but it shows our concern not to waste its resources.
  48 + - **PRODUCTIVITY:** GetX uses an easy and pleasant syntax. No matter what you want to do, there is always an easier way with Getx. It will save hours of development, and will extract the maximum performance that your application can deliver
  49 + - **ORGANIZATION:** GetX allows the total decoupling of the View, presentation logic, business logic, dependency injection, and navigation. You do not need context to navigate between routes, so you are not dependent on the widget tree (visualization) for this. You don't need context to access your controllers / blocks through an inheritedWidget, so you completely decouple your presentation logic and business logic from your visualization layer. You do not need to inject your Controllers/Models/Blocs classes into your widget tree through multiproviders, for this GetX uses its own dependency injection feature, decoupling the DI from its view completely.
  50 + With GetX you know where to find each feature of your application, having clean code by default. This in addition to facilitating maintenance, makes the sharing of modules, something that until then in Flutter was unthinkable, something totally possible.
  51 + BLoC was a starting point for organizing code in Flutter, it separates business logic from visualization. Getx is a natural evolution of this, not only separating the business logic, but the presentation logic. Bonus injection of dependencies and routes are also decoupled, and the data layer is out of it all. You know where everything is, and all of this in an easier way than building a hello world.
  52 + GetX is the easiest, most practical and scalable way to build high-performance applications with the Flutter SDK, with a large ecosystem around it that works perfectly together, being easy for beginners, and accurate for experts. It is secure, stable, up-to-date, and offers a huge range of APIs build-in that are not present on default Flutter SDK.
  53 +
56 54
  55 +- GetX is not a bloated. It has a multitude of features that allow you to start programming without worrying about anything, but each of these features are in separate containers, and are only started after use. If you only use State Management, only State Management will be compiled. If you only use routes, nothing from the state management will be compiled. You can compile the benchmark repository, and you will see that using only Get state management, the application compiled with Get has become smaller than all other applications that have only the state management of other packages, because nothing that is not used will be compiled into your code, and each GetX solution was designed to be extra lightweight. The merit here also comes from Flutter's tree shaking which is incredible, and manages to eliminate unused resources like no other framework does.
57 56
58 -- GetX will save hours of development, and will extract the maximum performance that your application can deliver, being easy for beginners, and accurate for experts. Navigate without context, open dialogs, snackbars or bottomsheets from anywhere in your code, Manage states and inject dependencies in an easy and practical way. Get is secure, stable, up-to-date, and offers a huge range of APIs that are not present on default framework. 57 +**GetX has an [extension to VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) to make your programming with GetX even more productive**
59 58
  59 +**GetX Community channels:**
60 60
61 -- GetX is not a bloated. It has a multitude of features that allow you to start programming without worrying about anything, but each of these features are in separate containers, and are only started after use. If you only use State Management, only State Management will be compiled. If you only use routes, nothing from the state management will be compiled. You can compile the benchmark repository, and you will see that using only Get state management, the application compiled with Get has become smaller than all other applications that have only the state management of other packages, because nothing that is not used will be compiled into your code, and each GetX solution was designed to be extra lightweight. The merit here also comes from Flutter's tree shaking which is incredible, and manages to eliminate unused resources like no other framework does. 61 +GetX has a highly active and helpful community. If you have questions, or would like any assistance regarding the use of this framework, please join our community channels, your question will be answered more quickly, and it will be the most suitable place. This repository is exclusive for opening issues, and requesting resources, but feel free to be part of GetX Community.
62 62
63 -**GetX makes your development productive, but want to make it even more productive? Add the extension [GetX extension to VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) to your VSCode** 63 +| **Slack** | **Discord** | **Telegram** |
  64 +| --------- | ------------| ------------ |
  65 +| [![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://communityinviter.com/apps/getxworkspace/getx) | [![Discord Shield](https://img.shields.io/discord/722900883784073290.svg?logo=discord)](https://discord.com/invite/9Hpt99N) | [![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g) |
64 66
65 # Installing 67 # Installing
66 68
@@ -81,7 +83,7 @@ import 'package:get/get.dart'; @@ -81,7 +83,7 @@ import 'package:get/get.dart';
81 The "counter" project created by default on new project on Flutter has over 100 lines (with comments). To show the power of Get, I will demonstrate how to make a "counter" changing the state with each click, switching between pages and sharing the state between screens, all in an organized way, separating the business logic from the view, in ONLY 26 LINES CODE INCLUDING COMMENTS. 83 The "counter" project created by default on new project on Flutter has over 100 lines (with comments). To show the power of Get, I will demonstrate how to make a "counter" changing the state with each click, switching between pages and sharing the state between screens, all in an organized way, separating the business logic from the view, in ONLY 26 LINES CODE INCLUDING COMMENTS.
82 84
83 - Step 1: 85 - Step 1:
84 -Add "Get" before your materialApp, turning it into GetMaterialApp 86 +Add "Get" before your MaterialApp, turning it into GetMaterialApp
85 87
86 ```dart 88 ```dart
87 void main() => runApp(GetMaterialApp(home: Home())); 89 void main() => runApp(GetMaterialApp(home: Home()));
@@ -97,7 +99,7 @@ You can make any variable observable using a simple ".obs". @@ -97,7 +99,7 @@ You can make any variable observable using a simple ".obs".
97 ```dart 99 ```dart
98 class Controller extends GetxController{ 100 class Controller extends GetxController{
99 var count = 0.obs; 101 var count = 0.obs;
100 - increment() => count.value++; 102 + increment() => count+1;
101 } 103 }
102 ``` 104 ```
103 105
@@ -113,7 +115,7 @@ class Home extends StatelessWidget { @@ -113,7 +115,7 @@ class Home extends StatelessWidget {
113 @override 115 @override
114 Widget build(context) => Scaffold( 116 Widget build(context) => Scaffold(
115 // Use Obx(()=> to update Text() whenever count is changed. 117 // Use Obx(()=> to update Text() whenever count is changed.
116 - appBar: AppBar(title: Obx(() => Text("Clicks: " + c.count.string))), 118 + appBar: AppBar(title: Obx(() => Text("Clicks: ${c.count}"))),
117 119
118 // Replace the 8 lines Navigator.push by a simple Get.to(). You don't need context 120 // Replace the 8 lines Navigator.push by a simple Get.to(). You don't need context
119 body: Center(child: RaisedButton( 121 body: Center(child: RaisedButton(
@@ -129,7 +131,7 @@ class Other extends StatelessWidget { @@ -129,7 +131,7 @@ class Other extends StatelessWidget {
129 @override 131 @override
130 Widget build(context){ 132 Widget build(context){
131 // Access the updated count variable 133 // Access the updated count variable
132 - return Scaffold(body: Center(child: Text(c.count.string))); 134 + return Scaffold(body: Center(child: Text("${c.count}")));
133 } 135 }
134 } 136 }
135 ``` 137 ```
@@ -184,14 +186,14 @@ var name = 'Jonatas Borges'.obs; @@ -184,14 +186,14 @@ var name = 'Jonatas Borges'.obs;
184 And in the UI, when you want to show that value and update the screen whenever tha values changes, simply do this: 186 And in the UI, when you want to show that value and update the screen whenever tha values changes, simply do this:
185 187
186 ```dart 188 ```dart
187 -Obx (() => Text (controller.name)); 189 +Obx(() => Text("${controller.name}"));
188 ``` 190 ```
189 191
190 That's all. It's *that* simple. 192 That's all. It's *that* simple.
191 193
192 ### More details about state management 194 ### More details about state management
193 195
194 -**See an more in-depth explanation of state management [here](./docs/en_US/state_management.md). There you will see more examples and also the difference between the simple stage manager and the reactive state manager** 196 +**See an more in-depth explanation of state management [here](./documentation/en_US/state_management.md). There you will see more examples and also the difference between the simple stage manager and the reactive state manager**
195 197
196 ### Video explanation about state management 198 ### Video explanation about state management
197 199
@@ -240,7 +242,7 @@ Noticed that you didn't had to use context to do any of these things? That's one @@ -240,7 +242,7 @@ Noticed that you didn't had to use context to do any of these things? That's one
240 242
241 ### More details about route management 243 ### More details about route management
242 244
243 -**Get work with named routes and also offer a lower level control over your routes! There is a in-depth documentation [here](./docs/en_US/route_management.md)** 245 +**Get work with named routes and also offer a lower level control over your routes! There is a in-depth documentation [here](./documentation/en_US/route_management.md)**
244 246
245 ### Video Explanation 247 ### Video Explanation
246 248
@@ -281,7 +283,7 @@ Text(controller.textFromApi); @@ -281,7 +283,7 @@ Text(controller.textFromApi);
281 283
282 ### More details about dependency management 284 ### More details about dependency management
283 285
284 -**See a more in-depth explanation of dependency management [here](./docs/en_US/dependency_management.md)** 286 +**See a more in-depth explanation of dependency management [here](./documentation/en_US/dependency_management.md)**
285 287
286 # How to contribute 288 # How to contribute
287 289
@@ -296,26 +298,82 @@ Text(controller.textFromApi); @@ -296,26 +298,82 @@ Text(controller.textFromApi);
296 Any contribution is welcome! 298 Any contribution is welcome!
297 299
298 # Utils 300 # Utils
  301 +## Internationalization
  302 +### Translations
  303 +Translations are kept as a simple key-value dictionary map.
  304 +To add custom translations, create a class and extend `Translations`.
  305 +```dart
  306 +import 'package:get/get.dart';
  307 +
  308 +class Messages extends Translations {
  309 + @override
  310 + Map<String, Map<String, String>> get keys => {
  311 + 'en_US': {
  312 + 'hello': 'Hello World',
  313 + },
  314 + 'de_DE': {
  315 + 'hello': 'Hallo Welt',
  316 + }
  317 + };
  318 +}
  319 +```
  320 +
  321 +#### Using translations
  322 +Just append `.tr` to the specified key and it will be translated, using the current value of `Get.locale` and `Get.fallbackLocale`.
  323 +```dart
  324 +Text('title'.tr);
  325 +```
  326 +
  327 +### Locales
  328 +Pass parameters to `GetMaterialApp` to define the locale and translations.
  329 +
  330 +```dart
  331 +return GetMaterialApp(
  332 + translations: Messages(), // your translations
  333 + locale: Locale('en', 'US'), // translations will be displayed in that locale
  334 + fallbackLocale: Locale('en', 'UK'), // specify the fallback locale in case an invalid locale is selected.
  335 + supportedLocales: <Locale>[Locale('en', 'UK'), Locale('en', 'US'), Locale('de','DE')] // specify the supported locales
  336 +);
  337 +```
  338 +
  339 +#### Change locale
  340 +Call `Get.updateLocale(locale)` to update the locale. Translations then automatically use the new locale.
  341 +```dart
  342 +var locale = Locale('en', 'US');
  343 +Get.updateLocale(locale);
  344 +```
  345 +
  346 +#### System locale
  347 +To read the system locale, you could use `window.locale`.
  348 +```dart
  349 +import 'dart:ui' as ui;
  350 +
  351 +return GetMaterialApp(
  352 + locale: ui.window.locale,
  353 +);
  354 +```
299 355
300 ## Change Theme 356 ## Change Theme
301 357
302 -Please do not use any higher level widget than GetMaterialApp in order to update it. This can trigger duplicate keys. A lot of people are used to the prehistoric approach of creating a "ThemeProvider" widget just to change the theme of your app, and this is definitely NOT necessary with Get. 358 +Please do not use any higher level widget than `GetMaterialApp` in order to update it. This can trigger duplicate keys. A lot of people are used to the prehistoric approach of creating a "ThemeProvider" widget just to change the theme of your app, and this is definitely NOT necessary with **GetX™**.
303 359
304 -You can create your custom theme and simply add it within Get.changeTheme without any boilerplate for that: 360 +You can create your custom theme and simply add it within `Get.changeTheme` without any boilerplate for that:
305 361
306 ```dart 362 ```dart
307 Get.changeTheme(ThemeData.light()); 363 Get.changeTheme(ThemeData.light());
308 ``` 364 ```
309 365
310 -If you want to create something like a button that changes the theme with onTap, you can combine two Get APIs for that, the api that checks if the dark theme is being used, and the theme change API, you can just put this within an onPressed: 366 +If you want to create something like a button that changes the Theme in `onTap`, you can combine two **GetX™** APIs for that:
  367 +- The api that checks if the dark `Theme` is being used.
  368 +- And the `Theme` Change API, you can just put this within an `onPressed`:
311 369
312 ```dart 370 ```dart
313 Get.changeTheme(Get.isDarkMode? ThemeData.light(): ThemeData.dark()); 371 Get.changeTheme(Get.isDarkMode? ThemeData.light(): ThemeData.dark());
314 ``` 372 ```
315 373
316 -When darkmode is activated, it will switch to the light theme, and when the light theme is activated, it will change to dark. 374 +When `.darkmode` is activated, it will switch to the _light theme_, and when the _light theme_ becomes active, it will change to _dark theme_.
317 375
318 -If you want to know in depth how to change the theme, you can follow this tutorial on Medium that even teaches the persistence of the theme using Get: 376 +If you want to know in depth how to change the Theme, you can follow this tutorial on Medium which even teaches the persistence of the theme using **GetX™**:
319 377
320 - [Dynamic Themes in 3 lines using Get](https://medium.com/swlh/flutter-dynamic-themes-in-3-lines-c3b375f292e3) - Tutorial by [Rod Brown](https://github.com/RodBr). 378 - [Dynamic Themes in 3 lines using Get](https://medium.com/swlh/flutter-dynamic-themes-in-3-lines-c3b375f292e3) - Tutorial by [Rod Brown](https://github.com/RodBr).
321 379
@@ -361,60 +419,73 @@ Get.offNamedUntil() @@ -361,60 +419,73 @@ Get.offNamedUntil()
361 //Check in what platform the app is running 419 //Check in what platform the app is running
362 GetPlatform.isAndroid 420 GetPlatform.isAndroid
363 GetPlatform.isIOS 421 GetPlatform.isIOS
  422 +GetPlatform.isMacOS
  423 +GetPlatform.isWindows
  424 +GetPlatform.isLinux
  425 +GetPlatform.isFuchsia
  426 +
  427 +//Check the device type
  428 +GetPlatform.isMobile
  429 +GetPlatform.isDesktop
  430 +//All platforms are supported independently in web!
  431 +//You can tell if you are running inside a browser
  432 +//on Windows, iOS, OSX, Android, etc.
364 GetPlatform.isWeb 433 GetPlatform.isWeb
365 434
366 -// Equivalent to the method: MediaQuery.of(context).size.height, but they are immutable. 435 +
  436 +// Equivalent to : MediaQuery.of(context).size.height,
  437 +// but immutable.
367 Get.height 438 Get.height
368 Get.width 439 Get.width
369 440
370 -// Gives the current context of navigator. 441 +// Gives the current context of the Navigator.
371 Get.context 442 Get.context
372 443
373 -// Gives the context of the snackbar/dialog/bottomsheet in the foreground anywhere in your code. 444 +// Gives the context of the snackbar/dialog/bottomsheet in the foreground, anywhere in your code.
374 Get.contextOverlay 445 Get.contextOverlay
375 446
376 // Note: the following methods are extensions on context. Since you 447 // Note: the following methods are extensions on context. Since you
377 // have access to context in any place of your UI, you can use it anywhere in the UI code 448 // have access to context in any place of your UI, you can use it anywhere in the UI code
378 449
379 -// If you need a changeable height/width (like browser windows that can be scaled) you will need to use context. 450 +// If you need a changeable height/width (like Desktop or browser windows that can be scaled) you will need to use context.
380 context.width 451 context.width
381 context.height 452 context.height
382 453
383 -// gives you the power to define half the screen now, a third of it and so on.  
384 -//Useful for responsive applications. 454 +// Gives you the power to define half the screen, a third of it and so on.
  455 +// Useful for responsive applications.
385 // param dividedBy (double) optional - default: 1 456 // param dividedBy (double) optional - default: 1
386 // param reducedBy (double) optional - default: 0 457 // param reducedBy (double) optional - default: 0
387 context.heightTransformer() 458 context.heightTransformer()
388 context.widthTransformer() 459 context.widthTransformer()
389 460
390 -/// similar to MediaQuery.of(context).size 461 +/// Similar to MediaQuery.of(context).size
391 context.mediaQuerySize() 462 context.mediaQuerySize()
392 463
393 -/// similar to MediaQuery.of(context).padding 464 +/// Similar to MediaQuery.of(context).padding
394 context.mediaQueryPadding() 465 context.mediaQueryPadding()
395 466
396 -/// similar to MediaQuery.of(context).viewPadding 467 +/// Similar to MediaQuery.of(context).viewPadding
397 context.mediaQueryViewPadding() 468 context.mediaQueryViewPadding()
398 469
399 -/// similar to MediaQuery.of(context).viewInsets; 470 +/// Similar to MediaQuery.of(context).viewInsets;
400 context.mediaQueryViewInsets() 471 context.mediaQueryViewInsets()
401 472
402 -/// similar to MediaQuery.of(context).orientation; 473 +/// Similar to MediaQuery.of(context).orientation;
403 context.orientation() 474 context.orientation()
404 475
405 -/// check if device is on landscape mode 476 +/// Check if device is on landscape mode
406 context.isLandscape() 477 context.isLandscape()
407 478
408 -/// check if device is on portrait mode 479 +/// Check if device is on portrait mode
409 context.isPortrait() 480 context.isPortrait()
410 481
411 -/// similar to MediaQuery.of(context).devicePixelRatio; 482 +/// Similar to MediaQuery.of(context).devicePixelRatio;
412 context.devicePixelRatio() 483 context.devicePixelRatio()
413 484
414 -/// similar to MediaQuery.of(context).textScaleFactor; 485 +/// Similar to MediaQuery.of(context).textScaleFactor;
415 context.textScaleFactor() 486 context.textScaleFactor()
416 487
417 -/// get the shortestSide from screen 488 +/// Get the shortestSide from screen
418 context.mediaQueryShortestSide() 489 context.mediaQueryShortestSide()
419 490
420 /// True if width be larger than 800 491 /// True if width be larger than 800
@@ -431,6 +502,14 @@ context.isLargeTablet() @@ -431,6 +502,14 @@ context.isLargeTablet()
431 502
432 /// True if the current device is Tablet 503 /// True if the current device is Tablet
433 context.isTablet() 504 context.isTablet()
  505 +
  506 +/// Returns a value<T> according to the screen size
  507 +/// can give value for:
  508 +/// watch: if the shortestSide is smaller than 300
  509 +/// mobile: if the shortestSide is smaller than 600
  510 +/// tablet: if the shortestSide is smaller than 1200
  511 +/// desktop: if width is largest than 1200
  512 +context.responsiveValue<T>()
434 ``` 513 ```
435 514
436 ### Optional Global Settings and Manual configurations 515 ### Optional Global Settings and Manual configurations
@@ -444,7 +523,7 @@ MaterialApp( @@ -444,7 +523,7 @@ MaterialApp(
444 ); 523 );
445 ``` 524 ```
446 525
447 -You will also be able to use your own Middleware within GetObserver, this will not influence anything. 526 +You will also be able to use your own Middleware within `GetObserver`, this will not influence anything.
448 527
449 ```dart 528 ```dart
450 MaterialApp( 529 MaterialApp(
@@ -455,7 +534,8 @@ MaterialApp( @@ -455,7 +534,8 @@ MaterialApp(
455 ); 534 );
456 ``` 535 ```
457 536
458 -You can create Global settings for Get. Just add Get.config to your code before pushing any route or do it directly in your GetMaterialApp 537 +You can create _Global Settings_ for `Get`. Just add `Get.config` to your code before pushing any route.
  538 +Or do it directly in your `GetMaterialApp`
459 539
460 ```dart 540 ```dart
461 GetMaterialApp( 541 GetMaterialApp(
@@ -474,7 +554,9 @@ Get.config( @@ -474,7 +554,9 @@ Get.config(
474 ) 554 )
475 ``` 555 ```
476 556
477 -You can optionally redirect all the logging messages from Get. If you want to use your own favourite logging package and want to capture the logs there. 557 +You can optionally redirect all the logging messages from `Get`.
  558 +If you want to use your own, favourite logging package,
  559 +and want to capture the logs there:
478 560
479 ```dart 561 ```dart
480 GetMaterialApp( 562 GetMaterialApp(
@@ -490,6 +572,251 @@ void localLogWriter(String text, {bool isError = false}) { @@ -490,6 +572,251 @@ void localLogWriter(String text, {bool isError = false}) {
490 572
491 ``` 573 ```
492 574
  575 +### Local State Widgets
  576 +
  577 +These Widgets allows you to manage a single value, and keep the state ephemeral and locally.
  578 +We have flavours for Reactive and Simple.
  579 +For instance, you might use them to toggle obscureText in a `TextField`, maybe create a custom
  580 +Expandable Panel, or maybe modify the current index in `BottomNavigationBar` while changing the content
  581 +of the body in a `Scaffold`.
  582 +
  583 +#### ValueBuilder
  584 +A simplification of `StatefulWidget` that works with a `.setState` callback that takes the updated value.
  585 +
  586 +```dart
  587 +ValueBuilder<bool>(
  588 + initialValue: false,
  589 + builder: (value, updateFn) => Switch(
  590 + value: value,
  591 + onChanged: updateFn, // same signature! you could use ( newValue ) => updateFn( newValue )
  592 + ),
  593 + // if you need to call something outside the builder method.
  594 + onUpdate: (value) => print("Value updated: $value"),
  595 + onDispose: () => print("Widget unmounted"),
  596 +),
  597 +```
  598 +
  599 +#### ObxValue
  600 +Similar to [`ValueBuilder`](#valuebuilder), but this is the Reactive version, you pass a Rx instance (remember the magical .obs?) and
  601 +updates automatically... isn't it awesome?
  602 +
  603 +```dart
  604 +ObxValue((data) => Switch(
  605 + value: data.value,
  606 + onChanged: data, // Rx has a _callable_ function! You could use (flag) => data.value = flag,
  607 + ),
  608 + false.obs,
  609 +),
  610 +```
  611 +
  612 +## Useful tips
  613 +
  614 +
  615 +`.obs`ervables (also known as _Rx_ Types) have a wide variety of internal methods and operators.
  616 +
  617 +> Is very common to _believe_ that a property with `.obs` **IS** the actual value... but make no mistake!
  618 +We avoid the Type declaration of the variable, because Dart's compiler is smart enough, and the code
  619 +looks cleaner, but:
  620 +```dart
  621 +var message = 'Hello world'.obs;
  622 +print( 'Message "$message" has Type ${message.runtimeType}');
  623 +```
  624 +Even if `message` _prints_ the actual String value, the Type is **RxString**!
  625 +
  626 +So, you can't do `message.substring( 0, 4 )`.
  627 +You have to access the real `value` inside the _observable_:
  628 +The most "used way" is `.value`, but, did you know that you can also use...
  629 +
  630 +```dart
  631 +final name = 'GetX'.obs;
  632 +// only "updates" the stream, if the value is different from the current one.
  633 +name.value = 'Hey';
  634 +
  635 +// this weird (and kinda cool) assignment, updates the stream no matter what
  636 +// it takes nulls, or same value... but rebuilds the observers.
  637 +name << 'Hey'; // !
  638 +
  639 +// All Rx properties are "callable" and returns the new value.
  640 +// but this approach does not accepts `null`, the UI will not rebuild.
  641 +name('Hello');
  642 +
  643 +// is like a getter, prints 'Hello'.
  644 +name() ;
  645 +
  646 +/// numbers:
  647 +
  648 +final count = 0.obs;
  649 +
  650 +// you can just most basic operators acts on the property!
  651 +count + 1;
  652 +
  653 +// Watch out! this is only valid if `count` is not final, but var
  654 +count += 1;
  655 +
  656 +// You can also compare against values:
  657 +count > 2;
  658 +
  659 +/// booleans:
  660 +
  661 +final flag = false.obs;
  662 +
  663 +// switches the value between true/false
  664 +flag.toggle();
  665 +
  666 +
  667 +/// all types:
  668 +
  669 +// Sets the `value` to null.
  670 +flag.nil();
  671 +
  672 +// All toString(), toJson() operations are passed down to the `value`
  673 +print( count ); // calls `toString()` inside for RxInt
  674 +
  675 +final abc = [0,1,2].obs;
  676 +// Converts the value to a json Array, prints RxList
  677 +// Json is supported by all Rx types!
  678 +print('json: ${jsonEncode(abc)}, type: ${abc.runtimeType}');
  679 +
  680 +// RxMap, RxList and RxSet are special Rx types, that extends their native types.
  681 +// but you can work with a List as a regular list, although is reactive!
  682 +abc.add(12); // pushes 12 to the list, and UPDATES the stream.
  683 +abc[3]; // like Lists, reads the index 3.
  684 +
  685 +
  686 +// equality works with the Rx and the value, but hashCode is always taken from the value
  687 +final number = 12.obs;
  688 +print( number == 12 ); // prints > true
  689 +
  690 +/// Custom Rx Models:
  691 +
  692 +// toJson(), toString() are deferred to the child, so you can implement override on them, and print() the observable directly.
  693 +
  694 +class User {
  695 + String name, last;
  696 + int age;
  697 + User({this.name, this.last, this.age});
  698 +
  699 + @override
  700 + String toString() => '$name $last, $age years old';
  701 +}
  702 +
  703 +final user = User(name: 'John', last: 'Doe', age: 33).obs;
  704 +
  705 +// `user` is "reactive", but the properties inside ARE NOT!
  706 +// So, if we change some variable inside of it...
  707 +user.value.name = 'Roi';
  708 +// The widget will not rebuild!,
  709 +// `Rx` don't have any clue when you change something inside user.
  710 +// So, for custom classes, we need to manually "notify" the change.
  711 +user.refresh();
  712 +
  713 +// or we can use the `update()` method!
  714 +user.update((value){
  715 + value.name='Roi';
  716 +});
  717 +
  718 +print( user );
  719 +
  720 +// this also works.
  721 +user << user.value;
  722 +
  723 +```
  724 +
  725 +#### GetView
  726 +
  727 +I love this Widget, is so simple, yet, so useful!
  728 +
  729 +Is a `const Stateless` Widget that has a getter `controller` for a registered `Controller`, that's all.
  730 +
  731 +```dart
  732 + class AwesomeController extends GetxController {
  733 + final String title = 'My Awesome View';
  734 + }
  735 +
  736 + // ALWAYS remember to pass the `Type` you used to register your controller!
  737 + class AwesomeView extends GetView<AwesomeController> {
  738 + @override
  739 + Widget build(BuildContext context) {
  740 + return Container(
  741 + padding: EdgeInsets.all(20),
  742 + child: Text( controller.title ), // just call `controller.something`
  743 + );
  744 + }
  745 + }
  746 +```
  747 +
  748 +#### GetWidget
  749 +
  750 +Most people have no idea about this Widget, or totally confuse the usage of it.
  751 +The use case is very rare, but very specific: It `caches` a Controller.
  752 +Because of the _cache_, can't be a `const Stateless`.
  753 +
  754 +> So, when do you need to "cache" a Controller?
  755 +
  756 +If you use, another "not so common" feature of **GetX**: `Get.create()`.
  757 +
  758 +`Get.create(()=>Controller())` will generate a new `Controller` each time you call
  759 +`Get.find<Controller>()`,
  760 +
  761 +That's where `GetWidget` shines... as you can use it, for example,
  762 +to keep a list of Todo items. So, if the widget gets "rebuilt", it will keep the same controller instance.
  763 +
  764 +
  765 +#### GetxService
  766 +
  767 +This class is like a `GetxController`, it shares the same lifecycle ( `onInit()`, `onReady()`, `onClose()`).
  768 +But has no "logic" inside of it. It just notifies **GetX** Dependency Injection system, that this subclass
  769 +**can not** be removed from memory.
  770 +
  771 +So is super useful to keep your "Services" always reachable and active with `Get.find()`. Like:
  772 +`ApiService`, `StorageService`, `CacheService`.
  773 +
  774 +```dart
  775 +Future<void> main() async {
  776 + await initServices(); /// AWAIT SERVICES INITIALIZATION.
  777 + runApp(SomeApp());
  778 +}
  779 +
  780 +/// Is a smart move to make your Services intiialize before you run the Flutter app.
  781 +/// as you can control the execution flow (maybe you need to load some Theme configuration,
  782 +/// apiKey, language defined by the User... so load SettingService before running ApiService.
  783 +/// so GetMaterialApp() doesnt have to rebuild, and takes the values directly.
  784 +void initServices() async {
  785 + print('starting services ...');
  786 + /// Here is where you put get_storage, hive, shared_pref initialization.
  787 + /// or moor connection, or whatever that's async.
  788 + await Get.putAsync(() => DbService().init());
  789 + await Get.putAsync(SettingsService()).init();
  790 + print('All services started...');
  791 +}
  792 +
  793 +class DbService extends GetxService {
  794 + Future<DbService> init() async {
  795 + print('$runtimeType delays 2 sec');
  796 + await 2.delay();
  797 + print('$runtimeType ready!');
  798 + return this;
  799 + }
  800 +}
  801 +
  802 +class SettingsService extends GetxService {
  803 + void init() async {
  804 + print('$runtimeType delays 1 sec');
  805 + await 1.delay();
  806 + print('$runtimeType ready!');
  807 + }
  808 +}
  809 +
  810 +```
  811 +
  812 +The only way to actually delete a `GetxService`, is with `Get.reset()` which is like a
  813 +"Hot Reboot" of your app. So remember, if you need absolute persistance of a class instance during the
  814 +lifetime of your app, use `GetxService`.
  815 +
  816 +
  817 +
  818 +
  819 +
493 ## Video explanation of Other GetX Features 820 ## Video explanation of Other GetX Features
494 821
495 822
@@ -527,7 +854,7 @@ Now: @@ -527,7 +854,7 @@ Now:
527 ```dart 854 ```dart
528 GetMaterialApp( 855 GetMaterialApp(
529 getPages: [ 856 getPages: [
530 - GetPage(name: '/', page:()=> Home()), 857 + GetPage(name: '/', page: () => Home()),
531 ] 858 ]
532 ) 859 )
533 ``` 860 ```
@@ -4,12 +4,16 @@ @@ -4,12 +4,16 @@
4 4
5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get) 5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get)
6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg) 6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg)
7 -[![Gitter](https://badges.gitter.im/flutter_get/community.svg)](https://gitter.im/flutter_get/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 7 +[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart)
  8 +[![Discord Shield](https://img.shields.io/discord/722900883784073290.svg?logo=discord)](https://discord.com/invite/9Hpt99N)
  9 +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://communityinviter.com/apps/getxworkspace/getx)
  10 +[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
8 <a href="https://github.com/Solido/awesome-flutter"> 11 <a href="https://github.com/Solido/awesome-flutter">
9 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" /> 12 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" />
10 </a> 13 </a>
11 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a> 14 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
12 15
  16 +
13 ![](getx.png) 17 ![](getx.png)
14 18
15 - [Kanały komunikacji i wsparcia:](#kanały-komunikacji-i-wsparcia) 19 - [Kanały komunikacji i wsparcia:](#kanały-komunikacji-i-wsparcia)
@@ -176,7 +180,7 @@ Obx (() => Text (controller.name)); @@ -176,7 +180,7 @@ Obx (() => Text (controller.name));
176 To wszystko. *Proste*, co nie? 180 To wszystko. *Proste*, co nie?
177 181
178 ### Bardziej szczegółowo o menadżerze stanu 182 ### Bardziej szczegółowo o menadżerze stanu
179 -**Zobacz bardziej szczegółowe wytłumaczenie menadz=żera sranu [tutaj](./docs/en_US/state_management.md). Znajdują się tam przykłady jak o różnice między prostym menadżerem stanu oraz reaktywnym** 183 +**Zobacz bardziej szczegółowe wytłumaczenie menadz=żera sranu [tutaj](./documentation/en_US/state_management.md). Znajdują się tam przykłady jak o różnice między prostym menadżerem stanu oraz reaktywnym**
180 184
181 ### Video tłumaczące użycie menadżera stanu 185 ### Video tłumaczące użycie menadżera stanu
182 186
@@ -237,7 +241,7 @@ Zobacz, ze do żadnej z tych operacji nie potrzebowałeś contextu. Jest to jedn @@ -237,7 +241,7 @@ Zobacz, ze do żadnej z tych operacji nie potrzebowałeś contextu. Jest to jedn
237 241
238 ### Więcej o routach 242 ### Więcej o routach
239 243
240 -**Get używa named routes i także oferuje niskopoziomową obsługę routów! Zobacz bardziej szczegółową dokumentacje [tutaj](./docs/en_US/route_management.md)** 244 +**Get używa named routes i także oferuje niskopoziomową obsługę routów! Zobacz bardziej szczegółową dokumentacje [tutaj](./documentation/en_US/route_management.md)**
241 245
242 ### Video tłumaczące użycie 246 ### Video tłumaczące użycie
243 247
@@ -274,7 +278,7 @@ Text(controller.textFromApi); @@ -274,7 +278,7 @@ Text(controller.textFromApi);
274 ``` 278 ```
275 ### Bardziej szczegółowo o menadżerze dependencies 279 ### Bardziej szczegółowo o menadżerze dependencies
276 280
277 -**Zobzcz więcej w dokumentacji [tutaj](./docs/en_US/dependency_management.md)** 281 +**Zobzcz więcej w dokumentacji [tutaj](./documentation/en_US/dependency_management.md)**
278 282
279 # Jak włożyć coś od siebie 283 # Jak włożyć coś od siebie
280 284
@@ -466,6 +470,19 @@ Get.config( @@ -466,6 +470,19 @@ Get.config(
466 ) 470 )
467 ``` 471 ```
468 472
  473 +Opcjonalnie możesz przekierować wszystkie logi z Get by używać swojej ulubionej paczki i zbierać w niej logi.
  474 +
  475 +```dart
  476 +GetMaterialApp(
  477 + enableLog: true,
  478 + logWriterCallback: localLogWriter,
  479 + );
  480 + void localLogWriter(String text, {bool isError = false}) {
  481 + // tutaj przekaż wiadomosci do ulubionej paczki
  482 + // pamiętaj że nawet jeśli "enableLog: false" logi i tak będą wysłane w tym callbacku
  483 + // Musisz sprawdzić konfiguracje flag jeśli chcesz przez GetConfig.isLogEnable
  484 + }
  485 +```
469 ## Video tłumaczące inne funkcjonalności GetX 486 ## Video tłumaczące inne funkcjonalności GetX
470 487
471 488
@@ -505,7 +522,7 @@ Teraz: @@ -505,7 +522,7 @@ Teraz:
505 ```dart 522 ```dart
506 GetMaterialApp( 523 GetMaterialApp(
507 getPages: [ 524 getPages: [
508 - GetPage(name: '/', page:()=> Home()), 525 + GetPage(name: '/', page: () => Home()),
509 ] 526 ]
510 ) 527 )
511 ``` 528 ```
@@ -4,12 +4,16 @@ @@ -4,12 +4,16 @@
4 4
5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get) 5 [![pub package](https://img.shields.io/pub/v/get.svg?label=get&color=blue)](https://pub.dev/packages/get)
6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg) 6 ![building](https://github.com/jonataslaw/get/workflows/build/badge.svg)
7 -[![Gitter](https://badges.gitter.im/flutter_get/community.svg)](https://gitter.im/flutter_get/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 7 +[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart)
  8 +[![Discord Shield](https://img.shields.io/discord/722900883784073290.svg?logo=discord)](https://discord.com/invite/9Hpt99N)
  9 +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://communityinviter.com/apps/getxworkspace/getx)
  10 +[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
8 <a href="https://github.com/Solido/awesome-flutter"> 11 <a href="https://github.com/Solido/awesome-flutter">
9 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" /> 12 <img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square" />
10 </a> 13 </a>
11 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a> 14 <a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://i.imgur.com/aV6DDA7.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
12 15
  16 +
13 ![](getx.png) 17 ![](getx.png)
14 18
15 <h2> Pedimos desculpas por qualquer parte não traduzida aqui. O GetX é atualizado com muita frequência e as traduções podem não vir ao mesmo tempo. Então, para manter essa documentação pelo menos com tudo que a versão em inglês tem, eu vou deixar todos os textos não-traduzidos aqui (eu considero que é melhor ele estar lá em inglês do que não estar), então se alguém quiser traduzir, seria muito útil 😁</h2> 19 <h2> Pedimos desculpas por qualquer parte não traduzida aqui. O GetX é atualizado com muita frequência e as traduções podem não vir ao mesmo tempo. Então, para manter essa documentação pelo menos com tudo que a versão em inglês tem, eu vou deixar todos os textos não-traduzidos aqui (eu considero que é melhor ele estar lá em inglês do que não estar), então se alguém quiser traduzir, seria muito útil 😁</h2>
@@ -30,10 +34,11 @@ @@ -30,10 +34,11 @@
30 - [Mais detalhes sobre gerenciamento de dependências](#mais-detalhes-sobre-gerenciamento-de-dependências) 34 - [Mais detalhes sobre gerenciamento de dependências](#mais-detalhes-sobre-gerenciamento-de-dependências)
31 - [Como contribuir](#como-contribuir) 35 - [Como contribuir](#como-contribuir)
32 - [Utilidades](#utilidades) 36 - [Utilidades](#utilidades)
  37 + - [Internacionalização](#internacionalização)
33 - [Mudar tema (changeTheme)](#mudar-tema-changetheme) 38 - [Mudar tema (changeTheme)](#mudar-tema-changetheme)
34 - [Outras APIs avançadas](#outras-apis-avançadas) 39 - [Outras APIs avançadas](#outras-apis-avançadas)
35 - [Configurações Globais opcionais e configurações manuais](#configurações-globais-opcionais-e-configurações-manuais) 40 - [Configurações Globais opcionais e configurações manuais](#configurações-globais-opcionais-e-configurações-manuais)
36 - - [Video explanation of Other GetX Features](#video-explanation-of-other-getx-features) 41 + - [Video explanation of Other GetX Features](#explicação-em-vídeo-sobre-outras-features-do-getx)
37 - [Breaking Changes da versão 2 para 3](#breaking-changes-da-versão-2-para-3) 42 - [Breaking Changes da versão 2 para 3](#breaking-changes-da-versão-2-para-3)
38 - [Tipagem Rx](#tipagem-rx) 43 - [Tipagem Rx](#tipagem-rx)
39 - [RxController e GetBuilder se uniram](#rxcontroller-e-getbuilder-se-uniram) 44 - [RxController e GetBuilder se uniram](#rxcontroller-e-getbuilder-se-uniram)
@@ -45,21 +50,21 @@ @@ -45,21 +50,21 @@
45 50
46 [**Slack (Inglês)**](https://communityinviter.com/apps/getxworkspace/getx) 51 [**Slack (Inglês)**](https://communityinviter.com/apps/getxworkspace/getx)
47 52
48 -[**Discord (Inglês e Português)**](https://discord.com/invite/9Y3wK9) 53 +[**Discord (Inglês e Português)**](https://discord.com/invite/9Hpt99N)
49 54
50 [**Telegram (Português)**](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g) 55 [**Telegram (Português)**](https://t.me/joinchat/PhdbJRmsZNpAqSLJL6bH7g)
51 56
52 # Sobre Get 57 # Sobre Get
53 58
54 -- Get é uma biblioteca poderosa e extra-leve para Flutter. Ela combina um gerenciador de estado de alta performance, injeção de dependência inteligente e gerenciamento de rotas de uma forma rápida e prática. 59 +- Get é uma biblioteca poderosa e extraleve para Flutter. Ela combina um gerenciador de estado de alta performance, injeção de dependência inteligente e gerenciamento de rotas de uma forma rápida e prática.
55 - Get não é para todos, seu foco é: 60 - Get não é para todos, seu foco é:
56 - **Performance**: Já que gasta o mínimo de recursos 61 - **Performance**: Já que gasta o mínimo de recursos
57 - **Produtividade**: Usando uma sintaxe fácil e agradável 62 - **Produtividade**: Usando uma sintaxe fácil e agradável
58 - **Organização**: Que permite o total desacoplamento da View e da lógica de negócio. 63 - **Organização**: Que permite o total desacoplamento da View e da lógica de negócio.
59 -- Get vai economizar horas de desenvolvimento, e vai extrair a performance máxima que sua aplicação pode entregar, enquanto é fácil para iniciantes e preciso para experts. 64 +- Get vai economizar horas de desenvolvimento e vai extrair a performance máxima que sua aplicação pode entregar, enquanto é fácil para iniciantes e preciso para experts.
60 - Navegue por rotas sem `context`, abra `Dialog`s, `Snackbar`s ou `BottomSheet`s de qualquer lugar no código, gerencie estados e injete dependências de uma forma simples e prática. 65 - Navegue por rotas sem `context`, abra `Dialog`s, `Snackbar`s ou `BottomSheet`s de qualquer lugar no código, gerencie estados e injete dependências de uma forma simples e prática.
61 - Get é seguro, estável, atualizado e oferece uma enorme gama de APIs que não estão presentes no framework padrão. 66 - Get é seguro, estável, atualizado e oferece uma enorme gama de APIs que não estão presentes no framework padrão.
62 -- GetX é desacoplado. Ele tem uma variedade de recursos que te permite começar a programar sem se preocupar com nada, mas cada um desses recursos estão em um container separado, ou seja, nenhuma depende da outra para funcionar. Elas só são inicializadas após o uso. Se você usa apenas o gerenciador de estado, apenas ele será compilado. Teste você mesmo, vá no repositório de benchmark do getX e perceberá: usando somente o gerenciador de estado do Get, a aplicação ficou mais leve do que outros projetos que também estão usando só o gerenciador de estado, porque nada que não seja usado será compilado no seu código, e cada recuro do GetX foi feito para ser muito leve. O mérito vem também do AOT do próprio Flutter que é incrível, e consegue eliminar recursos não utilizados de uma forma que nenhum outro framework consegue. 67 +- GetX é desacoplado. Ele tem uma variedade de recursos que te permite começar a programar sem se preocupar com nada, mas cada um desses recursos estão em um container separado, ou seja, nenhuma depende da outra para funcionar. Elas só são inicializadas após o uso. Se você usa apenas o gerenciador de estado, apenas ele será compilado. Teste você mesmo, vá no repositório de benchmark do getX e perceberá: usando somente o gerenciador de estado do Get, a aplicação ficou mais leve do que outros projetos que também estão usando só o gerenciador de estado, porque nada que não seja usado será compilado no seu código e cada recuro do GetX foi feito para ser muito leve. O mérito vem também do AOT do próprio Flutter que é incrível e consegue eliminar recursos não utilizados de uma forma que nenhum outro framework consegue.
63 68
64 **GetX faz seu desenvolvimento mais produtivo, mas quer deixá-lo mais produtivo ainda? Adicione a extensão [GetX extension](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) no seu VSCode**. Não disponível para outras IDEs por enquanto. 69 **GetX faz seu desenvolvimento mais produtivo, mas quer deixá-lo mais produtivo ainda? Adicione a extensão [GetX extension](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) no seu VSCode**. Não disponível para outras IDEs por enquanto.
65 70
@@ -89,12 +94,12 @@ Troque `MaterialApp` para `GetMaterialApp` @@ -89,12 +94,12 @@ Troque `MaterialApp` para `GetMaterialApp`
89 void main() => runApp(GetMaterialApp(home: Home())); 94 void main() => runApp(GetMaterialApp(home: Home()));
90 ``` 95 ```
91 96
92 -- **Obs:** Isso não modifica o `MaterialApp` do Flutter, GetMaterialApp não é uma versão modificada do MaterialApp, é só um Widget pré-configurado, que tem como child o MaterialApp padrão. Você pode configurar isso manualmente, mas definitivamente não é necessário. GetMaterialApp vai criar rotas, injetá-las, injetar traduções, injetar tudo que você precisa para navegação por rotas (gerenciamento de rotas). Se você quer somente usar o gerenciadro de estado ou somente o gerenciador de dependências, não é necessário usar o GetMaterialApp. Ele somente é necessário para: 97 +- **Obs:** Isso não modifica o `MaterialApp` do Flutter, GetMaterialApp não é uma versão modificada do MaterialApp, é só um Widget pré-configurado, que tem como child o MaterialApp padrão. Você pode configurar isso manualmente, mas definitivamente não é necessário. GetMaterialApp vai criar rotas, injetá-las, injetar traduções, injetar tudo que você precisa para navegação por rotas (gerenciamento de rotas). Se você quer somente usar o gerenciador de estado ou somente o gerenciador de dependências, não é necessário usar o GetMaterialApp. Ele somente é necessário para:
93 - Rotas 98 - Rotas
94 - Snackbars/bottomsheets/dialogs 99 - Snackbars/bottomsheets/dialogs
95 - apis relacionadas a rotas e a ausência de `context` 100 - apis relacionadas a rotas e a ausência de `context`
96 - Internacionalização 101 - Internacionalização
97 -- **Obs²:** Esse passo só é necessário se você for usar o gerenciamento de rotas (`Get,to()`, `Get.back()` e assim por diante), Se você não vai usar isso então não é necessário seguir o passo 1 102 +- **Obs²:** Esse passo só é necessário se você for usar o gerenciamento de rotas (`Get.to()`, `Get.back()` e assim por diante), Se você não vai usar isso então não é necessário seguir o passo 1
98 103
99 - Passo 2: 104 - Passo 2:
100 Cria a sua classe de regra de negócio e coloque todas as variáveis, métodos e controllers dentro dela. 105 Cria a sua classe de regra de negócio e coloque todas as variáveis, métodos e controllers dentro dela.
@@ -159,7 +164,7 @@ Definitivamente, Get não é o inimigo de nenhum gerenciador, porque Get é um m @@ -159,7 +164,7 @@ Definitivamente, Get não é o inimigo de nenhum gerenciador, porque Get é um m
159 164
160 Programação reativa pode alienar muitas pessoas porque é dito que é complicado. GetX transforma a programação reativa em algo bem simples: 165 Programação reativa pode alienar muitas pessoas porque é dito que é complicado. GetX transforma a programação reativa em algo bem simples:
161 166
162 -* Você não precisa de criar StreamControllers 167 +* Você não precisa criar StreamControllers
163 * Você não precisa criar um StreamBuilder para cada variável 168 * Você não precisa criar um StreamBuilder para cada variável
164 * Você não precisa criar uma classe para cada estado 169 * Você não precisa criar uma classe para cada estado
165 * Você não precisa criar um get para o valor inicial 170 * Você não precisa criar um get para o valor inicial
@@ -191,7 +196,7 @@ Só isso. É *simples assim*; @@ -191,7 +196,7 @@ Só isso. É *simples assim*;
191 196
192 ### Mais detalhes sobre gerenciamento de estado 197 ### Mais detalhes sobre gerenciamento de estado
193 198
194 -**Veja uma explicação mais completa do gerenciamento de estado [aqui](./docs/pt_BR/state_management.md). Lá terá mais exemplos e também a diferença do simple state manager do reactive state manager** 199 +**Veja uma explicação mais completa do gerenciamento de estado [aqui](./documentation/pt_BR/state_management.md). Lá terá mais exemplos e também a diferença do simple state manager do reactive state manager**
195 200
196 ### Explicação em video do gerenciamento de estado 201 ### Explicação em video do gerenciamento de estado
197 202
@@ -225,7 +230,7 @@ Para ir para a próxima tela e cancelar todas as rotas anteriores (útil em tela @@ -225,7 +230,7 @@ Para ir para a próxima tela e cancelar todas as rotas anteriores (útil em tela
225 Get.offAll(ProximaTela()); 230 Get.offAll(ProximaTela());
226 ``` 231 ```
227 232
228 -Para navegar para a próxima rota, e receber ou atualizar dados assim que retornar da rota: 233 +Para navegar para a próxima rota e receber ou atualizar dados assim que retornar da rota:
229 234
230 ```dart 235 ```dart
231 var dados = await Get.to(Pagamento()); 236 var dados = await Get.to(Pagamento());
@@ -235,7 +240,7 @@ Notou que você não precisou usar `context` para fazer nenhuma dessas coisas? E @@ -235,7 +240,7 @@ Notou que você não precisou usar `context` para fazer nenhuma dessas coisas? E
235 240
236 ### Mais detalhes sobre gerenciamento de rotas 241 ### Mais detalhes sobre gerenciamento de rotas
237 242
238 -**GetX funciona com rotas nomeadas também! Veja uma explicação mais completa do gerenciamento de rotas [aqui](./docs/pt_BR/route_management.md)** 243 +**GetX funciona com rotas nomeadas também! Veja uma explicação mais completa do gerenciamento de rotas [aqui](./documentation/pt_BR/route_management.md)**
239 244
240 ### Explicação em video do gerenciamento de rotas 245 ### Explicação em video do gerenciamento de rotas
241 246
@@ -263,7 +268,7 @@ Agora, imagine que você navegou por inúmeras rotas e precisa de dados que fora @@ -263,7 +268,7 @@ Agora, imagine que você navegou por inúmeras rotas e precisa de dados que fora
263 268
264 ```dart 269 ```dart
265 Controller controller = Get.find(); 270 Controller controller = Get.find();
266 -// Sim, parece Magia, o Get irá descobrir qual é seu controller, e irá te entregar. 271 +// Sim, parece Magia, o Get irá descobrir qual é seu controller e irá te entregar.
267 // Você pode ter 1 milhão de controllers instanciados, o Get sempre te entregará o controller correto. 272 // Você pode ter 1 milhão de controllers instanciados, o Get sempre te entregará o controller correto.
268 // Apenas se lembre de Tipar seu controller, final controller = Get.find(); por exemplo, não irá funcionar. 273 // Apenas se lembre de Tipar seu controller, final controller = Get.find(); por exemplo, não irá funcionar.
269 ``` 274 ```
@@ -274,7 +279,7 @@ E então você será capaz de recuperar os dados do seu controller que foram obt @@ -274,7 +279,7 @@ E então você será capaz de recuperar os dados do seu controller que foram obt
274 Text(controller.textFromApi); 279 Text(controller.textFromApi);
275 ``` 280 ```
276 281
277 -Procurando por `lazyLoading`?(carregar somente quando for usar) Você pode declarar todos os seus controllers, e eles só vão ser inicializados e chamados quando alguém precisar. Você pode fazer isso 282 +Procurando por `lazyLoading` (carregar somente quando for usar)? Você pode declarar todos os seus controllers e eles só vão ser inicializados e chamados quando alguém precisar. Você pode fazer isso
278 283
279 ```dart 284 ```dart
280 Get.lazyPut<Service>(()=> ApiMock()); 285 Get.lazyPut<Service>(()=> ApiMock());
@@ -283,7 +288,7 @@ Get.lazyPut<Service>(()=> ApiMock()); @@ -283,7 +288,7 @@ Get.lazyPut<Service>(()=> ApiMock());
283 288
284 ### Mais detalhes sobre gerenciamento de dependências 289 ### Mais detalhes sobre gerenciamento de dependências
285 290
286 -**Veja uma explicação mais completa do gerenciamento de dependência [aqui](./docs/pt_BR/dependency_management.md)** 291 +**Veja uma explicação mais completa do gerenciamento de dependência [aqui](./documentation/pt_BR/dependency_management.md)**
287 292
288 # Como contribuir 293 # Como contribuir
289 294
@@ -291,7 +296,7 @@ Quer contribuir no projeto? Nós ficaremos orgulhosos de ressaltar você como um @@ -291,7 +296,7 @@ Quer contribuir no projeto? Nós ficaremos orgulhosos de ressaltar você como um
291 296
292 - Ajudando a traduzir o README para outras linguagens. 297 - Ajudando a traduzir o README para outras linguagens.
293 - Adicionando mais documentação ao README (até o momento, várias das funcionalidades do Get não foram documentadas). 298 - Adicionando mais documentação ao README (até o momento, várias das funcionalidades do Get não foram documentadas).
294 -- Fazendo artigos/vídeos ensinando a usar o Get (eles serão inseridos no README, e no futuro na nossa Wiki). 299 +- Fazendo artigos/vídeos ensinando a usar o Get (eles serão inseridos no README e no futuro na nossa Wiki).
295 - Fazendo PR's (Pull-Requests) para código/testes. 300 - Fazendo PR's (Pull-Requests) para código/testes.
296 - Incluindo novas funcionalidades. 301 - Incluindo novas funcionalidades.
297 302
@@ -299,9 +304,64 @@ Qualquer contribuição é bem-vinda! @@ -299,9 +304,64 @@ Qualquer contribuição é bem-vinda!
299 304
300 # Utilidades 305 # Utilidades
301 306
  307 +## Internacionalização
  308 +### Traduções
  309 +As traduções são mantidas num simples dictionary map de chave-valor.
  310 +Para adicionar traduções personalizadas, crie uma classe e estenda `Translations`.
  311 +```dart
  312 +import 'package:get/get.dart';
  313 +
  314 +class Messages extends Translations {
  315 + @override
  316 + Map<String, Map<String, String>> get keys => {
  317 + 'en_US': {
  318 + 'hello': 'Hello World',
  319 + },
  320 + 'de_DE': {
  321 + 'hello': 'Hallo Welt',
  322 + }
  323 + };
  324 +}
  325 +```
  326 +
  327 +#### Usando traduções
  328 +Basta anexar `.tr` a chave especificada e ela será traduzida, usando o valor atual de `Get.locale` e `Get.fallbackLocale`.
  329 +```dart
  330 +Text('hello'.tr);
  331 +```
  332 +
  333 +### Localidade
  334 +Passe parâmetros para `GetMaterialApp` definir a localidade e as traduções.
  335 +
  336 +```dart
  337 +return GetMaterialApp(
  338 + translations: Messages(), // suas traduções
  339 + locale: Locale('en', 'US'), // as traduções serão exibidas para esta localidade
  340 + fallbackLocale: Locale('en', 'UK'), // especifica uma localidade em caso de falha na localidade definida
  341 + supportedLocales: <Locale>[Locale('en', 'UK'), Locale('en', 'US'), Locale('de','DE')] // especifica as localidades suportados
  342 +);
  343 +```
  344 +
  345 +#### Alterar local
  346 +Use `Get.updateLocale(locale)` para atualizar a localidade. As traduções usarão automaticamente a nova localidade.
  347 +```dart
  348 +var locale = Locale('en', 'US');
  349 +Get.updateLocale(locale);
  350 +```
  351 +
  352 +#### Localidade do sistema operacional
  353 +Para ler a localidade do sistema operacional, você pode usar `window.locale`.
  354 +```dart
  355 +import 'dart:ui' as ui;
  356 +
  357 +return GetMaterialApp(
  358 + locale: ui.window.locale,
  359 +);
  360 +```
  361 +
302 ## Mudar tema (changeTheme) 362 ## Mudar tema (changeTheme)
303 363
304 -Por favor não use widget acima do GetMaterialApp para atualizar o tome. Isso pode causar keys duplicadas. Várias pessoas estão acostumadas com o jeito normal de criar um Widget `ThemeProvider` só pra alterar o thema do app, mas isso definitivamente NÃO é necessário no Get. 364 +Por favor não use widget acima do GetMaterialApp para atualizar o tema. Isso pode causar keys duplicadas. Várias pessoas estão acostumadas com o jeito normal de criar um Widget `ThemeProvider` só pra alterar o tema do app, mas isso definitivamente NÃO é necessário no Get.
305 365
306 Você pode criar seu tema customizado e simplesmente adicionar dentro do `Get.changeTheme` sem nenhum boilerplate para isso: 366 Você pode criar seu tema customizado e simplesmente adicionar dentro do `Get.changeTheme` sem nenhum boilerplate para isso:
307 367
@@ -319,7 +379,7 @@ Get.changeTheme( @@ -319,7 +379,7 @@ Get.changeTheme(
319 ) 379 )
320 ``` 380 ```
321 381
322 -Quando o modo Dark está ativado, ele vai trocar pro modo light, e vice versa. 382 +Quando o modo Dark está ativado, ele vai trocar pro modo light e vice versa.
323 383
324 Se você quiser saber mais como trocar o tema, você pode seguir esse tutorial no Medium que até ensina persistência do tema usando Get (e SharedPreferences): 384 Se você quiser saber mais como trocar o tema, você pode seguir esse tutorial no Medium que até ensina persistência do tema usando Get (e SharedPreferences):
325 385
@@ -390,47 +450,65 @@ Get.contextOverlay @@ -390,47 +450,65 @@ Get.contextOverlay
390 context.width 450 context.width
391 context.height 451 context.height
392 452
393 -/// similar to MediaQuery.of(this).padding 453 +// Dá a você agora o poder de definir metade da tela, um terço da dela e assim por diante.
  454 +// Útil para aplicativos responsivos.
  455 +// param dividedBy (double) opcional - default: 1
  456 +// param reducedBy (double) opcional - default: 0
  457 +context.heightTransformer()
  458 +context.widthTransformer()
  459 +
  460 +/// similar a MediaQuery.of(context).size
  461 +context.mediaQuerySize()
  462 +
  463 +/// similar a MediaQuery.of(this).padding
394 context.mediaQueryPadding() 464 context.mediaQueryPadding()
395 465
396 -/// similar to MediaQuery.of(this).viewPadding 466 +/// similar a MediaQuery.of(this).viewPadding
397 context.mediaQueryViewPadding() 467 context.mediaQueryViewPadding()
398 468
399 -/// similar to MediaQuery.of(this).viewInsets; 469 +/// similar a MediaQuery.of(this).viewInsets;
400 context.mediaQueryViewInsets() 470 context.mediaQueryViewInsets()
401 471
402 -/// similar to MediaQuery.of(this).orientation; 472 +/// similar a MediaQuery.of(this).orientation;
403 context.orientation() 473 context.orientation()
404 474
405 -/// check if device is on landscape mode 475 +/// verifica se o dispositivo está no modo paisagem
406 context.isLandscape() 476 context.isLandscape()
407 477
408 -/// check if device is on portrait mode 478 +/// verifica se o dispositivo está no modo retrato
409 context.isPortrait() 479 context.isPortrait()
410 480
411 -/// similar to MediaQuery.of(this).devicePixelRatio; 481 +/// similar a MediaQuery.of(this).devicePixelRatio;
412 context.devicePixelRatio() 482 context.devicePixelRatio()
413 483
414 -/// similar to MediaQuery.of(this).textScaleFactor; 484 +/// similar a MediaQuery.of(this).textScaleFactor;
415 context.textScaleFactor() 485 context.textScaleFactor()
416 486
417 -/// get the shortestSide from screen 487 +/// obtém a menor dimensão (largura ou altura) da tela
418 context.mediaQueryShortestSide() 488 context.mediaQueryShortestSide()
419 489
420 -/// True if width be larger than 800 490 +/// retorna True se a largura da tela for maior que 800px
421 context.showNavbar() 491 context.showNavbar()
422 492
423 -/// True if the shortestSide is smaller than 600p 493 +/// retorna True se a menor dimensão (largura ou altura) da tela for menor que 600px
424 context.isPhone() 494 context.isPhone()
425 495
426 -/// True if the shortestSide is largest than 600p 496 +/// retorna True se a menor dimensão (largura ou altura) da tela for maior ou igual a 600px
427 context.isSmallTablet() 497 context.isSmallTablet()
428 498
429 -/// True if the shortestSide is largest than 720p 499 +/// retorna True se a menor dimensão (largura ou altura) da tela for maior ou igual a 720px
430 context.isLargeTablet() 500 context.isLargeTablet()
431 501
432 -/// True if the current device is Tablet 502 +/// retorna True se o dispositivo é um Tablet
433 context.isTablet() 503 context.isTablet()
  504 +
  505 +/// Retorna um valor de acordo com o tamanho da tela
  506 +/// Os valores possíveis são:
  507 +/// swatch: se a menor dimensão (largura ou altura) da tela for menor que 300px
  508 +/// mobile: se a menor dimensão (largura ou altura) da tela for menor que 600px
  509 +/// tablet: se a menor dimensão (largura ou altura) da tela for menor que 1200px
  510 +/// desktop: se a largura da tela é maior ou iguial a 1200px
  511 +context.responsiveValue<T>()
434 ``` 512 ```
435 513
436 ### Configurações Globais opcionais e configurações manuais 514 ### Configurações Globais opcionais e configurações manuais
@@ -489,10 +567,45 @@ void localLogWriter(String text, {bool isError = false}) { @@ -489,10 +567,45 @@ void localLogWriter(String text, {bool isError = false}) {
489 } 567 }
490 ``` 568 ```
491 569
492 -## Video explanation of Other GetX Features 570 +### Widgets de Estado Local
  571 +
  572 +Esses Widgets permitem que você gerencie um único valor e mantenha o estado efêmero e localmente. Temos versões para Reativo e Simples. Por exemplo, você pode usá-los para alternar obscureText em um TextField, talvez criar um painel expansível personalizado ou talvez modificar o índice atual em um BottomNavigationBar enquanto altera o conteúdo do corpo em um Scaffold.
  573 +
  574 +#### ValueBuilder
  575 +Uma simplificação de StatefulWidget que funciona com um callback de "setState" que passa o valor atualizado.
  576 +
  577 +
  578 +```dart
  579 +ValueBuilder<bool>(
  580 + initialValue: false,
  581 + builder: (value, updateFn) => Switch(
  582 + value: value,
  583 + onChanged: updateFn, // mesma assinatura! Você poderia usar ( newValue ) => updateFn( newValue )
  584 + ),
  585 + // se você precisa chamar algo fora do método builder.
  586 + onUpdate: (value) => print("Value updated: $value"),
  587 + onDispose: () => print("Widget unmounted"),
  588 +),
  589 +```
  590 +
  591 +#### ObxValue
  592 +Similar a ValueBuilder, mas esta é a versão Reativa, você passa uma instância Rx (lembra do .obs mágico?) e
  593 +atualiza automaticamente... não é incrível?
  594 +
  595 +```dart
  596 +ObxValue(
  597 + (data) => Switch(
  598 + value: data.value,
  599 + onChanged: data, // Rx tem uma função _callable_! Você poderia usar (flag) => data.value = flag,
  600 + ),
  601 + false.obs,
  602 +),
  603 +```
  604 +
  605 +## Explicação em vídeo sobre Outras Features do GetX
493 606
494 607
495 -Amateur Coder did an awesome video about utils, storage, bindings and other features! Link: [GetX Other Features](https://youtu.be/ttQtlX_Q0eU) 608 +Amateur Coder fez um vídeo incrível sobre utils, storage, bindings e outras features! Link: [GetX Other Features](https://youtu.be/ttQtlX_Q0eU)
496 609
497 # Breaking Changes da versão 2 para 3 610 # Breaking Changes da versão 2 para 3
498 611
@@ -502,7 +615,7 @@ Amateur Coder did an awesome video about utils, storage, bindings and other feat @@ -502,7 +615,7 @@ Amateur Coder did an awesome video about utils, storage, bindings and other feat
502 | -------- | ---------- | 615 | -------- | ---------- |
503 | StringX | `RxString` | 616 | StringX | `RxString` |
504 | IntX | `RxInt` | 617 | IntX | `RxInt` |
505 -| MapX | `RxMax` | 618 +| MapX | `RxMap` |
506 | ListX | `RxList` | 619 | ListX | `RxList` |
507 | NumX | `RxNum` | 620 | NumX | `RxNum` |
508 | RxDouble | `RxDouble` | 621 | RxDouble | `RxDouble` |
@@ -549,7 +662,7 @@ Agora: @@ -549,7 +662,7 @@ Agora:
549 ```dart 662 ```dart
550 GetMaterialApp( 663 GetMaterialApp(
551 getPages: [ 664 getPages: [
552 - GetPage(name: '/', page:()=> Home()), 665 + GetPage(name: '/', page: () => Home()),
553 ] 666 ]
554 ) 667 )
555 ``` 668 ```
@@ -558,7 +671,7 @@ GetMaterialApp( @@ -558,7 +671,7 @@ GetMaterialApp(
558 671
559 Frequentemente, pode ser necessário decidir qual pagina vai ser mostrada ao usuário a partir de um parâmetro, como um token de login. A forma abordada anteriormente não era flexível, já que não permitia isso. 672 Frequentemente, pode ser necessário decidir qual pagina vai ser mostrada ao usuário a partir de um parâmetro, como um token de login. A forma abordada anteriormente não era flexível, já que não permitia isso.
560 673
561 -Inserir a página numa função reduziu significativamente o consumo de RAM, já que as rotas não são alocadas na memória desde o app inicia, e também permite fazer esse tipo de abordagem: 674 +Inserir a página numa função reduziu significativamente o consumo de RAM, já que as rotas não são alocadas na memória no momento que o app é iniciado e também permite fazer esse tipo de abordagem:
562 675
563 ```dart 676 ```dart
564 677
@@ -575,11 +688,11 @@ GetMaterialApp( @@ -575,11 +688,11 @@ GetMaterialApp(
575 688
576 # Por que GetX? 689 # Por que GetX?
577 690
578 -1- Muitas vezes após uma atualização do Flutter, muitos dos seus packages irão quebrar. As vezes acontecem erros de compilação, muitas vezes aparecem erros que ainda não existem respostas sobre, e o desenvolvedor necessita saber de onde o erro veio, rastrear o erro, para só então tentar abrir uma issue no repositório correspondente, e ver seu problema resolvido. Get centraliza os principais recursos para o desenvolvimento (Gerencia de estado, de dependencias e de rotas), permitindo você adicionar um único package em seu pubspec, e começar a trabalhar. Após uma atualização do Flutter, a única coisa que você precisa fazer é atualizar a dependencia do Get, e começar a trabalhar. Get também resolve problemas de compatibilidade. Quantas vezes uma versão de um package não é compatível com a versão de outro, porque um utiliza uma dependencia em uma versão, e o outro em outra versão? Essa também não é uma preocupação usando Get, já que tudo está no mesmo package e é totalmente compatível. 691 +1- Muitas vezes após uma atualização do Flutter, muitos dos seus packages irão quebrar. As vezes acontecem erros de compilação, muitas vezes aparecem erros que ainda não existem respostas sobre e o desenvolvedor necessita saber de onde o erro veio, rastreá-lo, para só então tentar abrir uma issue no repositório correspondente e ver seu problema resolvido. Get centraliza os principais recursos para o desenvolvimento (Gerência de estado, de dependências e de rotas), permitindo você adicionar um único package em seu pubspec e começar a trabalhar. Após uma atualização do Flutter, a única coisa que você precisa fazer é atualizar a dependencia do Get e começar a trabalhar. Get também resolve problemas de compatibilidade. Quantas vezes uma versão de um package não é compatível com a versão de outro, porque um utiliza uma dependência em uma versão e o outro em outra versão? Essa também não é uma preocupação usando Get, já que tudo está no mesmo package e é totalmente compatível.
579 692
580 -2- Flutter é fácil, Flutter é incrível, mas Flutter ainda tem algum boilerplate que pode ser indesejado para maioria dos desenvolvedores, como o Navigator.of(context).push(context, builder[...]. Get simplifica o desenvolvimento. Em vez de escrever 8 linhas de código para apenas chamar uma rota, você pode simplesmente fazer: Get.to(Home()) e pronto, você irá para a próxima página. Urls dinamicas da web é algo realmente doloroso de fazer com o Flutter atualmente, e isso com o GetX é estupidamente simples. Gerenciar estados no Flutter, e gerenciar dependencias também é algo que gera muita discussão, por haver centenas de padrões na pub. Mas não há nada que seja tão fácil quanto adicionar um ".obs" no final de sua variável, e colocar o seu widget dentro de um Obx, e pronto, todas atualizações daquela variável será automaticamente atualizado na tela. 693 +2- Flutter é fácil, Flutter é incrível, mas Flutter ainda tem algum boilerplate que pode ser indesejado para maioria dos desenvolvedores, como o Navigator.of(context).push(context, builder[...]. Get simplifica o desenvolvimento. Em vez de escrever 8 linhas de código para apenas chamar uma rota, você pode simplesmente fazer: Get.to(Home()) e pronto, você irá para a próxima página. Urls dinâmicas da web é algo realmente doloroso de fazer com o Flutter atualmente e isso com o GetX é estupidamente simples. Gerenciar estados no Flutter e gerenciar dependências também é algo que gera muita discussão, por haver centenas de padrões na pub. Mas não há nada que seja tão fácil quanto adicionar um ".obs" no final de sua variável, colocar o seu widget dentro de um Obx e pronto, todas atualizações daquela variável serão automaticamente atualizadas na tela.
581 694
582 -3- Facilidade sem se preocupar com desempenho. O desempenho do Flutter já é incrível, mas imagine que você use um gerenciador de estados, e um locator para distribuir suas classes blocs/stores/controllers/ etc. Você deverá chamar manualmente a exclusão daquela dependencia quando não precisar dela. Mas já pensou em simplesmente usar seu controlador, e quando ele não tivesse mais sendo usado por ninguém, ele simplesmente fosse excluído da memória? É isso que GetX faz. Com o SmartManagement, tudo que não está sendo usado é excluído da memória, e você não deve se preocupar em nada além de programar. Você terá garantia que está consumindo o mínimo de recursos necessários, sem ao menos ter criado uma lógica para isso. 695 +3- Facilidade sem se preocupar com desempenho. O desempenho do Flutter já é incrível, mas imagine que você use um gerenciador de estados e um locator para distribuir suas classes blocs/stores/controllers/ etc. Você deverá chamar manualmente a exclusão daquela dependência quando não precisar dela. Mas já pensou em simplesmente usar seu controlador e quando ele não tivesse mais sendo usado por ninguém, ele simplesmente fosse excluído da memória? É isso que GetX faz. Com o SmartManagement, tudo que não está sendo usado é excluído da memória e você não deve se preocupar em nada além de programar. Você terá garantia que está consumindo o mínimo de recursos necessários, sem ao menos ter criado uma lógica para isso.
583 696
584 -4- Desacoplamento real. Você já deve ter ouvido o conceito "separar a view da lógica de negócios". Isso não é uma peculiaridade do BLoC, MVC, MVVM, e qualquer outro padrão existente no mercado tem esse conceito. No entanto, muitas vezes esse conceito pode ser mitigado no Flutter por conta do uso do context.  
585 -Se você precisa de context para localizar um InheritedWidget, você precisa disso na view, ou passar o context por parametro. Eu particularmente acho essa solução muito feia, e para trabalhar em equipes teremos sempre uma dependencia da lógica de negócios da View. Getx é pouco ortodoxo com a abordagem padrão, e apesar de não proibir totalmente o uso de StatefulWidgets, InitState, e etc, ele tem sempre uma abordagem similar que pode ser mais limpa. Os controllers tem ciclos de vida, e quando você precisa fazer uma solicitação APIREST por exemplo, você não depende de nada da view. Você pode usar onInit para iniciar a chamada http, e quando os dados chegarem, as variáveis serão preenchidas. Como GetX é totalmente reativo (de verdade, e trabalha sob streams), assim que os itens forem preenchidos, automaticamente será atualizado na view todos os widgets que usam aquela variável. Isso permite que as pessoas especialistas em UI trabalhem apenas com widgets, e não precisem enviar nada para a lógica de negócio além de eventos do usuário (como clicar em um botão), enquanto as pessoas que trabalham com a lógica de negócios ficarão livres para criar e testar a lógica de negócios separadamente. 697 +4- Desacoplamento real. Você já deve ter ouvido o conceito "separar a view da lógica de negócios". Isso não é uma peculiaridade do BLoC, MVC ou MVVM, qualquer outro padrão existente no mercado tem esse conceito. No entanto, muitas vezes esse conceito pode ser mitigado no Flutter por conta do uso do context.
  698 +Se você precisa de context para localizar um InheritedWidget, você precisa disso na view ou passar o context por parâmetro. Eu particularmente acho essa solução muito feia e para trabalhar em equipes teremos sempre uma dependência da lógica de negócios da View. Getx é pouco ortodoxo com a abordagem padrão e apesar de não proibir totalmente o uso de StatefulWidgets, InitState e etc, ele tem sempre uma abordagem similar que pode ser mais limpa. Os controllers tem ciclos de vida e quando você precisa fazer uma solicitação APIREST por exemplo, você não depende de nada da view. Você pode usar onInit para iniciar a chamada http e quando os dados chegarem, as variáveis serão preenchidas. Como GetX é totalmente reativo (de verdade e trabalha sob streams), assim que os itens forem preenchidos, automaticamente será atualizado na view todos os widgets que usam aquela variável. Isso permite que as pessoas especialistas em UI trabalhem apenas com widgets e não precisem enviar nada para a lógica de negócio além de eventos do usuário (como clicar em um botão), enquanto as pessoas que trabalham com a lógica de negócio ficarão livres para criá-la e testá-la separadamente.
  1 +# Include option is buggy:
  2 +# https://github.com/flutter/flutter/issues/62591
  3 +# In case the include issue gets fixed, lines below INCLUDE_FIX
  4 +# can be removed
  5 +
  6 +# include: package:effective_dart/analysis_options.1.2.0.yaml
  7 +analyzer:
  8 + strong-mode:
  9 + implicit-casts: false
  10 +linter:
  11 + rules:
  12 + await_only_futures: true
  13 + # This one is desirable, but that's a lot of work for now
  14 + public_member_api_docs: false
  15 + # Desirable, but would be breaking changes:
  16 + avoid_positional_boolean_parameters: false
  17 + constant_identifier_names: false
  18 + include_file_not_found: false
  19 +
  20 + # INCLUDE_FIX (copy of effective dart 1.2.0)
  21 + # STYLE
  22 + camel_case_types: true
  23 + camel_case_extensions: true
  24 + library_names: true
  25 + file_names: true
  26 + library_prefixes: true
  27 + non_constant_identifier_names: true
  28 + directives_ordering: true
  29 + lines_longer_than_80_chars: true # avoid
  30 + curly_braces_in_flow_control_structures: true
  31 +
  32 + # DOCUMENTATION
  33 + slash_for_doc_comments: true
  34 + package_api_docs: true # prefer
  35 + #- comment_references # Unused because https://github.com/dart-lang/sdk/issues/36974
  36 +
  37 + # USAGE
  38 + implementation_imports: true
  39 + avoid_relative_lib_imports: true # prefer
  40 + prefer_relative_imports: true # prefer
  41 + prefer_adjacent_string_concatenation: true
  42 + prefer_interpolation_to_compose_strings: true # prefer
  43 + unnecessary_brace_in_string_interps: true # avoid
  44 + prefer_collection_literals: true
  45 + avoid_function_literals_in_foreach_calls: true # avoid
  46 + prefer_iterable_whereType: true
  47 + prefer_function_declarations_over_variables: true
  48 + unnecessary_lambdas: true
  49 + prefer_equal_for_default_values: true
  50 + avoid_init_to_null: true
  51 + unnecessary_getters_setters: true
  52 + #- unnecessary_getters # prefer # Disabled pending fix: https://github.com/dart-lang/linter/issues/23
  53 + #- prefer_expression_function_bodies # consider
  54 + unnecessary_this: true
  55 + prefer_initializing_formals: true
  56 + type_init_formals: true
  57 + empty_constructor_bodies: true
  58 + unnecessary_new: true
  59 + unnecessary_const: true
  60 + avoid_catches_without_on_clauses: true # avoid
  61 + avoid_catching_errors: true
  62 + use_rethrow_when_possible: true
  63 +
  64 + # DESIGN
  65 + use_to_and_as_if_applicable: true # prefer
  66 + one_member_abstracts: true # avoid
  67 + avoid_classes_with_only_static_members: true # avoid
  68 + prefer_mixin: true
  69 + prefer_final_fields: true # prefer
  70 + use_setters_to_change_properties: true
  71 + avoid_setters_without_getters: true
  72 + avoid_returning_null: true # avoid
  73 + avoid_returning_this: true # avoid
  74 + type_annotate_public_apis: true # prefer
  75 + #- prefer_typing_uninitialized_variables # consider
  76 + omit_local_variable_types: true # avoid
  77 + avoid_types_on_closure_parameters: true # avoid
  78 + avoid_return_types_on_setters: true # avoid
  79 + prefer_generic_function_type_aliases: true
  80 + avoid_private_typedef_functions: true # prefer
  81 + #- use_function_type_syntax_for_parameters # consider
  82 + hash_and_equals: true
  83 + avoid_equals_and_hash_code_on_mutable_classes: true # avoid
  84 + avoid_null_checks_in_equality_operators: true
  85 +
1 -# benchmarks  
2 -A repository to benchmark Flutter libs.  
3 -Creators of the tested libs can suggest improvements, as long as they follow the same design structure.  
4 -  
5 -# 1- State Managers  
6 -  
7 -![](benchmark.png)  
8 -  
9 -The idle application consumes 4.288k of ram.  
10 -Items were added dynamically to a ListView.  
11 -The amount of RAM was measured after the test, and the following calculation was made:  
12 -Number of RAM consumed by the app after testing with the state manager - RAM in idle state without any state manager.  
13 -  
14 -In addition to the RAM calculation, the size of the apk was also observed after compilation. And we had the following results:  
15 -  
16 -- flutter_bloc: 8.3mb  
17 -- mobx: 8.3mb  
18 -- provider: 8.3mb  
19 -- redux: 8.2mb  
20 -- get: 8.2mb  
21 -- getx: 8.2mb  
22 -  
23 -The creators of flutter_bloc and provider made changes to use their library. If you want to make changes (within the scope of the project, without eliminating classes), you can do so by offering a PR.  
1 -# Flutter State Management  
1 -def localProperties = new Properties()  
2 -def localPropertiesFile = rootProject.file('local.properties')  
3 -if (localPropertiesFile.exists()) {  
4 - localPropertiesFile.withReader('UTF-8') { reader ->  
5 - localProperties.load(reader)  
6 - }  
7 -}  
8 -  
9 -def flutterRoot = localProperties.getProperty('flutter.sdk')  
10 -if (flutterRoot == null) {  
11 - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")  
12 -}  
13 -  
14 -apply plugin: 'com.android.application'  
15 -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"  
16 -  
17 -android {  
18 - compileSdkVersion 29  
19 -  
20 - lintOptions {  
21 - disable 'InvalidPackage'  
22 - }  
23 -  
24 - defaultConfig {  
25 - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).  
26 - applicationId "de.udos.flutterstatemanagement"  
27 - minSdkVersion 16  
28 - targetSdkVersion 29  
29 - versionCode 1  
30 - versionName "1.0"  
31 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"  
32 - }  
33 -  
34 - buildTypes {  
35 - release {  
36 - // TODO: Add your own signing config for the release build.  
37 - // Signing with the debug keys for now, so `flutter run --release` works.  
38 - signingConfig signingConfigs.debug  
39 - }  
40 - }  
41 -}  
42 -  
43 -flutter {  
44 - source '../..'  
45 -}  
46 -  
47 -dependencies {  
48 - testImplementation 'junit:junit:4.12'  
49 - androidTestImplementation 'androidx.test.ext:junit:1.1.1'  
50 - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'  
51 -}  
1 -<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
2 - package="de.udos.benchmarks">  
3 - <!-- Flutter needs it to communicate with the running application  
4 - to allow setting breakpoints, to provide hot reload, etc.  
5 - -->  
6 - <uses-permission android:name="android.permission.INTERNET"/>  
7 -</manifest>  
1 -<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
2 - package="de.udos.benchmarks">  
3 -  
4 - <!-- The INTERNET permission is required for development. Specifically,  
5 - flutter needs it to communicate with the running application  
6 - to allow setting breakpoints, to provide hot reload, etc.  
7 - -->  
8 - <uses-permission android:name="android.permission.INTERNET"/>  
9 -  
10 - <!-- io.flutter.app.FlutterApplication is an android.app.Application that  
11 - calls FlutterMain.startInitialization(this); in its onCreate method.  
12 - In most cases you can leave this as-is, but you if you want to provide  
13 - additional functionality it is fine to subclass or reimplement  
14 - FlutterApplication and put your custom class here. -->  
15 - <application  
16 - android:name="io.flutter.app.FlutterApplication"  
17 - android:label="benckmark"  
18 - android:icon="@mipmap/ic_launcher">  
19 - <activity  
20 - android:name=".MainActivity"  
21 - android:launchMode="singleTop"  
22 - android:theme="@style/LaunchTheme"  
23 - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"  
24 - android:hardwareAccelerated="true"  
25 - android:windowSoftInputMode="adjustResize">  
26 - <!-- This keeps the window background of the activity showing  
27 - until Flutter renders its first frame. It can be removed if  
28 - there is no splash screen (such as the default splash screen  
29 - defined in @style/LaunchTheme). -->  
30 - <meta-data  
31 - android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"  
32 - android:value="true" />  
33 - <intent-filter>  
34 - <action android:name="android.intent.action.MAIN"/>  
35 - <category android:name="android.intent.category.LAUNCHER"/>  
36 - </intent-filter>  
37 - </activity>  
38 - </application>  
39 -</manifest>  
1 -package de.udos.benchmarks;  
2 -  
3 -import android.os.Bundle;  
4 -import io.flutter.app.FlutterActivity;  
5 -import io.flutter.plugins.GeneratedPluginRegistrant;  
6 -  
7 -public class MainActivity extends FlutterActivity {  
8 - @Override  
9 - protected void onCreate(Bundle savedInstanceState) {  
10 - super.onCreate(savedInstanceState);  
11 - GeneratedPluginRegistrant.registerWith(this);  
12 - }  
13 -}  
1 -package io.flutter.plugins;  
2 -  
3 -import io.flutter.plugin.common.PluginRegistry;  
4 -  
5 -/**  
6 - * Generated file. Do not edit.  
7 - */  
8 -public final class GeneratedPluginRegistrant {  
9 - public static void registerWith(PluginRegistry registry) {  
10 - if (alreadyRegisteredWith(registry)) {  
11 - return;  
12 - }  
13 - }  
14 -  
15 - private static boolean alreadyRegisteredWith(PluginRegistry registry) {  
16 - final String key = GeneratedPluginRegistrant.class.getCanonicalName();  
17 - if (registry.hasPlugin(key)) {  
18 - return true;  
19 - }  
20 - registry.registrarFor(key);  
21 - return false;  
22 - }  
23 -}  
1 -package de.udos.benchmarks  
2 -  
3 -import io.flutter.embedding.android.FlutterActivity  
4 -  
5 -class MainActivity: FlutterActivity() {  
6 -}  
1 -package de.udos.benchs  
2 -  
3 -import io.flutter.embedding.android.FlutterActivity  
4 -  
5 -class MainActivity: FlutterActivity() {  
6 -}  
1 -<?xml version="1.0" encoding="utf-8"?>  
2 -<!-- Modify this file to customize your launch splash screen -->  
3 -<layer-list xmlns:android="http://schemas.android.com/apk/res/android">  
4 - <item android:drawable="@android:color/white" />  
5 -  
6 - <!-- You can insert your own image assets here -->  
7 - <!-- <item>  
8 - <bitmap  
9 - android:gravity="center"  
10 - android:src="@mipmap/launch_image" />  
11 - </item> -->  
12 -</layer-list>  
1 -<?xml version="1.0" encoding="utf-8"?>  
2 -<resources>  
3 - <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">  
4 - <!-- Show a splash screen on the activity. Automatically removed when  
5 - Flutter draws its first frame -->  
6 - <item name="android:windowBackground">@drawable/launch_background</item>  
7 - </style>  
8 -</resources>  
1 -<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
2 - package="de.udos.benchmarks">  
3 - <!-- Flutter needs it to communicate with the running application  
4 - to allow setting breakpoints, to provide hot reload, etc.  
5 - -->  
6 - <uses-permission android:name="android.permission.INTERNET"/>  
7 -</manifest>  
1 -buildscript {  
2 - repositories {  
3 - google()  
4 - jcenter()  
5 - }  
6 -  
7 - dependencies {  
8 - classpath 'com.android.tools.build:gradle:3.5.3'  
9 - }  
10 -}  
11 -  
12 -allprojects {  
13 - repositories {  
14 - google()  
15 - jcenter()  
16 - }  
17 -}  
18 -  
19 -rootProject.buildDir = '../build'  
20 -subprojects {  
21 - project.buildDir = "${rootProject.buildDir}/${project.name}"  
22 -}  
23 -subprojects {  
24 - project.evaluationDependsOn(':app')  
25 -}  
26 -  
27 -task clean(type: Delete) {  
28 - delete rootProject.buildDir  
29 -}  
1 -org.gradle.jvmargs=-Xmx1536M  
2 -android.enableR8=true  
3 -android.useAndroidX=true  
4 -android.enableJetifier=true  
1 -#Sat Jan 11 20:55:27 CET 2020  
2 -distributionBase=GRADLE_USER_HOME  
3 -distributionPath=wrapper/dists  
4 -zipStoreBase=GRADLE_USER_HOME  
5 -zipStorePath=wrapper/dists  
6 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip  
1 -#!/usr/bin/env bash  
2 -  
3 -##############################################################################  
4 -##  
5 -## Gradle start up script for UN*X  
6 -##  
7 -##############################################################################  
8 -  
9 -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.  
10 -DEFAULT_JVM_OPTS=""  
11 -  
12 -APP_NAME="Gradle"  
13 -APP_BASE_NAME=`basename "$0"`  
14 -  
15 -# Use the maximum available, or set MAX_FD != -1 to use that value.  
16 -MAX_FD="maximum"  
17 -  
18 -warn ( ) {  
19 - echo "$*"  
20 -}  
21 -  
22 -die ( ) {  
23 - echo  
24 - echo "$*"  
25 - echo  
26 - exit 1  
27 -}  
28 -  
29 -# OS specific support (must be 'true' or 'false').  
30 -cygwin=false  
31 -msys=false  
32 -darwin=false  
33 -case "`uname`" in  
34 - CYGWIN* )  
35 - cygwin=true  
36 - ;;  
37 - Darwin* )  
38 - darwin=true  
39 - ;;  
40 - MINGW* )  
41 - msys=true  
42 - ;;  
43 -esac  
44 -  
45 -# Attempt to set APP_HOME  
46 -# Resolve links: $0 may be a link  
47 -PRG="$0"  
48 -# Need this for relative symlinks.  
49 -while [ -h "$PRG" ] ; do  
50 - ls=`ls -ld "$PRG"`  
51 - link=`expr "$ls" : '.*-> \(.*\)$'`  
52 - if expr "$link" : '/.*' > /dev/null; then  
53 - PRG="$link"  
54 - else  
55 - PRG=`dirname "$PRG"`"/$link"  
56 - fi  
57 -done  
58 -SAVED="`pwd`"  
59 -cd "`dirname \"$PRG\"`/" >/dev/null  
60 -APP_HOME="`pwd -P`"  
61 -cd "$SAVED" >/dev/null  
62 -  
63 -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar  
64 -  
65 -# Determine the Java command to use to start the JVM.  
66 -if [ -n "$JAVA_HOME" ] ; then  
67 - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then  
68 - # IBM's JDK on AIX uses strange locations for the executables  
69 - JAVACMD="$JAVA_HOME/jre/sh/java"  
70 - else  
71 - JAVACMD="$JAVA_HOME/bin/java"  
72 - fi  
73 - if [ ! -x "$JAVACMD" ] ; then  
74 - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME  
75 -  
76 -Please set the JAVA_HOME variable in your environment to match the  
77 -location of your Java installation."  
78 - fi  
79 -else  
80 - JAVACMD="java"  
81 - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.  
82 -  
83 -Please set the JAVA_HOME variable in your environment to match the  
84 -location of your Java installation."  
85 -fi  
86 -  
87 -# Increase the maximum file descriptors if we can.  
88 -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then  
89 - MAX_FD_LIMIT=`ulimit -H -n`  
90 - if [ $? -eq 0 ] ; then  
91 - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then  
92 - MAX_FD="$MAX_FD_LIMIT"  
93 - fi  
94 - ulimit -n $MAX_FD  
95 - if [ $? -ne 0 ] ; then  
96 - warn "Could not set maximum file descriptor limit: $MAX_FD"  
97 - fi  
98 - else  
99 - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"  
100 - fi  
101 -fi  
102 -  
103 -# For Darwin, add options to specify how the application appears in the dock  
104 -if $darwin; then  
105 - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""  
106 -fi  
107 -  
108 -# For Cygwin, switch paths to Windows format before running java  
109 -if $cygwin ; then  
110 - APP_HOME=`cygpath --path --mixed "$APP_HOME"`  
111 - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`  
112 - JAVACMD=`cygpath --unix "$JAVACMD"`  
113 -  
114 - # We build the pattern for arguments to be converted via cygpath  
115 - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`  
116 - SEP=""  
117 - for dir in $ROOTDIRSRAW ; do  
118 - ROOTDIRS="$ROOTDIRS$SEP$dir"  
119 - SEP="|"  
120 - done  
121 - OURCYGPATTERN="(^($ROOTDIRS))"  
122 - # Add a user-defined pattern to the cygpath arguments  
123 - if [ "$GRADLE_CYGPATTERN" != "" ] ; then  
124 - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"  
125 - fi  
126 - # Now convert the arguments - kludge to limit ourselves to /bin/sh  
127 - i=0  
128 - for arg in "$@" ; do  
129 - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`  
130 - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option  
131 -  
132 - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition  
133 - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`  
134 - else  
135 - eval `echo args$i`="\"$arg\""  
136 - fi  
137 - i=$((i+1))  
138 - done  
139 - case $i in  
140 - (0) set -- ;;  
141 - (1) set -- "$args0" ;;  
142 - (2) set -- "$args0" "$args1" ;;  
143 - (3) set -- "$args0" "$args1" "$args2" ;;  
144 - (4) set -- "$args0" "$args1" "$args2" "$args3" ;;  
145 - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;  
146 - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;  
147 - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;  
148 - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;  
149 - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;  
150 - esac  
151 -fi  
152 -  
153 -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules  
154 -function splitJvmOpts() {  
155 - JVM_OPTS=("$@")  
156 -}  
157 -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS  
158 -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"  
159 -  
160 -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"  
1 -@if "%DEBUG%" == "" @echo off  
2 -@rem ##########################################################################  
3 -@rem  
4 -@rem Gradle startup script for Windows  
5 -@rem  
6 -@rem ##########################################################################  
7 -  
8 -@rem Set local scope for the variables with windows NT shell  
9 -if "%OS%"=="Windows_NT" setlocal  
10 -  
11 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.  
12 -set DEFAULT_JVM_OPTS=  
13 -  
14 -set DIRNAME=%~dp0  
15 -if "%DIRNAME%" == "" set DIRNAME=.  
16 -set APP_BASE_NAME=%~n0  
17 -set APP_HOME=%DIRNAME%  
18 -  
19 -@rem Find java.exe  
20 -if defined JAVA_HOME goto findJavaFromJavaHome  
21 -  
22 -set JAVA_EXE=java.exe  
23 -%JAVA_EXE% -version >NUL 2>&1  
24 -if "%ERRORLEVEL%" == "0" goto init  
25 -  
26 -echo.  
27 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.  
28 -echo.  
29 -echo Please set the JAVA_HOME variable in your environment to match the  
30 -echo location of your Java installation.  
31 -  
32 -goto fail  
33 -  
34 -:findJavaFromJavaHome  
35 -set JAVA_HOME=%JAVA_HOME:"=%  
36 -set JAVA_EXE=%JAVA_HOME%/bin/java.exe  
37 -  
38 -if exist "%JAVA_EXE%" goto init  
39 -  
40 -echo.  
41 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%  
42 -echo.  
43 -echo Please set the JAVA_HOME variable in your environment to match the  
44 -echo location of your Java installation.  
45 -  
46 -goto fail  
47 -  
48 -:init  
49 -@rem Get command-line arguments, handling Windowz variants  
50 -  
51 -if not "%OS%" == "Windows_NT" goto win9xME_args  
52 -if "%@eval[2+2]" == "4" goto 4NT_args  
53 -  
54 -:win9xME_args  
55 -@rem Slurp the command line arguments.  
56 -set CMD_LINE_ARGS=  
57 -set _SKIP=2  
58 -  
59 -:win9xME_args_slurp  
60 -if "x%~1" == "x" goto execute  
61 -  
62 -set CMD_LINE_ARGS=%*  
63 -goto execute  
64 -  
65 -:4NT_args  
66 -@rem Get arguments from the 4NT Shell from JP Software  
67 -set CMD_LINE_ARGS=%$  
68 -  
69 -:execute  
70 -@rem Setup the command line  
71 -  
72 -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar  
73 -  
74 -@rem Execute Gradle  
75 -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%  
76 -  
77 -:end  
78 -@rem End local scope for the variables with windows NT shell  
79 -if "%ERRORLEVEL%"=="0" goto mainEnd  
80 -  
81 -:fail  
82 -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of  
83 -rem the _cmd.exe /c_ return code!  
84 -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1  
85 -exit /b 1  
86 -  
87 -:mainEnd  
88 -if "%OS%"=="Windows_NT" endlocal  
89 -  
90 -:omega  
1 -sdk.dir=/home/jonny/Android/Sdk  
2 -flutter.sdk=/opt/flutter  
3 -flutter.buildMode=profile  
1 -include ':app'  
2 -  
3 -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()  
4 -  
5 -def plugins = new Properties()  
6 -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')  
7 -if (pluginsFile.exists()) {  
8 - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }  
9 -}  
10 -  
11 -plugins.each { name, path ->  
12 - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()  
13 - include ":$name"  
14 - project(":$name").projectDir = pluginDirectory  
15 -}  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>CFBundleDevelopmentRegion</key>  
6 - <string>en</string>  
7 - <key>CFBundleExecutable</key>  
8 - <string>App</string>  
9 - <key>CFBundleIdentifier</key>  
10 - <string>io.flutter.flutter.app</string>  
11 - <key>CFBundleInfoDictionaryVersion</key>  
12 - <string>6.0</string>  
13 - <key>CFBundleName</key>  
14 - <string>App</string>  
15 - <key>CFBundlePackageType</key>  
16 - <string>FMWK</string>  
17 - <key>CFBundleShortVersionString</key>  
18 - <string>1.0</string>  
19 - <key>CFBundleSignature</key>  
20 - <string>????</string>  
21 - <key>CFBundleVersion</key>  
22 - <string>1.0</string>  
23 - <key>MinimumOSVersion</key>  
24 - <string>8.0</string>  
25 -</dict>  
26 -</plist>  
1 -// This is a generated file; do not edit or check into version control.  
2 -FLUTTER_ROOT=/opt/flutter  
3 -FLUTTER_APPLICATION_PATH=/home/jonny/Área de trabalho/getx/benchmark/state_managers  
4 -FLUTTER_TARGET=lib/main.dart  
5 -FLUTTER_BUILD_DIR=build  
6 -SYMROOT=${SOURCE_ROOT}/../build/ios  
7 -OTHER_LDFLAGS=$(inherited) -framework Flutter  
8 -FLUTTER_FRAMEWORK_DIR=/opt/flutter/bin/cache/artifacts/engine/ios  
9 -FLUTTER_BUILD_NAME=1.0.0  
10 -FLUTTER_BUILD_NUMBER=1  
11 -DART_OBFUSCATION=false  
12 -TRACK_WIDGET_CREATION=false  
13 -TREE_SHAKE_ICONS=false  
14 -PACKAGE_CONFIG=.packages  
1 -#!/bin/sh  
2 -# This is a generated file; do not edit or check into version control.  
3 -export "FLUTTER_ROOT=/opt/flutter"  
4 -export "FLUTTER_APPLICATION_PATH=/home/jonny/Área de trabalho/getx/benchmark/state_managers"  
5 -export "FLUTTER_TARGET=lib/main.dart"  
6 -export "FLUTTER_BUILD_DIR=build"  
7 -export "SYMROOT=${SOURCE_ROOT}/../build/ios"  
8 -export "OTHER_LDFLAGS=$(inherited) -framework Flutter"  
9 -export "FLUTTER_FRAMEWORK_DIR=/opt/flutter/bin/cache/artifacts/engine/ios"  
10 -export "FLUTTER_BUILD_NAME=1.0.0"  
11 -export "FLUTTER_BUILD_NUMBER=1"  
12 -export "DART_OBFUSCATION=false"  
13 -export "TRACK_WIDGET_CREATION=false"  
14 -export "TREE_SHAKE_ICONS=false"  
15 -export "PACKAGE_CONFIG=.packages"  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Workspace  
3 - version = "1.0">  
4 - <FileRef  
5 - location = "group:Runner.xcodeproj">  
6 - </FileRef>  
7 -</Workspace>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>IDEDidComputeMac32BitWarning</key>  
6 - <true/>  
7 -</dict>  
8 -</plist>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>PreviewsEnabled</key>  
6 - <false/>  
7 -</dict>  
8 -</plist>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Scheme  
3 - LastUpgradeVersion = "0910"  
4 - version = "1.3">  
5 - <BuildAction  
6 - parallelizeBuildables = "YES"  
7 - buildImplicitDependencies = "YES">  
8 - <BuildActionEntries>  
9 - <BuildActionEntry  
10 - buildForTesting = "YES"  
11 - buildForRunning = "YES"  
12 - buildForProfiling = "YES"  
13 - buildForArchiving = "YES"  
14 - buildForAnalyzing = "YES">  
15 - <BuildableReference  
16 - BuildableIdentifier = "primary"  
17 - BlueprintIdentifier = "97C146ED1CF9000F007C117D"  
18 - BuildableName = "Runner.app"  
19 - BlueprintName = "Runner"  
20 - ReferencedContainer = "container:Runner.xcodeproj">  
21 - </BuildableReference>  
22 - </BuildActionEntry>  
23 - </BuildActionEntries>  
24 - </BuildAction>  
25 - <TestAction  
26 - buildConfiguration = "Debug"  
27 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
28 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
29 - language = ""  
30 - shouldUseLaunchSchemeArgsEnv = "YES">  
31 - <Testables>  
32 - </Testables>  
33 - <MacroExpansion>  
34 - <BuildableReference  
35 - BuildableIdentifier = "primary"  
36 - BlueprintIdentifier = "97C146ED1CF9000F007C117D"  
37 - BuildableName = "Runner.app"  
38 - BlueprintName = "Runner"  
39 - ReferencedContainer = "container:Runner.xcodeproj">  
40 - </BuildableReference>  
41 - </MacroExpansion>  
42 - <AdditionalOptions>  
43 - </AdditionalOptions>  
44 - </TestAction>  
45 - <LaunchAction  
46 - buildConfiguration = "Debug"  
47 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
48 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
49 - language = ""  
50 - launchStyle = "0"  
51 - useCustomWorkingDirectory = "NO"  
52 - ignoresPersistentStateOnLaunch = "NO"  
53 - debugDocumentVersioning = "YES"  
54 - debugServiceExtension = "internal"  
55 - allowLocationSimulation = "YES">  
56 - <BuildableProductRunnable  
57 - runnableDebuggingMode = "0">  
58 - <BuildableReference  
59 - BuildableIdentifier = "primary"  
60 - BlueprintIdentifier = "97C146ED1CF9000F007C117D"  
61 - BuildableName = "Runner.app"  
62 - BlueprintName = "Runner"  
63 - ReferencedContainer = "container:Runner.xcodeproj">  
64 - </BuildableReference>  
65 - </BuildableProductRunnable>  
66 - <AdditionalOptions>  
67 - </AdditionalOptions>  
68 - </LaunchAction>  
69 - <ProfileAction  
70 - buildConfiguration = "Release"  
71 - shouldUseLaunchSchemeArgsEnv = "YES"  
72 - savedToolIdentifier = ""  
73 - useCustomWorkingDirectory = "NO"  
74 - debugDocumentVersioning = "YES">  
75 - <BuildableProductRunnable  
76 - runnableDebuggingMode = "0">  
77 - <BuildableReference  
78 - BuildableIdentifier = "primary"  
79 - BlueprintIdentifier = "97C146ED1CF9000F007C117D"  
80 - BuildableName = "Runner.app"  
81 - BlueprintName = "Runner"  
82 - ReferencedContainer = "container:Runner.xcodeproj">  
83 - </BuildableReference>  
84 - </BuildableProductRunnable>  
85 - </ProfileAction>  
86 - <AnalyzeAction  
87 - buildConfiguration = "Debug">  
88 - </AnalyzeAction>  
89 - <ArchiveAction  
90 - buildConfiguration = "Release"  
91 - revealArchiveInOrganizer = "YES">  
92 - </ArchiveAction>  
93 -</Scheme>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Workspace  
3 - version = "1.0">  
4 - <FileRef  
5 - location = "group:Runner.xcodeproj">  
6 - </FileRef>  
7 -</Workspace>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>IDEDidComputeMac32BitWarning</key>  
6 - <true/>  
7 -</dict>  
8 -</plist>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>PreviewsEnabled</key>  
6 - <false/>  
7 -</dict>  
8 -</plist>  
1 -#import <Flutter/Flutter.h>  
2 -#import <UIKit/UIKit.h>  
3 -  
4 -@interface AppDelegate : FlutterAppDelegate  
5 -  
6 -@end  
1 -#include "AppDelegate.h"  
2 -#include "GeneratedPluginRegistrant.h"  
3 -  
4 -@implementation AppDelegate  
5 -  
6 -- (BOOL)application:(UIApplication *)application  
7 - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
8 - [GeneratedPluginRegistrant registerWithRegistry:self];  
9 - // Override point for customization after application launch.  
10 - return [super application:application didFinishLaunchingWithOptions:launchOptions];  
11 -}  
12 -  
13 -@end  
1 -import UIKit  
2 -import Flutter  
3 -  
4 -@UIApplicationMain  
5 -@objc class AppDelegate: FlutterAppDelegate {  
6 - override func application(  
7 - _ application: UIApplication,  
8 - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?  
9 - ) -> Bool {  
10 - GeneratedPluginRegistrant.register(with: self)  
11 - return super.application(application, didFinishLaunchingWithOptions: launchOptions)  
12 - }  
13 -}  
1 -{  
2 - "images" : [  
3 - {  
4 - "size" : "20x20",  
5 - "idiom" : "iphone",  
6 - "filename" : "Icon-App-20x20@2x.png",  
7 - "scale" : "2x"  
8 - },  
9 - {  
10 - "size" : "20x20",  
11 - "idiom" : "iphone",  
12 - "filename" : "Icon-App-20x20@3x.png",  
13 - "scale" : "3x"  
14 - },  
15 - {  
16 - "size" : "29x29",  
17 - "idiom" : "iphone",  
18 - "filename" : "Icon-App-29x29@1x.png",  
19 - "scale" : "1x"  
20 - },  
21 - {  
22 - "size" : "29x29",  
23 - "idiom" : "iphone",  
24 - "filename" : "Icon-App-29x29@2x.png",  
25 - "scale" : "2x"  
26 - },  
27 - {  
28 - "size" : "29x29",  
29 - "idiom" : "iphone",  
30 - "filename" : "Icon-App-29x29@3x.png",  
31 - "scale" : "3x"  
32 - },  
33 - {  
34 - "size" : "40x40",  
35 - "idiom" : "iphone",  
36 - "filename" : "Icon-App-40x40@2x.png",  
37 - "scale" : "2x"  
38 - },  
39 - {  
40 - "size" : "40x40",  
41 - "idiom" : "iphone",  
42 - "filename" : "Icon-App-40x40@3x.png",  
43 - "scale" : "3x"  
44 - },  
45 - {  
46 - "size" : "60x60",  
47 - "idiom" : "iphone",  
48 - "filename" : "Icon-App-60x60@2x.png",  
49 - "scale" : "2x"  
50 - },  
51 - {  
52 - "size" : "60x60",  
53 - "idiom" : "iphone",  
54 - "filename" : "Icon-App-60x60@3x.png",  
55 - "scale" : "3x"  
56 - },  
57 - {  
58 - "size" : "20x20",  
59 - "idiom" : "ipad",  
60 - "filename" : "Icon-App-20x20@1x.png",  
61 - "scale" : "1x"  
62 - },  
63 - {  
64 - "size" : "20x20",  
65 - "idiom" : "ipad",  
66 - "filename" : "Icon-App-20x20@2x.png",  
67 - "scale" : "2x"  
68 - },  
69 - {  
70 - "size" : "29x29",  
71 - "idiom" : "ipad",  
72 - "filename" : "Icon-App-29x29@1x.png",  
73 - "scale" : "1x"  
74 - },  
75 - {  
76 - "size" : "29x29",  
77 - "idiom" : "ipad",  
78 - "filename" : "Icon-App-29x29@2x.png",  
79 - "scale" : "2x"  
80 - },  
81 - {  
82 - "size" : "40x40",  
83 - "idiom" : "ipad",  
84 - "filename" : "Icon-App-40x40@1x.png",  
85 - "scale" : "1x"  
86 - },  
87 - {  
88 - "size" : "40x40",  
89 - "idiom" : "ipad",  
90 - "filename" : "Icon-App-40x40@2x.png",  
91 - "scale" : "2x"  
92 - },  
93 - {  
94 - "size" : "76x76",  
95 - "idiom" : "ipad",  
96 - "filename" : "Icon-App-76x76@1x.png",  
97 - "scale" : "1x"  
98 - },  
99 - {  
100 - "size" : "76x76",  
101 - "idiom" : "ipad",  
102 - "filename" : "Icon-App-76x76@2x.png",  
103 - "scale" : "2x"  
104 - },  
105 - {  
106 - "size" : "83.5x83.5",  
107 - "idiom" : "ipad",  
108 - "filename" : "Icon-App-83.5x83.5@2x.png",  
109 - "scale" : "2x"  
110 - },  
111 - {  
112 - "size" : "1024x1024",  
113 - "idiom" : "ios-marketing",  
114 - "filename" : "Icon-App-1024x1024@1x.png",  
115 - "scale" : "1x"  
116 - }  
117 - ],  
118 - "info" : {  
119 - "version" : 1,  
120 - "author" : "xcode"  
121 - }  
122 -}  
1 -{  
2 - "images" : [  
3 - {  
4 - "idiom" : "universal",  
5 - "filename" : "LaunchImage.png",  
6 - "scale" : "1x"  
7 - },  
8 - {  
9 - "idiom" : "universal",  
10 - "filename" : "LaunchImage@2x.png",  
11 - "scale" : "2x"  
12 - },  
13 - {  
14 - "idiom" : "universal",  
15 - "filename" : "LaunchImage@3x.png",  
16 - "scale" : "3x"  
17 - }  
18 - ],  
19 - "info" : {  
20 - "version" : 1,  
21 - "author" : "xcode"  
22 - }  
23 -}  
1 -# Launch Screen Assets  
2 -  
3 -You can customize the launch screen with your own desired assets by replacing the image files in this directory.  
4 -  
5 -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.  
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">  
3 - <dependencies>  
4 - <deployment identifier="iOS"/>  
5 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>  
6 - </dependencies>  
7 - <scenes>  
8 - <!--View Controller-->  
9 - <scene sceneID="EHf-IW-A2E">  
10 - <objects>  
11 - <viewController id="01J-lp-oVM" sceneMemberID="viewController">  
12 - <layoutGuides>  
13 - <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>  
14 - <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>  
15 - </layoutGuides>  
16 - <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">  
17 - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>  
18 - <subviews>  
19 - <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">  
20 - </imageView>  
21 - </subviews>  
22 - <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>  
23 - <constraints>  
24 - <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>  
25 - <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>  
26 - </constraints>  
27 - </view>  
28 - </viewController>  
29 - <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>  
30 - </objects>  
31 - <point key="canvasLocation" x="53" y="375"/>  
32 - </scene>  
33 - </scenes>  
34 - <resources>  
35 - <image name="LaunchImage" width="168" height="185"/>  
36 - </resources>  
37 -</document>  
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">  
3 - <dependencies>  
4 - <deployment identifier="iOS"/>  
5 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>  
6 - </dependencies>  
7 - <scenes>  
8 - <!--Flutter View Controller-->  
9 - <scene sceneID="tne-QT-ifu">  
10 - <objects>  
11 - <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">  
12 - <layoutGuides>  
13 - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>  
14 - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>  
15 - </layoutGuides>  
16 - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">  
17 - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>  
18 - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>  
19 - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>  
20 - </view>  
21 - </viewController>  
22 - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>  
23 - </objects>  
24 - </scene>  
25 - </scenes>  
26 -</document>  
1 -//  
2 -// Generated file. Do not edit.  
3 -//  
4 -  
5 -#ifndef GeneratedPluginRegistrant_h  
6 -#define GeneratedPluginRegistrant_h  
7 -  
8 -#import <Flutter/Flutter.h>  
9 -  
10 -NS_ASSUME_NONNULL_BEGIN  
11 -  
12 -@interface GeneratedPluginRegistrant : NSObject  
13 -+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;  
14 -@end  
15 -  
16 -NS_ASSUME_NONNULL_END  
17 -#endif /* GeneratedPluginRegistrant_h */  
1 -//  
2 -// Generated file. Do not edit.  
3 -//  
4 -  
5 -#import "GeneratedPluginRegistrant.h"  
6 -  
7 -@implementation GeneratedPluginRegistrant  
8 -  
9 -+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {  
10 -}  
11 -  
12 -@end  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>CFBundleDevelopmentRegion</key>  
6 - <string>en</string>  
7 - <key>CFBundleExecutable</key>  
8 - <string>$(EXECUTABLE_NAME)</string>  
9 - <key>CFBundleIdentifier</key>  
10 - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>  
11 - <key>CFBundleInfoDictionaryVersion</key>  
12 - <string>6.0</string>  
13 - <key>CFBundleName</key>  
14 - <string>benckmark</string>  
15 - <key>CFBundlePackageType</key>  
16 - <string>APPL</string>  
17 - <key>CFBundleShortVersionString</key>  
18 - <string>1.0</string>  
19 - <key>CFBundleSignature</key>  
20 - <string>????</string>  
21 - <key>CFBundleVersion</key>  
22 - <string>1</string>  
23 - <key>LSRequiresIPhoneOS</key>  
24 - <true/>  
25 - <key>UILaunchStoryboardName</key>  
26 - <string>LaunchScreen</string>  
27 - <key>UIMainStoryboardFile</key>  
28 - <string>Main</string>  
29 - <key>UISupportedInterfaceOrientations</key>  
30 - <array>  
31 - <string>UIInterfaceOrientationPortrait</string>  
32 - <string>UIInterfaceOrientationLandscapeLeft</string>  
33 - <string>UIInterfaceOrientationLandscapeRight</string>  
34 - </array>  
35 - <key>UISupportedInterfaceOrientations~ipad</key>  
36 - <array>  
37 - <string>UIInterfaceOrientationPortrait</string>  
38 - <string>UIInterfaceOrientationPortraitUpsideDown</string>  
39 - <string>UIInterfaceOrientationLandscapeLeft</string>  
40 - <string>UIInterfaceOrientationLandscapeRight</string>  
41 - </array>  
42 - <key>UIViewControllerBasedStatusBarAppearance</key>  
43 - <false/>  
44 -</dict>  
45 -</plist>  
1 -#import <Flutter/Flutter.h>  
2 -#import <UIKit/UIKit.h>  
3 -#import "AppDelegate.h"  
4 -  
5 -int main(int argc, char* argv[]) {  
6 - @autoreleasepool {  
7 - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));  
8 - }  
9 -}  
1 -import 'dart:async';  
2 -  
3 -import 'package:bloc/bloc.dart';  
4 -import 'package:benckmark/item.dart';  
5 -  
6 -part 'items_event.dart';  
7 -  
8 -class ItemsBloc extends Bloc<ItemsEvent, List<Item>> {  
9 - ItemsBloc() {  
10 - Timer.periodic(const Duration(milliseconds: 500), (timer) {  
11 - add(AddItemEvent(Item(title: DateTime.now().toString())));  
12 - if (state.length == 10) {  
13 - timer.cancel();  
14 - print("It's done. Print now!");  
15 - }  
16 - });  
17 - }  
18 -  
19 - @override  
20 - List<Item> get initialState => sampleItems;  
21 -  
22 - @override  
23 - Stream<List<Item>> mapEventToState(ItemsEvent event) async* {  
24 - if (event is AddItemEvent) {  
25 - yield List.from(state)..add(event.item);  
26 - }  
27 - }  
28 -}  
1 -part of 'items_bloc.dart';  
2 -  
3 -abstract class ItemsEvent {}  
4 -  
5 -class AddItemEvent extends ItemsEvent {  
6 - AddItemEvent(this.item);  
7 -  
8 - final Item item;  
9 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:flutter_bloc/flutter_bloc.dart';  
3 -import 'package:benckmark/item.dart';  
4 -import 'package:benckmark/_bloc_lib/_blocs/items/items_bloc.dart';  
5 -  
6 -class App extends StatelessWidget {  
7 - Widget build(BuildContext context) {  
8 - return MaterialApp(  
9 - title: 'BLoC Lib Sample',  
10 - theme: ThemeData(primarySwatch: Colors.blue),  
11 - home: BlocProvider(  
12 - create: (_) => ItemsBloc(),  
13 - child: Page(title: 'BLoC Lib Sample'),  
14 - ),  
15 - );  
16 - }  
17 -}  
18 -  
19 -class Page extends StatelessWidget {  
20 - const Page({Key key, this.title}) : super(key: key);  
21 -  
22 - final String title;  
23 -  
24 - @override  
25 - Widget build(BuildContext context) {  
26 - return Scaffold(  
27 - appBar: AppBar(title: Text(title)),  
28 - body: BlocBuilder<ItemsBloc, List<Item>>(  
29 - builder: (context, items) {  
30 - return ListView.builder(  
31 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
32 - itemCount: items.length,  
33 - itemBuilder: (context, index) {  
34 - return ListTile(title: Text(items[index].title));  
35 - },  
36 - );  
37 - },  
38 - ),  
39 - );  
40 - }  
41 -}  
1 -import 'dart:async';  
2 -  
3 -import 'package:benckmark/item.dart';  
4 -import 'package:rxdart/rxdart.dart';  
5 -  
6 -class AddItemEvent {  
7 - final Item item;  
8 -  
9 - AddItemEvent(this.item);  
10 -}  
11 -  
12 -class ItemsBloc {  
13 - final StreamController<dynamic> _itemsEventController = StreamController();  
14 -  
15 - StreamSink<dynamic> get _itemsEventSink => _itemsEventController.sink;  
16 -  
17 - final BehaviorSubject<List<Item>> _itemsStateSubject =  
18 - BehaviorSubject.seeded(sampleItems);  
19 -  
20 - StreamSink<List<Item>> get _itemsStateSink => _itemsStateSubject.sink;  
21 -  
22 - ValueStream<List<Item>> get items => _itemsStateSubject.stream;  
23 -  
24 - List<StreamSubscription<dynamic>> _subscriptions;  
25 -  
26 - ItemsBloc() {  
27 - _subscriptions = <StreamSubscription<dynamic>>[  
28 - _itemsEventController.stream.listen(_mapEventToState)  
29 - ];  
30 - }  
31 -  
32 - dispose() {  
33 - _subscriptions.forEach((subscription) => subscription.cancel());  
34 - _itemsStateSubject.close();  
35 - _itemsEventController.close();  
36 - }  
37 -  
38 - void addItem(Item item) {  
39 - _itemsEventSink.add(AddItemEvent(item));  
40 - }  
41 -  
42 - void _mapEventToState(dynamic event) {  
43 - if (event is AddItemEvent) {  
44 - _itemsStateSink.add([...items.value, event.item]);  
45 - }  
46 - }  
47 -}  
1 -import 'package:flutter/widgets.dart';  
2 -  
3 -import '_bloc.dart';  
4 -  
5 -class ItemsBlocProvider extends InheritedWidget {  
6 - final ItemsBloc bloc;  
7 -  
8 - ItemsBlocProvider({  
9 - Key key,  
10 - Widget child,  
11 - @required this.bloc,  
12 - }) : super(key: key, child: child);  
13 -  
14 - @override  
15 - bool updateShouldNotify(InheritedWidget oldWidget) => true;  
16 -  
17 - static ItemsBloc of(BuildContext context) {  
18 - final provider =  
19 - context.dependOnInheritedWidgetOfExactType<ItemsBlocProvider>();  
20 -  
21 - return provider.bloc;  
22 - }  
23 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:flutter/scheduler.dart';  
3 -import 'package:benckmark/item.dart';  
4 -  
5 -import '_bloc.dart';  
6 -import '_provider.dart';  
7 -  
8 -class App extends StatelessWidget {  
9 - final ItemsBloc itemsBloc = ItemsBloc();  
10 -  
11 - @override  
12 - Widget build(BuildContext context) {  
13 - return ItemsBlocProvider(  
14 - bloc: itemsBloc,  
15 - child: MaterialApp(  
16 - title: 'BLoC Sample',  
17 - theme: ThemeData(  
18 - primarySwatch: Colors.blue,  
19 - ),  
20 - home: Page(title: 'BLoC Sample'),  
21 - ),  
22 - );  
23 - }  
24 -}  
25 -  
26 -class Page extends StatefulWidget {  
27 - Page({Key key, this.title}) : super(key: key);  
28 -  
29 - final String title;  
30 -  
31 - @override  
32 - _PageState createState() => _PageState();  
33 -}  
34 -  
35 -class _PageState extends State<Page> {  
36 - @override  
37 - void initState() {  
38 - SchedulerBinding.instance.addPostFrameCallback((timeStamp) async {  
39 - for (int i = 0; i < 10; i++) {  
40 - await Future.delayed(Duration(milliseconds: 500));  
41 - ItemsBlocProvider.of(context)  
42 - .addItem(Item(title: DateTime.now().toString()));  
43 - }  
44 - print("It's done. Print now!");  
45 - });  
46 -  
47 - super.initState();  
48 - }  
49 -  
50 - @override  
51 - Widget build(BuildContext context) {  
52 - return Scaffold(  
53 - appBar: AppBar(  
54 - title: Text(widget.title),  
55 - ),  
56 - body: ListViewWidget(),  
57 - );  
58 - }  
59 -}  
60 -  
61 -class ListViewWidget extends StatelessWidget {  
62 - @override  
63 - Widget build(BuildContext context) {  
64 - final ItemsBloc itemsBloc = ItemsBlocProvider.of(context);  
65 -  
66 - return StreamBuilder<List<Item>>(  
67 - stream: itemsBloc.items,  
68 - builder: (context, snapshot) {  
69 - final items = snapshot.data;  
70 - return ListView.builder(  
71 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
72 - itemCount: items is List<Item> ? items.length : 0,  
73 - itemBuilder: (context, index) {  
74 - return ListTile(  
75 - title: Text(items[index].title),  
76 - );  
77 - },  
78 - );  
79 - },  
80 - );  
81 - }  
82 -}  
1 -import 'package:benckmark/item.dart';  
2 -import 'package:get/get.dart';  
3 -  
4 -class Controller extends GetController {  
5 - @override  
6 - onInit() async {  
7 - for (int i = 0; i < 10; i++) {  
8 - await Future.delayed(Duration(milliseconds: 500));  
9 - addItem(Item(title: DateTime.now().toString()));  
10 - }  
11 - print("It's done. Print now!");  
12 - super.onInit();  
13 - }  
14 -  
15 - final items = List<Item>.of(sampleItems);  
16 -  
17 - void addItem(Item item) {  
18 - items.add(item);  
19 - update();  
20 - }  
21 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:benckmark/_get/_store.dart';  
3 -import 'package:get/get.dart';  
4 -  
5 -class App extends StatelessWidget {  
6 - @override  
7 - Widget build(BuildContext context) {  
8 - return MaterialApp(  
9 - title: 'Get Sample',  
10 - theme: ThemeData(  
11 - primarySwatch: Colors.blue,  
12 - ),  
13 - home: Page(title: 'Get Sample'),  
14 - );  
15 - }  
16 -}  
17 -  
18 -class Page extends StatelessWidget {  
19 - Page({  
20 - Key key,  
21 - this.title,  
22 - }) : super(key: key);  
23 -  
24 - final String title;  
25 -  
26 - @override  
27 - Widget build(BuildContext context) {  
28 - return Scaffold(  
29 - appBar: AppBar(  
30 - title: Text(title),  
31 - ),  
32 - body: ListViewWidget(),  
33 - );  
34 - }  
35 -}  
36 -  
37 -class ListViewWidget extends StatelessWidget {  
38 - @override  
39 - Widget build(BuildContext context) {  
40 - return GetBuilder<Controller>(  
41 - init: Controller(),  
42 - global: false,  
43 - builder: (_) => ListView.builder(  
44 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
45 - itemCount: _.items.length,  
46 - itemBuilder: (context, index) {  
47 - return ListTile(  
48 - title: Text(_.items[index].title),  
49 - );  
50 - }));  
51 - }  
52 -}  
1 -import 'package:benckmark/item.dart';  
2 -import 'package:get/get.dart';  
3 -  
4 -class Controller extends RxController {  
5 - Controller() {  
6 - onInit();  
7 - }  
8 - final items = sampleItems.obs;  
9 -  
10 - @override  
11 - onInit() async {  
12 - for (int i = 0; i < 10; i++) {  
13 - await Future.delayed(Duration(milliseconds: 500));  
14 - addItem(Item(title: DateTime.now().toString()));  
15 - }  
16 -  
17 - print("It's done. Print now!");  
18 - super.onInit();  
19 - }  
20 -  
21 - void addItem(Item item) {  
22 - items.add(item);  
23 - }  
24 -}  
1 -import 'package:benckmark/_get_rx/_store.dart';  
2 -import 'package:flutter/material.dart';  
3 -import 'package:get/get.dart';  
4 -  
5 -class App extends StatelessWidget {  
6 - @override  
7 - Widget build(BuildContext context) {  
8 - return MaterialApp(  
9 - title: 'GetX Sample',  
10 - theme: ThemeData(  
11 - primarySwatch: Colors.blue,  
12 - ),  
13 - home: Page(title: 'GetX Sample'),  
14 - );  
15 - }  
16 -}  
17 -  
18 -class Page extends StatelessWidget {  
19 - Page({  
20 - Key key,  
21 - this.title,  
22 - }) : super(key: key);  
23 -  
24 - final String title;  
25 -  
26 - @override  
27 - Widget build(BuildContext context) {  
28 - return Scaffold(  
29 - appBar: AppBar(  
30 - title: Text("GetX"),  
31 - ),  
32 - body: ListViewWidget(),  
33 - );  
34 - }  
35 -}  
36 -  
37 -class ListViewWidget extends StatelessWidget {  
38 - final Controller c = Controller();  
39 - @override  
40 - Widget build(BuildContext context) {  
41 - return Obxx(() => ListView.builder(  
42 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
43 - itemCount: c.items.length,  
44 - itemBuilder: (context, index) {  
45 - return ListTile(  
46 - title: Text(c.items[index].title),  
47 - );  
48 - }));  
49 - }  
50 -}  
1 -import 'package:benckmark/item.dart';  
2 -import 'package:mobx/mobx.dart';  
3 -  
4 -part '_store.g.dart';  
5 -  
6 -class AppStore = _AppStore with _$AppStore;  
7 -  
8 -abstract class _AppStore with Store {  
9 - @observable  
10 - ObservableList<Item> items = ObservableList<Item>.of(sampleItems);  
11 -  
12 - @observable  
13 - ObservableSet<String> checkedItemIds = ObservableSet<String>();  
14 -  
15 - @action  
16 - void addItem(Item item) {  
17 - items.add(item);  
18 - }  
19 -}  
1 -// GENERATED CODE - DO NOT MODIFY BY HAND  
2 -  
3 -part of '_store.dart';  
4 -  
5 -// **************************************************************************  
6 -// StoreGenerator  
7 -// **************************************************************************  
8 -  
9 -// ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic  
10 -  
11 -mixin _$AppStore on _AppStore, Store {  
12 - final _$itemsAtom = Atom(name: '_AppStore.items');  
13 -  
14 - @override  
15 - ObservableList<Item> get items {  
16 - _$itemsAtom.context.enforceReadPolicy(_$itemsAtom);  
17 - _$itemsAtom.reportObserved();  
18 - return super.items;  
19 - }  
20 -  
21 - @override  
22 - set items(ObservableList<Item> value) {  
23 - _$itemsAtom.context.conditionallyRunInAction(() {  
24 - super.items = value;  
25 - _$itemsAtom.reportChanged();  
26 - }, _$itemsAtom, name: '${_$itemsAtom.name}_set');  
27 - }  
28 -  
29 - final _$checkedItemIdsAtom = Atom(name: '_AppStore.checkedItemIds');  
30 -  
31 - @override  
32 - ObservableSet<String> get checkedItemIds {  
33 - _$checkedItemIdsAtom.context.enforceReadPolicy(_$checkedItemIdsAtom);  
34 - _$checkedItemIdsAtom.reportObserved();  
35 - return super.checkedItemIds;  
36 - }  
37 -  
38 - @override  
39 - set checkedItemIds(ObservableSet<String> value) {  
40 - _$checkedItemIdsAtom.context.conditionallyRunInAction(() {  
41 - super.checkedItemIds = value;  
42 - _$checkedItemIdsAtom.reportChanged();  
43 - }, _$checkedItemIdsAtom, name: '${_$checkedItemIdsAtom.name}_set');  
44 - }  
45 -  
46 - final _$_AppStoreActionController = ActionController(name: '_AppStore');  
47 -  
48 - @override  
49 - void addItem(Item item) {  
50 - final _$actionInfo = _$_AppStoreActionController.startAction();  
51 - try {  
52 - return super.addItem(item);  
53 - } finally {  
54 - _$_AppStoreActionController.endAction(_$actionInfo);  
55 - }  
56 - }  
57 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:flutter_mobx/flutter_mobx.dart';  
3 -import 'package:benckmark/_mobx/_store.dart';  
4 -import 'package:benckmark/item.dart';  
5 -  
6 -final store = AppStore();  
7 -  
8 -class App extends StatelessWidget {  
9 - @override  
10 - Widget build(BuildContext context) {  
11 - return MaterialApp(  
12 - title: 'MobX Sample',  
13 - theme: ThemeData(  
14 - primarySwatch: Colors.blue,  
15 - ),  
16 - home: Page(title: 'MobX Sample'),  
17 - );  
18 - }  
19 -}  
20 -  
21 -class Page extends StatefulWidget {  
22 - Page({  
23 - Key key,  
24 - this.title,  
25 - }) : super(key: key);  
26 -  
27 - final String title;  
28 -  
29 - @override  
30 - _PageState createState() => _PageState();  
31 -}  
32 -  
33 -class _PageState extends State<Page> {  
34 - @override  
35 - void initState() {  
36 - fill();  
37 - super.initState();  
38 - }  
39 -  
40 - fill() async {  
41 - for (int i = 0; i < 10; i++) {  
42 - await Future.delayed(Duration(milliseconds: 500));  
43 - store.addItem(Item(title: DateTime.now().toString()));  
44 - }  
45 - print("It's done. Print now!");  
46 - }  
47 -  
48 - @override  
49 - Widget build(BuildContext context) {  
50 - return Scaffold(  
51 - appBar: AppBar(  
52 - title: Text(widget.title),  
53 - ),  
54 - body: ListViewWidget(),  
55 - );  
56 - }  
57 -}  
58 -  
59 -class ListViewWidget extends StatelessWidget {  
60 - @override  
61 - Widget build(BuildContext context) {  
62 - return Observer(  
63 - builder: (_) {  
64 - return ListView.builder(  
65 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
66 - itemCount: store.items.length,  
67 - itemBuilder: (context, index) {  
68 - return ListTile(  
69 - title: Text(store.items[index].title),  
70 - );  
71 - },  
72 - );  
73 - },  
74 - );  
75 - }  
76 -}  
1 -import 'package:flutter/foundation.dart';  
2 -import 'package:benckmark/item.dart';  
3 -import 'package:flutter/scheduler.dart';  
4 -  
5 -class AppState with ChangeNotifier {  
6 - AppState() {  
7 - SchedulerBinding.instance.addPostFrameCallback((timeStamp) async {  
8 - for (int i = 0; i < 10; i++) {  
9 - await Future.delayed(Duration(milliseconds: 500));  
10 - addItem(Item(title: DateTime.now().toString()));  
11 - }  
12 - print("It's done. Print now!");  
13 - });  
14 - }  
15 -  
16 - List<Item> _items = sampleItems;  
17 -  
18 - List<Item> get items => _items;  
19 -  
20 - void addItem(Item item) {  
21 - _items.add(item);  
22 -  
23 - notifyListeners();  
24 - }  
25 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:provider/provider.dart';  
3 -  
4 -import '_state.dart';  
5 -  
6 -class App extends StatelessWidget {  
7 - @override  
8 - Widget build(BuildContext context) {  
9 - return ChangeNotifierProvider(  
10 - create: (context) => AppState(),  
11 - child: MaterialApp(  
12 - title: 'Provider Sample',  
13 - theme: ThemeData(  
14 - primarySwatch: Colors.blue,  
15 - ),  
16 - home: Page(title: 'Provider Sample'),  
17 - ),  
18 - );  
19 - }  
20 -}  
21 -  
22 -class Page extends StatelessWidget {  
23 - Page({  
24 - Key key,  
25 - this.title,  
26 - }) : super(key: key);  
27 -  
28 - final String title;  
29 -  
30 - @override  
31 - Widget build(BuildContext context) {  
32 - return Scaffold(  
33 - appBar: AppBar(  
34 - title: Text(title),  
35 - ),  
36 - body: ListViewWidget(),  
37 - );  
38 - }  
39 -}  
40 -  
41 -class ListViewWidget extends StatelessWidget {  
42 - @override  
43 - Widget build(BuildContext context) {  
44 - final state = context.watch<AppState>();  
45 -  
46 - return ListView.builder(  
47 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
48 - itemCount: state.items.length,  
49 - itemBuilder: (context, index) {  
50 - return ListTile(  
51 - title: Text(state.items[index].title),  
52 - );  
53 - },  
54 - );  
55 - }  
56 -}  
1 -import 'package:benckmark/item.dart';  
2 -import 'package:meta/meta.dart';  
3 -  
4 -@immutable  
5 -class AppState {  
6 - final List<Item> items;  
7 -  
8 - AppState({  
9 - this.items,  
10 - });  
11 -  
12 - AppState.initialState() : items = sampleItems;  
13 -}  
14 -  
15 -class AddItemAction {  
16 - Item payload;  
17 -  
18 - AddItemAction({  
19 - this.payload,  
20 - });  
21 -}  
22 -  
23 -AppState appReducer(AppState state, dynamic action) {  
24 - return AppState(items: itemsReducer(state.items, action));  
25 -}  
26 -  
27 -List<Item> itemsReducer(List<Item> state, dynamic action) {  
28 - if (action is AddItemAction) {  
29 - return [...state, action.payload];  
30 - }  
31 -  
32 - return state;  
33 -}  
1 -import 'package:flutter/material.dart';  
2 -import 'package:flutter_redux/flutter_redux.dart';  
3 -import 'package:benckmark/item.dart';  
4 -import 'package:redux/redux.dart';  
5 -import '_store.dart';  
6 -  
7 -final store =  
8 - Store<AppState>(appReducer, initialState: AppState.initialState());  
9 -  
10 -class App extends StatelessWidget {  
11 - @override  
12 - Widget build(BuildContext context) {  
13 - return StoreProvider<AppState>(  
14 - store: store,  
15 - child: MaterialApp(  
16 - title: 'Redux Sample',  
17 - theme: ThemeData(  
18 - primarySwatch: Colors.blue,  
19 - ),  
20 - home: Page(title: 'Redux Sample'),  
21 - ),  
22 - );  
23 - }  
24 -}  
25 -  
26 -class Page extends StatefulWidget {  
27 - Page({  
28 - Key key,  
29 - this.title,  
30 - }) : super(key: key);  
31 -  
32 - final String title;  
33 -  
34 - @override  
35 - _PageState createState() => _PageState();  
36 -}  
37 -  
38 -class _PageState extends State<Page> {  
39 - @override  
40 - void initState() {  
41 - super.initState();  
42 - fill();  
43 - }  
44 -  
45 - fill() async {  
46 - for (int i = 0; i < 10; i++) {  
47 - await Future.delayed(Duration(milliseconds: 500));  
48 - store.dispatch(  
49 - AddItemAction(payload: Item(title: DateTime.now().toString())));  
50 - }  
51 - print("It's done. Print now!");  
52 - }  
53 -  
54 - @override  
55 - Widget build(BuildContext context) {  
56 - return Scaffold(  
57 - appBar: AppBar(  
58 - title: Text(widget.title),  
59 - ),  
60 - body: ListViewWidget(),  
61 - );  
62 - }  
63 -}  
64 -  
65 -class ListViewWidget extends StatelessWidget {  
66 - @override  
67 - Widget build(BuildContext context) {  
68 - return StoreConnector<AppState, List<Item>>(  
69 - converter: (store) => store.state.items,  
70 - builder: (context, items) {  
71 - return ListView.builder(  
72 - padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),  
73 - itemCount: items.length,  
74 - itemBuilder: (context, index) {  
75 - return ListTile(  
76 - title: Text(items[index].title),  
77 - );  
78 - },  
79 - );  
80 - },  
81 - );  
82 - }  
83 -}  
1 -class Item {  
2 - final String title;  
3 -  
4 - Item({  
5 - this.title,  
6 - });  
7 -}  
8 -  
9 -final List<Item> sampleItems = [  
10 - Item(title: 'Item 1'),  
11 - Item(title: 'Item 2'),  
12 - Item(title: 'Item 3')  
13 -];  
1 -import 'package:flutter/widgets.dart';  
2 -  
3 -//import 'package:benckmark/_bloc_plain/app.dart';  
4 -//import 'package:benckmark/_bloc_lib/app.dart';  
5 -//import 'package:benckmark/_mobx/app.dart';  
6 -//import 'package:benckmark/_redux/app.dart';  
7 -//import 'package:benckmark/_get_rx/app.dart';  
8 -  
9 -//import 'package:benckmark/_provider/app.dart';  
10 -import 'package:benckmark/_get/app.dart';  
11 -  
12 -void main() => runApp(App());  
1 -# Generated by pub  
2 -# See https://dart.dev/tools/pub/glossary#lockfile  
3 -packages:  
4 - _fe_analyzer_shared:  
5 - dependency: transitive  
6 - description:  
7 - name: _fe_analyzer_shared  
8 - url: "https://pub.dartlang.org"  
9 - source: hosted  
10 - version: "4.0.0"  
11 - analyzer:  
12 - dependency: transitive  
13 - description:  
14 - name: analyzer  
15 - url: "https://pub.dartlang.org"  
16 - source: hosted  
17 - version: "0.39.10"  
18 - args:  
19 - dependency: transitive  
20 - description:  
21 - name: args  
22 - url: "https://pub.dartlang.org"  
23 - source: hosted  
24 - version: "1.6.0"  
25 - async:  
26 - dependency: transitive  
27 - description:  
28 - name: async  
29 - url: "https://pub.dartlang.org"  
30 - source: hosted  
31 - version: "2.4.2"  
32 - bloc:  
33 - dependency: "direct main"  
34 - description:  
35 - name: bloc  
36 - url: "https://pub.dartlang.org"  
37 - source: hosted  
38 - version: "4.0.0"  
39 - boolean_selector:  
40 - dependency: transitive  
41 - description:  
42 - name: boolean_selector  
43 - url: "https://pub.dartlang.org"  
44 - source: hosted  
45 - version: "2.0.0"  
46 - build:  
47 - dependency: transitive  
48 - description:  
49 - name: build  
50 - url: "https://pub.dartlang.org"  
51 - source: hosted  
52 - version: "1.3.0"  
53 - build_config:  
54 - dependency: transitive  
55 - description:  
56 - name: build_config  
57 - url: "https://pub.dartlang.org"  
58 - source: hosted  
59 - version: "0.4.2"  
60 - build_daemon:  
61 - dependency: transitive  
62 - description:  
63 - name: build_daemon  
64 - url: "https://pub.dartlang.org"  
65 - source: hosted  
66 - version: "2.1.4"  
67 - build_resolvers:  
68 - dependency: transitive  
69 - description:  
70 - name: build_resolvers  
71 - url: "https://pub.dartlang.org"  
72 - source: hosted  
73 - version: "1.3.9"  
74 - build_runner:  
75 - dependency: "direct dev"  
76 - description:  
77 - name: build_runner  
78 - url: "https://pub.dartlang.org"  
79 - source: hosted  
80 - version: "1.10.0"  
81 - build_runner_core:  
82 - dependency: transitive  
83 - description:  
84 - name: build_runner_core  
85 - url: "https://pub.dartlang.org"  
86 - source: hosted  
87 - version: "5.2.0"  
88 - built_collection:  
89 - dependency: transitive  
90 - description:  
91 - name: built_collection  
92 - url: "https://pub.dartlang.org"  
93 - source: hosted  
94 - version: "4.3.2"  
95 - built_value:  
96 - dependency: transitive  
97 - description:  
98 - name: built_value  
99 - url: "https://pub.dartlang.org"  
100 - source: hosted  
101 - version: "7.1.0"  
102 - characters:  
103 - dependency: transitive  
104 - description:  
105 - name: characters  
106 - url: "https://pub.dartlang.org"  
107 - source: hosted  
108 - version: "1.1.0-nullsafety"  
109 - charcode:  
110 - dependency: transitive  
111 - description:  
112 - name: charcode  
113 - url: "https://pub.dartlang.org"  
114 - source: hosted  
115 - version: "1.1.3"  
116 - checked_yaml:  
117 - dependency: transitive  
118 - description:  
119 - name: checked_yaml  
120 - url: "https://pub.dartlang.org"  
121 - source: hosted  
122 - version: "1.0.2"  
123 - clock:  
124 - dependency: transitive  
125 - description:  
126 - name: clock  
127 - url: "https://pub.dartlang.org"  
128 - source: hosted  
129 - version: "1.0.1"  
130 - code_builder:  
131 - dependency: transitive  
132 - description:  
133 - name: code_builder  
134 - url: "https://pub.dartlang.org"  
135 - source: hosted  
136 - version: "3.3.0"  
137 - collection:  
138 - dependency: transitive  
139 - description:  
140 - name: collection  
141 - url: "https://pub.dartlang.org"  
142 - source: hosted  
143 - version: "1.15.0-nullsafety"  
144 - convert:  
145 - dependency: transitive  
146 - description:  
147 - name: convert  
148 - url: "https://pub.dartlang.org"  
149 - source: hosted  
150 - version: "2.1.1"  
151 - crypto:  
152 - dependency: transitive  
153 - description:  
154 - name: crypto  
155 - url: "https://pub.dartlang.org"  
156 - source: hosted  
157 - version: "2.1.5"  
158 - csslib:  
159 - dependency: transitive  
160 - description:  
161 - name: csslib  
162 - url: "https://pub.dartlang.org"  
163 - source: hosted  
164 - version: "0.16.1"  
165 - cupertino_icons:  
166 - dependency: "direct main"  
167 - description:  
168 - name: cupertino_icons  
169 - url: "https://pub.dartlang.org"  
170 - source: hosted  
171 - version: "0.1.3"  
172 - dart_style:  
173 - dependency: transitive  
174 - description:  
175 - name: dart_style  
176 - url: "https://pub.dartlang.org"  
177 - source: hosted  
178 - version: "1.3.6"  
179 - equatable:  
180 - dependency: "direct main"  
181 - description:  
182 - name: equatable  
183 - url: "https://pub.dartlang.org"  
184 - source: hosted  
185 - version: "1.2.0"  
186 - fake_async:  
187 - dependency: transitive  
188 - description:  
189 - name: fake_async  
190 - url: "https://pub.dartlang.org"  
191 - source: hosted  
192 - version: "1.1.0"  
193 - fixnum:  
194 - dependency: transitive  
195 - description:  
196 - name: fixnum  
197 - url: "https://pub.dartlang.org"  
198 - source: hosted  
199 - version: "0.10.11"  
200 - flutter:  
201 - dependency: "direct main"  
202 - description: flutter  
203 - source: sdk  
204 - version: "0.0.0"  
205 - flutter_bloc:  
206 - dependency: "direct main"  
207 - description:  
208 - name: flutter_bloc  
209 - url: "https://pub.dartlang.org"  
210 - source: hosted  
211 - version: "4.0.1"  
212 - flutter_mobx:  
213 - dependency: "direct main"  
214 - description:  
215 - name: flutter_mobx  
216 - url: "https://pub.dartlang.org"  
217 - source: hosted  
218 - version: "0.3.7"  
219 - flutter_redux:  
220 - dependency: "direct main"  
221 - description:  
222 - name: flutter_redux  
223 - url: "https://pub.dartlang.org"  
224 - source: hosted  
225 - version: "0.6.0"  
226 - flutter_test:  
227 - dependency: "direct dev"  
228 - description: flutter  
229 - source: sdk  
230 - version: "0.0.0"  
231 - get:  
232 - dependency: "direct main"  
233 - description:  
234 - name: get  
235 - url: "https://pub.dartlang.org"  
236 - source: hosted  
237 - version: "2.12.5-beta"  
238 - glob:  
239 - dependency: transitive  
240 - description:  
241 - name: glob  
242 - url: "https://pub.dartlang.org"  
243 - source: hosted  
244 - version: "1.2.0"  
245 - graphs:  
246 - dependency: transitive  
247 - description:  
248 - name: graphs  
249 - url: "https://pub.dartlang.org"  
250 - source: hosted  
251 - version: "0.2.0"  
252 - html:  
253 - dependency: transitive  
254 - description:  
255 - name: html  
256 - url: "https://pub.dartlang.org"  
257 - source: hosted  
258 - version: "0.14.0+3"  
259 - http_multi_server:  
260 - dependency: transitive  
261 - description:  
262 - name: http_multi_server  
263 - url: "https://pub.dartlang.org"  
264 - source: hosted  
265 - version: "2.2.0"  
266 - http_parser:  
267 - dependency: transitive  
268 - description:  
269 - name: http_parser  
270 - url: "https://pub.dartlang.org"  
271 - source: hosted  
272 - version: "3.1.4"  
273 - io:  
274 - dependency: transitive  
275 - description:  
276 - name: io  
277 - url: "https://pub.dartlang.org"  
278 - source: hosted  
279 - version: "0.3.4"  
280 - js:  
281 - dependency: transitive  
282 - description:  
283 - name: js  
284 - url: "https://pub.dartlang.org"  
285 - source: hosted  
286 - version: "0.6.2"  
287 - json_annotation:  
288 - dependency: transitive  
289 - description:  
290 - name: json_annotation  
291 - url: "https://pub.dartlang.org"  
292 - source: hosted  
293 - version: "3.0.1"  
294 - logging:  
295 - dependency: transitive  
296 - description:  
297 - name: logging  
298 - url: "https://pub.dartlang.org"  
299 - source: hosted  
300 - version: "0.11.4"  
301 - matcher:  
302 - dependency: transitive  
303 - description:  
304 - name: matcher  
305 - url: "https://pub.dartlang.org"  
306 - source: hosted  
307 - version: "0.12.8"  
308 - meta:  
309 - dependency: "direct main"  
310 - description:  
311 - name: meta  
312 - url: "https://pub.dartlang.org"  
313 - source: hosted  
314 - version: "1.3.0-nullsafety"  
315 - mime:  
316 - dependency: transitive  
317 - description:  
318 - name: mime  
319 - url: "https://pub.dartlang.org"  
320 - source: hosted  
321 - version: "0.9.6+3"  
322 - mobx:  
323 - dependency: "direct main"  
324 - description:  
325 - name: mobx  
326 - url: "https://pub.dartlang.org"  
327 - source: hosted  
328 - version: "0.4.0+4"  
329 - mobx_codegen:  
330 - dependency: "direct dev"  
331 - description:  
332 - name: mobx_codegen  
333 - url: "https://pub.dartlang.org"  
334 - source: hosted  
335 - version: "0.4.2"  
336 - nested:  
337 - dependency: transitive  
338 - description:  
339 - name: nested  
340 - url: "https://pub.dartlang.org"  
341 - source: hosted  
342 - version: "0.0.4"  
343 - node_interop:  
344 - dependency: transitive  
345 - description:  
346 - name: node_interop  
347 - url: "https://pub.dartlang.org"  
348 - source: hosted  
349 - version: "1.1.1"  
350 - node_io:  
351 - dependency: transitive  
352 - description:  
353 - name: node_io  
354 - url: "https://pub.dartlang.org"  
355 - source: hosted  
356 - version: "1.1.1"  
357 - package_config:  
358 - dependency: transitive  
359 - description:  
360 - name: package_config  
361 - url: "https://pub.dartlang.org"  
362 - source: hosted  
363 - version: "1.9.3"  
364 - path:  
365 - dependency: transitive  
366 - description:  
367 - name: path  
368 - url: "https://pub.dartlang.org"  
369 - source: hosted  
370 - version: "1.7.0"  
371 - pedantic:  
372 - dependency: transitive  
373 - description:  
374 - name: pedantic  
375 - url: "https://pub.dartlang.org"  
376 - source: hosted  
377 - version: "1.9.0"  
378 - pool:  
379 - dependency: transitive  
380 - description:  
381 - name: pool  
382 - url: "https://pub.dartlang.org"  
383 - source: hosted  
384 - version: "1.4.0"  
385 - provider:  
386 - dependency: "direct main"  
387 - description:  
388 - name: provider  
389 - url: "https://pub.dartlang.org"  
390 - source: hosted  
391 - version: "4.1.3"  
392 - pub_semver:  
393 - dependency: transitive  
394 - description:  
395 - name: pub_semver  
396 - url: "https://pub.dartlang.org"  
397 - source: hosted  
398 - version: "1.4.4"  
399 - pubspec_parse:  
400 - dependency: transitive  
401 - description:  
402 - name: pubspec_parse  
403 - url: "https://pub.dartlang.org"  
404 - source: hosted  
405 - version: "0.1.5"  
406 - quiver:  
407 - dependency: transitive  
408 - description:  
409 - name: quiver  
410 - url: "https://pub.dartlang.org"  
411 - source: hosted  
412 - version: "2.1.3"  
413 - redux:  
414 - dependency: "direct main"  
415 - description:  
416 - name: redux  
417 - url: "https://pub.dartlang.org"  
418 - source: hosted  
419 - version: "4.0.0"  
420 - rxdart:  
421 - dependency: "direct main"  
422 - description:  
423 - name: rxdart  
424 - url: "https://pub.dartlang.org"  
425 - source: hosted  
426 - version: "0.23.1"  
427 - shelf:  
428 - dependency: transitive  
429 - description:  
430 - name: shelf  
431 - url: "https://pub.dartlang.org"  
432 - source: hosted  
433 - version: "0.7.5"  
434 - shelf_web_socket:  
435 - dependency: transitive  
436 - description:  
437 - name: shelf_web_socket  
438 - url: "https://pub.dartlang.org"  
439 - source: hosted  
440 - version: "0.2.3"  
441 - sky_engine:  
442 - dependency: transitive  
443 - description: flutter  
444 - source: sdk  
445 - version: "0.0.99"  
446 - source_gen:  
447 - dependency: transitive  
448 - description:  
449 - name: source_gen  
450 - url: "https://pub.dartlang.org"  
451 - source: hosted  
452 - version: "0.9.5"  
453 - source_span:  
454 - dependency: transitive  
455 - description:  
456 - name: source_span  
457 - url: "https://pub.dartlang.org"  
458 - source: hosted  
459 - version: "1.7.0"  
460 - stack_trace:  
461 - dependency: transitive  
462 - description:  
463 - name: stack_trace  
464 - url: "https://pub.dartlang.org"  
465 - source: hosted  
466 - version: "1.9.5"  
467 - stream_channel:  
468 - dependency: transitive  
469 - description:  
470 - name: stream_channel  
471 - url: "https://pub.dartlang.org"  
472 - source: hosted  
473 - version: "2.0.0"  
474 - stream_transform:  
475 - dependency: transitive  
476 - description:  
477 - name: stream_transform  
478 - url: "https://pub.dartlang.org"  
479 - source: hosted  
480 - version: "1.2.0"  
481 - string_scanner:  
482 - dependency: transitive  
483 - description:  
484 - name: string_scanner  
485 - url: "https://pub.dartlang.org"  
486 - source: hosted  
487 - version: "1.0.5"  
488 - term_glyph:  
489 - dependency: transitive  
490 - description:  
491 - name: term_glyph  
492 - url: "https://pub.dartlang.org"  
493 - source: hosted  
494 - version: "1.1.0"  
495 - test_api:  
496 - dependency: transitive  
497 - description:  
498 - name: test_api  
499 - url: "https://pub.dartlang.org"  
500 - source: hosted  
501 - version: "0.2.17"  
502 - timing:  
503 - dependency: transitive  
504 - description:  
505 - name: timing  
506 - url: "https://pub.dartlang.org"  
507 - source: hosted  
508 - version: "0.1.1+2"  
509 - typed_data:  
510 - dependency: transitive  
511 - description:  
512 - name: typed_data  
513 - url: "https://pub.dartlang.org"  
514 - source: hosted  
515 - version: "1.3.0-nullsafety"  
516 - uuid:  
517 - dependency: "direct main"  
518 - description:  
519 - name: uuid  
520 - url: "https://pub.dartlang.org"  
521 - source: hosted  
522 - version: "2.1.0"  
523 - vector_math:  
524 - dependency: transitive  
525 - description:  
526 - name: vector_math  
527 - url: "https://pub.dartlang.org"  
528 - source: hosted  
529 - version: "2.1.0-nullsafety"  
530 - watcher:  
531 - dependency: transitive  
532 - description:  
533 - name: watcher  
534 - url: "https://pub.dartlang.org"  
535 - source: hosted  
536 - version: "0.9.7+15"  
537 - web_socket_channel:  
538 - dependency: transitive  
539 - description:  
540 - name: web_socket_channel  
541 - url: "https://pub.dartlang.org"  
542 - source: hosted  
543 - version: "1.1.0"  
544 - yaml:  
545 - dependency: transitive  
546 - description:  
547 - name: yaml  
548 - url: "https://pub.dartlang.org"  
549 - source: hosted  
550 - version: "2.2.1"  
551 -sdks:  
552 - dart: ">=2.9.0-18.0 <2.9.0"  
553 - flutter: ">=1.16.0"  
1 -name: benckmark  
2 -description: A new Flutter application showing different kinds of state management.  
3 -  
4 -dependencies:  
5 - flutter:  
6 - sdk: flutter  
7 - cupertino_icons: ^0.1.2  
8 - get: 2.12.5-beta  
9 - bloc: ^4.0.0  
10 - equatable: ^1.0.2  
11 - flutter_bloc: ^4.0.0  
12 - flutter_mobx: ^0.3.6  
13 - flutter_redux: ^0.6.0  
14 - meta:  
15 - mobx: ^0.4.0+1  
16 - provider: ^4.0.1  
17 - redux: ^4.0.0  
18 - rxdart: ^0.23.1  
19 - uuid: ^2.0.4  
20 -  
21 -dev_dependencies:  
22 - flutter_test:  
23 - sdk: flutter  
24 -  
25 - build_runner: ^1.7.3  
26 - mobx_codegen: ^0.4.0+1  
27 -  
28 -  
29 -# For information on the generic Dart part of this file, see the  
30 -# following page: https://www.dartlang.org/tools/pub/pubspec  
31 -  
32 -# The following section is specific to Flutter.  
33 -flutter:  
34 -  
35 - # The following line ensures that the Material Icons font is  
36 - # included with your application, so that you can use the icons in  
37 - # the material Icons class.  
38 - uses-material-design: true  
39 -  
40 - # To add assets to your application, add an assets section, like this:  
41 - # assets:  
42 - # - images/a_dot_burr.jpeg  
43 - # - images/a_dot_ham.jpeg  
44 -  
45 - # An image asset can refer to one or more resolution-specific "variants", see  
46 - # https://flutter.io/assets-and-images/#resolution-aware.  
47 -  
48 - # For details regarding adding assets from package dependencies, see  
49 - # https://flutter.io/assets-and-images/#from-packages  
50 -  
51 - # To add custom fonts to your application, add a fonts section here,  
52 - # in this "flutter" section. Each entry in this list should have a  
53 - # "family" key with the font family name, and a "fonts" key with a  
54 - # list giving the asset and other descriptors for the font. For  
55 - # example:  
56 - # fonts:  
57 - # - family: Schyler  
58 - # fonts:  
59 - # - asset: fonts/Schyler-Regular.ttf  
60 - # - asset: fonts/Schyler-Italic.ttf  
61 - # style: italic  
62 - # - family: Trajan Pro  
63 - # fonts:  
64 - # - asset: fonts/TrajanPro.ttf  
65 - # - asset: fonts/TrajanPro_Bold.ttf  
66 - # weight: 700  
67 - #  
68 - # For details regarding fonts from package dependencies,  
69 - # see https://flutter.io/custom-fonts/#from-packages