Showing
1 changed file
with
10 additions
and
10 deletions
@@ -609,7 +609,7 @@ class Controller extends GetxController { | @@ -609,7 +609,7 @@ class Controller extends GetxController { | ||
609 | 609 | ||
610 | ### Другие способы использования | 610 | ### Другие способы использования |
611 | 611 | ||
612 | -You can use Controller instance directly on GetBuilder value: | 612 | +Вы можете использовать экземпляр контроллера непосредственно со значением GetBuilder: |
613 | 613 | ||
614 | ```dart | 614 | ```dart |
615 | GetBuilder<Controller>( | 615 | GetBuilder<Controller>( |
@@ -620,7 +620,7 @@ GetBuilder<Controller>( | @@ -620,7 +620,7 @@ GetBuilder<Controller>( | ||
620 | ), | 620 | ), |
621 | ``` | 621 | ``` |
622 | 622 | ||
623 | -You may also need an instance of your controller outside of your GetBuilder, and you can use these approaches to achieve this: | 623 | +Вам также может понадобиться экземпляр вашего контроллера вне GetBuilder, и вы можете использовать эти подходы для достижения этой цели: |
624 | 624 | ||
625 | ```dart | 625 | ```dart |
626 | class Controller extends GetxController { | 626 | class Controller extends GetxController { |
@@ -636,7 +636,7 @@ GetBuilder<Controller>( | @@ -636,7 +636,7 @@ GetBuilder<Controller>( | ||
636 | ), | 636 | ), |
637 | ``` | 637 | ``` |
638 | 638 | ||
639 | -or | 639 | +или |
640 | 640 | ||
641 | ```dart | 641 | ```dart |
642 | class Controller extends GetxController { | 642 | class Controller extends GetxController { |
@@ -652,7 +652,7 @@ GetBuilder<Controller>( | @@ -652,7 +652,7 @@ GetBuilder<Controller>( | ||
652 | ), | 652 | ), |
653 | ``` | 653 | ``` |
654 | 654 | ||
655 | -- You can use "non-canonical" approaches to do this. If you are using some other dependency manager, like get_it, modular, etc., and just want to deliver the controller instance, you can do this: | 655 | +- Для этого можно использовать "некакноничные" подходы. Если вы используете какой-либо другой менеджер зависимостей, например get_it, modular и т.д., и просто хотите доставить экземпляр контроллера, вы можете сделать это: |
656 | 656 | ||
657 | ```dart | 657 | ```dart |
658 | Controller controller = Controller(); | 658 | Controller controller = Controller(); |
@@ -666,9 +666,9 @@ GetBuilder<Controller>( | @@ -666,9 +666,9 @@ GetBuilder<Controller>( | ||
666 | 666 | ||
667 | ``` | 667 | ``` |
668 | 668 | ||
669 | -### Unique IDs | 669 | +### Уникальные идентификаторы |
670 | 670 | ||
671 | -If you want to refine a widget's update control with GetBuilder, you can assign them unique IDs: | 671 | +Если вы хотите уточнить элемент управления обновлением виджета с помощью GetBuilder, вы можете назначить им уникальные идентификаторы: |
672 | 672 | ||
673 | ```dart | 673 | ```dart |
674 | GetBuilder<Controller>( | 674 | GetBuilder<Controller>( |
@@ -680,21 +680,21 @@ GetBuilder<Controller>( | @@ -680,21 +680,21 @@ GetBuilder<Controller>( | ||
680 | ), | 680 | ), |
681 | ``` | 681 | ``` |
682 | 682 | ||
683 | -And update it this form: | 683 | +И обновите это следующим образом: |
684 | 684 | ||
685 | ```dart | 685 | ```dart |
686 | update(['text']); | 686 | update(['text']); |
687 | ``` | 687 | ``` |
688 | 688 | ||
689 | -You can also impose conditions for the update: | 689 | +Также можно наложить условия на обновление: |
690 | 690 | ||
691 | ```dart | 691 | ```dart |
692 | update(['text'], counter < 10); | 692 | update(['text'], counter < 10); |
693 | ``` | 693 | ``` |
694 | 694 | ||
695 | -GetX does this automatically and only reconstructs the widget that uses the exact variable that was changed, if you change a variable to the same as the previous one and that does not imply a change of state , GetX will not rebuild the widget to save memory and CPU cycles (3 is being displayed on the screen, and you change the variable to 3 again. In most state managers, this will cause a new rebuild, but with GetX the widget will only is rebuilt again, if in fact his state has changed). | 695 | +GetX делает это автоматически и восстанавливает только виджет, который использует точную переменную, которая была изменена, если вы измените переменную на ту же самую, что и предыдущая, и это не означает изменения состояния, GetX не будет перестраивать виджет для экономии памяти и CPU (На экране отображается 3, и вы снова меняете переменную на 3. В большинстве менеджеров состояний это вызовет новую перестройку, но с GetX виджет будет перестраиваться снова только в том случае, если на самом деле его состояние изменилось). |
696 | 696 | ||
697 | -## Mixing the two state managers | 697 | +## Смешивание двух менеджеров состояний |
698 | 698 | ||
699 | Some people opened a feature request, as they wanted to use only one type of reactive variable, and the other mechanics, and needed to insert an Obx into a GetBuilder for this. Thinking about it MixinBuilder was created. It allows both reactive changes by changing ".obs" variables, and mechanical updates via update(). However, of the 4 widgets he is the one that consumes the most resources, since in addition to having a Subscription to receive change events from his children, he subscribes to the update method of his controller. | 699 | Some people opened a feature request, as they wanted to use only one type of reactive variable, and the other mechanics, and needed to insert an Obx into a GetBuilder for this. Thinking about it MixinBuilder was created. It allows both reactive changes by changing ".obs" variables, and mechanical updates via update(). However, of the 4 widgets he is the one that consumes the most resources, since in addition to having a Subscription to receive change events from his children, he subscribes to the update method of his controller. |
700 | 700 |
-
Please register or login to post a comment