Renat

translation of route_management.md on russian

1 -- [Route Management](#route-management)  
2 - - [How to use](#how-to-use)  
3 - - [Navigation without named routes](#navigation-without-named-routes)  
4 - - [Navigation with named routes](#navigation-with-named-routes)  
5 - - [Send data to named Routes](#send-data-to-named-routes)  
6 - - [Dynamic urls links](#dynamic-urls-links) 1 +- [Управление маршрутами](#управление-маршрутами)
  2 + - [Как использовать](#как-использовать)
  3 + - [Навигация без именованных маршрутов](#навигация-без-именованных-маршрутов)
  4 + - [Навигация по именованным маршрутам](#навигация-по-именованным-маршрутам)
  5 + - [Отправить данные по именованному маршруту](#отправить-данные-по-именованному-маршруту)
  6 + - [Динамические url-ссылки](#динамические-url-ссылки)
7 - [Middleware](#middleware) 7 - [Middleware](#middleware)
8 - - [Navigation without context](#navigation-without-context) 8 + - [Навигация без контекста](#навигация-без-контекста)
9 - [SnackBars](#snackbars) 9 - [SnackBars](#snackbars)
10 - [Dialogs](#dialogs) 10 - [Dialogs](#dialogs)
11 - [BottomSheets](#bottomsheets) 11 - [BottomSheets](#bottomsheets)
12 - - [Nested Navigation](#nested-navigation) 12 + - [Вложенная навигация](#вложенная-навигация)
13 13
14 -# Route Management 14 +# Управление маршрутами
15 15
16 -This is the complete explanation of all there is to Getx when the matter is route management. 16 +Это полное объяснение всего, что нужно Getx, когда речь идет об управлении маршрутами.
17 17
18 -## How to use 18 +## Как использовать
19 19
20 -Add this to your pubspec.yaml file: 20 +Добавьте к вашему pubspec.yaml следующее:
21 21
22 ```yaml 22 ```yaml
23 dependencies: 23 dependencies:
24 get: 24 get:
25 ``` 25 ```
26 26
27 -If you are going to use routes/snackbars/dialogs/bottomsheets without context, or use the high-level Get APIs, you need to simply add "Get" before your MaterialApp, turning it into GetMaterialApp and enjoy! 27 +Если вы собираетесь использовать маршруты/snackbars/dialogs/bottomSheets без контекста или использовать высокоуровневые API Get, вам нужно просто добавить «Get» перед вашим MaterialApp, превратив его в GetMaterialApp!
28 28
29 ```dart 29 ```dart
30 GetMaterialApp( // Before: MaterialApp( 30 GetMaterialApp( // Before: MaterialApp(
@@ -32,55 +32,55 @@ GetMaterialApp( // Before: MaterialApp( @@ -32,55 +32,55 @@ GetMaterialApp( // Before: MaterialApp(
32 ) 32 )
33 ``` 33 ```
34 34
35 -## Navigation without named routes 35 +## Навигация без именованных маршрутов
36 36
37 -To navigate to a new screen: 37 +Для навигации на новый экран:
38 38
39 ```dart 39 ```dart
40 Get.to(NextScreen()); 40 Get.to(NextScreen());
41 ``` 41 ```
42 42
43 -To close snackbars, dialogs, bottomsheets, or anything you would normally close with Navigator.pop(context); 43 +Чтобы закрыть snackbars, диалог, bottomsheets, или все, что вы обычно закрывали с помощью Navigator.pop(context);
44 44
45 ```dart 45 ```dart
46 Get.back(); 46 Get.back();
47 ``` 47 ```
48 48
49 -To go to the next screen and no option to go back to the previous screen (for use in SplashScreens, login screens and etc.) 49 +Для перехода к следующему экрану и отсутствия возможности вернуться к предыдущему экрану (для использования в SplashScreens, экранах входа и т.д.)
50 50
51 ```dart 51 ```dart
52 Get.off(NextScreen()); 52 Get.off(NextScreen());
53 ``` 53 ```
54 54
55 -To go to the next screen and cancel all previous routes (useful in shopping carts, polls, and tests) 55 +Для перехода к следующему экрану и отмены всех предыдущих маршрутов (полезно в корзинах для покупок, опросах и тестах)
56 56
57 ```dart 57 ```dart
58 Get.offAll(NextScreen()); 58 Get.offAll(NextScreen());
59 ``` 59 ```
60 60
61 -To navigate to the next route, and receive or update data as soon as you return from it: 61 +Чтобы перейти к следующему маршруту и ​​получить или обновить данные, как только вы вернетесь с него:
62 62
63 ```dart 63 ```dart
64 var data = await Get.to(Payment()); 64 var data = await Get.to(Payment());
65 ``` 65 ```
66 66
67 -on other screen, send a data for previous route: 67 +отправить данные на предыдущий экран:
68 68
69 ```dart 69 ```dart
70 Get.back(result: 'success'); 70 Get.back(result: 'success');
71 ``` 71 ```
72 72
73 -And use it: 73 +И использовать их:
74 74
75 -ex: 75 +пример:
76 76
77 ```dart 77 ```dart
78 if(data == 'success') madeAnything(); 78 if(data == 'success') madeAnything();
79 ``` 79 ```
80 80
81 -Don't you want to learn our syntax?  
82 -Just change the Navigator (uppercase) to navigator (lowercase), and you will have all the functions of the standard navigation, without having to use context  
83 -Example: 81 +Нет желания учить наш синтаксис?
  82 +Просто измените Navigator(верхний регистр) на navigator (нижний регистр), и вы получите все функции стандартной навигации без использования контекста.
  83 +Пример:
84 84
85 ```dart 85 ```dart
86 86
@@ -109,29 +109,29 @@ Get.to(HomePage()); @@ -109,29 +109,29 @@ Get.to(HomePage());
109 109
110 ``` 110 ```
111 111
112 -## Navigation with named routes 112 +## Навигация по именованным маршрутам
113 113
114 -- If you prefer to navigate by namedRoutes, Get also supports this. 114 +- Если вы предпочитаете перемещаться по именованным маршрутам, Get также поддерживает это.
115 115
116 -To navigate to nextScreen 116 +Для навигации на следующий экран
117 117
118 ```dart 118 ```dart
119 Get.toNamed("/NextScreen"); 119 Get.toNamed("/NextScreen");
120 ``` 120 ```
121 121
122 -To navigate and remove the previous screen from the tree. 122 +Для навигации и удаления предыдущего экрана из дерева.
123 123
124 ```dart 124 ```dart
125 Get.offNamed("/NextScreen"); 125 Get.offNamed("/NextScreen");
126 ``` 126 ```
127 127
128 -To navigate and remove all previous screens from the tree. 128 +Для навигации и удаления всех предыдущих экранов из дерева.
129 129
130 ```dart 130 ```dart
131 Get.offAllNamed("/NextScreen"); 131 Get.offAllNamed("/NextScreen");
132 ``` 132 ```
133 133
134 -To define routes, use GetMaterialApp: 134 +Для определения маршрутов используйте GetMaterialApp:
135 135
136 ```dart 136 ```dart
137 void main() { 137 void main() {
@@ -152,7 +152,7 @@ void main() { @@ -152,7 +152,7 @@ void main() {
152 } 152 }
153 ``` 153 ```
154 154
155 -To handle navigation to non-defined routes (404 error), you can define an unknownRoute page in GetMaterialApp. 155 +Для обработки навигации по неопределенным маршрутам (ошибка 404) вы можете определить страницу unknownRoute в GetMaterialApp.
156 156
157 ```dart 157 ```dart
158 void main() { 158 void main() {
@@ -169,30 +169,30 @@ void main() { @@ -169,30 +169,30 @@ void main() {
169 } 169 }
170 ``` 170 ```
171 171
172 -### Send data to named Routes 172 +### Отправить данные по именованному маршруту
173 173
174 -Just send what you want for arguments. Get accepts anything here, whether it is a String, a Map, a List, or even a class instance. 174 +Просто отправьте то, что хотите в качестве аргументов. Get принимает здесь всё, что угодно, будь то String, Map, List или даже экземпляр класса.
175 175
176 ```dart 176 ```dart
177 Get.toNamed("/NextScreen", arguments: 'Get is the best'); 177 Get.toNamed("/NextScreen", arguments: 'Get is the best');
178 ``` 178 ```
179 179
180 -on your class or controller: 180 +в вашем классе или контроллере:
181 181
182 ```dart 182 ```dart
183 print(Get.arguments); 183 print(Get.arguments);
184 //print out: Get is the best 184 //print out: Get is the best
185 ``` 185 ```
186 186
187 -### Dynamic urls links 187 +### Динамические url-ссылки
188 188
189 -Get offer advanced dynamic urls just like on the Web. Web developers have probably already wanted this feature on Flutter, and most likely have seen a package promise this feature and deliver a totally different syntax than a URL would have on web, but Get also solves that. 189 +Получите расширенные динамические url-адреса, как в Интернете. Веб-разработчики, вероятно, уже хотели эту функцию на Flutter, и, скорее всего, видели, что пакет обещает эту функцию и предоставляет совершенно другой синтаксис, чем url-адрес в Интернете, но Get также решает эту проблему.
190 190
191 ```dart 191 ```dart
192 Get.offAllNamed("/NextScreen?device=phone&id=354&name=Enzo"); 192 Get.offAllNamed("/NextScreen?device=phone&id=354&name=Enzo");
193 ``` 193 ```
194 194
195 -on your controller/bloc/stateful/stateless class: 195 +в вашем controller/bloc/stateful/stateless классе:
196 196
197 ```dart 197 ```dart
198 print(Get.parameters['id']); 198 print(Get.parameters['id']);
@@ -201,7 +201,7 @@ print(Get.parameters['name']); @@ -201,7 +201,7 @@ print(Get.parameters['name']);
201 // out: Enzo 201 // out: Enzo
202 ``` 202 ```
203 203
204 -You can also receive NamedParameters with Get easily: 204 +Вы также можете легко получить именованные параметры с помощью Get:
205 205
206 ```dart 206 ```dart
207 void main() { 207 void main() {
@@ -233,24 +233,24 @@ void main() { @@ -233,24 +233,24 @@ void main() {
233 } 233 }
234 ``` 234 ```
235 235
236 -Send data on route name 236 +Отправьте данные по именованному маршруту
237 237
238 ```dart 238 ```dart
239 Get.toNamed("/profile/34954"); 239 Get.toNamed("/profile/34954");
240 ``` 240 ```
241 241
242 -On second screen take the data by parameter 242 +На втором экране возьмите данные по параметрам
243 243
244 ```dart 244 ```dart
245 print(Get.parameters['user']); 245 print(Get.parameters['user']);
246 // out: 34954 246 // out: 34954
247 ``` 247 ```
248 248
249 -And now, all you need to do is use Get.toNamed() to navigate your named routes, without any context (you can call your routes directly from your BLoC or Controller class), and when your app is compiled to the web, your routes will appear in the url <3 249 +И теперь все, что вам нужно сделать, это использовать Get.toNamed() для навигации по именованным маршрутам без какого-либо контекста (вы можете вызывать свои маршруты непосредственно из класса BLoC или контроллера), а когда ваше приложение будет скомпилировано в Интернете, ваше маршруты появятся в url <3
250 250
251 ### Middleware 251 ### Middleware
252 252
253 -If you want listen Get events to trigger actions, you can to use routingCallback to it 253 +Если вы хотите прослушивать события Get для запуска действий, вы можете использовать для этого routingCallback
254 254
255 ```dart 255 ```dart
256 GetMaterialApp( 256 GetMaterialApp(
@@ -262,7 +262,7 @@ GetMaterialApp( @@ -262,7 +262,7 @@ GetMaterialApp(
262 ) 262 )
263 ``` 263 ```
264 264
265 -If you are not using GetMaterialApp, you can use the manual API to attach Middleware observer. 265 +Если вы не используете GetMaterialApp, вы можете использовать ручной API для подключения наблюдателя.
266 266
267 ```dart 267 ```dart
268 void main() { 268 void main() {
@@ -279,7 +279,7 @@ void main() { @@ -279,7 +279,7 @@ void main() {
279 } 279 }
280 ``` 280 ```
281 281
282 -Create a MiddleWare class 282 +Создайте класс MiddleWare
283 283
284 ```dart 284 ```dart
285 class MiddleWare { 285 class MiddleWare {
@@ -296,7 +296,7 @@ class MiddleWare { @@ -296,7 +296,7 @@ class MiddleWare {
296 } 296 }
297 ``` 297 ```
298 298
299 -Now, use Get on your code: 299 +Теперь используйте Get в своем коде:
300 300
301 ```dart 301 ```dart
302 class First extends StatelessWidget { 302 class First extends StatelessWidget {
@@ -369,11 +369,11 @@ class Third extends StatelessWidget { @@ -369,11 +369,11 @@ class Third extends StatelessWidget {
369 } 369 }
370 ``` 370 ```
371 371
372 -## Navigation without context 372 +## Навигация без контекста
373 373
374 ### SnackBars 374 ### SnackBars
375 375
376 -To have a simple SnackBar with Flutter, you must get the context of Scaffold, or you must use a GlobalKey attached to your Scaffold 376 +Чтобы получить простой SnackBar с Flutter, вы должны получить контекст Scaffold, или вы должны использовать GlobalKey, прикрепленный к вашему Scaffold
377 377
378 ```dart 378 ```dart
379 final snackBar = SnackBar( 379 final snackBar = SnackBar(
@@ -388,13 +388,13 @@ final snackBar = SnackBar( @@ -388,13 +388,13 @@ final snackBar = SnackBar(
388 Scaffold.of(context).showSnackBar(snackBar); 388 Scaffold.of(context).showSnackBar(snackBar);
389 ``` 389 ```
390 390
391 -With Get: 391 +Реализация в Get:
392 392
393 ```dart 393 ```dart
394 Get.snackbar('Hi', 'i am a modern snackbar'); 394 Get.snackbar('Hi', 'i am a modern snackbar');
395 ``` 395 ```
396 396
397 -With Get, all you have to do is call your Get.snackbar from anywhere in your code or customize it however you want! 397 +С Get всё, что вам нужно сделать, это вызвать Get.snackbar из любого места кода или настроить его так, как вы хотите!
398 398
399 ```dart 399 ```dart
400 Get.snackbar( 400 Get.snackbar(
@@ -446,18 +446,18 @@ Get.snackbar( @@ -446,18 +446,18 @@ Get.snackbar(
446 /////////////////////////////////// 446 ///////////////////////////////////
447 ``` 447 ```
448 448
449 -If you prefer the traditional snackbar, or want to customize it from scratch, including adding just one line (Get.snackbar makes use of a mandatory title and message), you can use  
450 -`Get.rawSnackbar();` which provides the RAW API on which Get.snackbar was built. 449 +Если вы предпочитаете традиционный snackbar, или хотите настроить его с нуля, вы можете использовать
  450 +`Get.rawSnackbar();` который предоставляет RAW API, на котором был построен Get.snackbar.
451 451
452 ### Dialogs 452 ### Dialogs
453 453
454 -To open dialog: 454 +Чтобы открыть:
455 455
456 ```dart 456 ```dart
457 Get.dialog(YourDialogWidget()); 457 Get.dialog(YourDialogWidget());
458 ``` 458 ```
459 459
460 -To open default dialog: 460 +Чтобы открыть диалог по умолчанию:
461 461
462 ```dart 462 ```dart
463 Get.defaultDialog( 463 Get.defaultDialog(
@@ -466,15 +466,15 @@ Get.defaultDialog( @@ -466,15 +466,15 @@ Get.defaultDialog(
466 ); 466 );
467 ``` 467 ```
468 468
469 -You can also use Get.generalDialog instead of showGeneralDialog. 469 +Вы также можете использовать Get.generalDialog вместо showGeneralDialog.
470 470
471 -For all other Flutter dialog widgets, including cupertinos, you can use Get.overlayContext instead of context, and open it anywhere in your code.  
472 -For widgets that don't use Overlay, you can use Get.context.  
473 -These two contexts will work in 99% of cases to replace the context of your UI, except for cases where inheritedWidget is used without a navigation context. 471 +Для всех других виджетов диалога Flutter, включая cupertino, вы можете использовать Get.overlayContext вместо контекста и открывать его в любом месте вашего кода.
  472 +Для виджетов, которые не используют Overlay, вы можете использовать Get.context.
  473 +Эти два контекста будут работать в 99% случаев для замены контекста вашего пользовательского интерфейса, за исключением случаев, когда наследуемый виджет используется без контекста навигации.
474 474
475 ### BottomSheets 475 ### BottomSheets
476 476
477 -Get.bottomSheet is like showModalBottomSheet, but don't need of context. 477 +Get.bottomSheet похож на showModalBottomSheet, но не требует контекста.
478 478
479 ```dart 479 ```dart
480 Get.bottomSheet( 480 Get.bottomSheet(
@@ -497,14 +497,14 @@ Get.bottomSheet( @@ -497,14 +497,14 @@ Get.bottomSheet(
497 ); 497 );
498 ``` 498 ```
499 499
500 -## Nested Navigation 500 +## Вложенная навигация
501 501
502 -Get made Flutter's nested navigation even easier.  
503 -You don't need the context, and you will find your navigation stack by Id. 502 +Get сделал вложенную навигацию Flutter еще проще.
  503 +Вам не нужен контекст, и вы найдёте свой стек навигации по Id.
504 504
505 -- NOTE: Creating parallel navigation stacks can be dangerous. The ideal is not to use NestedNavigators, or to use sparingly. If your project requires it, go ahead, but keep in mind that keeping multiple navigation stacks in memory may not be a good idea for RAM consumption. 505 +- ПРИМЕЧАНИЕ: Создание параллельных стеков навигации может быть опасным. В идеале не используйте NestedNavigators или используйте их редко. Если этого требует ваш проект, продолжайте, но имейте в виду, что хранение нескольких стеков навигации в памяти может быть не лучшим решением для потребления оперативной памяти.
506 506
507 -See how simple it is: 507 +Смотрите как это просто:
508 508
509 ```dart 509 ```dart
510 Navigator( 510 Navigator(