{"id":476328,"date":"2026-04-17T12:15:43","date_gmt":"2026-04-17T12:15:43","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=476328"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=476328","title":{"rendered":"\u041a\u0430\u043a \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u043b Flutter-\u043a\u043b\u0438\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0440\u0430\u0437\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0435 happy path"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0441\u0451 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0415\u0441\u0442\u044c <code>Bloc<\/code>, \u0435\u0441\u0442\u044c <code>Dio<\/code>, \u0435\u0441\u0442\u044c <code>go_router<\/code>, \u0435\u0441\u0442\u044c <code>get_it<\/code>. \u0413\u0434\u0435-\u0442\u043e \u0440\u044f\u0434\u043e\u043c \u043b\u0435\u0436\u0430\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0430\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438. \u041d\u0430 \u0434\u0435\u043c\u043e \u044d\u0442\u043e \u0437\u0432\u0443\u0447\u0438\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e: \u201c\u0432\u043e\u0442 UI-\u0441\u043b\u043e\u0439, \u0432\u043e\u0442 data-\u0441\u043b\u043e\u0439, \u0432\u043e\u0442 state management\u201d. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0447\u0442\u0438 \u0441\u0430\u043c\u0430 \u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f.<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u043d\u0435 \u0432\u044b\u0448\u043b\u043e.<\/p>\n<p>\u042f \u0434\u0435\u043b\u0430\u044e Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 pet-\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0442\u0440\u0438 \u044d\u043a\u0440\u0430\u043d\u0430, \u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432, \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u0432\u0445\u043e\u0434, \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0443\u0447\u0435\u0431\u043d\u044b\u0435 \u043a\u0430\u043f\u0441\u0443\u043b\u044b, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e\u0444\u043b\u0430\u0439\u043d-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, WebSocket-\u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0418 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0430\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Flutter, \u0430 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0443\u0447\u0435\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<p>\u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435 \u0438\u0437 \u043b\u044e\u0431\u0432\u0438 \u043a \u201c\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435\u201d, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0448\u0451\u043b \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0435\u0442\u044c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c, \u043d\u043e realtime-\u0441\u043b\u043e\u0439 \u0443\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u0442\u044f\u0436\u0451\u043b\u0430\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0430 UI \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e\u0434\u0432\u0438\u0441\u0448\u0438\u043c;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c, \u0430 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u043d\u0443 identity;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043b\u0435 logout \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0442\u0430\u0440\u044b\u0445 <code>Cubit<\/code>-\u043e\u0432 \u0441\u0430\u043c\u0438 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0447\u0438\u0441\u0442\u044f\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c. \u041d\u0435 \u043f\u0440\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0430 \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 happy path.<\/p>\n<h3>\u0427\u0442\u043e \u0437\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c<\/h3>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0435\u043a \u0443 \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439:<\/p>\n<ul>\n<li>\n<p><code>flutter_bloc<\/code><\/p>\n<\/li>\n<li>\n<p><code>dio<\/code><\/p>\n<\/li>\n<li>\n<p><code>go_router<\/code><\/p>\n<\/li>\n<li>\n<p><code>get_it<\/code><\/p>\n<\/li>\n<li>\n<p>Firebase Auth<\/p>\n<\/li>\n<li>\n<p>WebSocket<\/p>\n<\/li>\n<li>\n<p><code>shared_preferences<\/code><\/p>\n<\/li>\n<li>\n<p><code>flutter_secure_storage<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Flutter \u0431\u0435\u0434\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442. \u041f\u043e\u0434 \u043d\u0435\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0435\u0441\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0438\u0440\u043f\u0438\u0447\u0438, \u043d\u043e \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442 \u0437\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p><code>go_router<\/code> \u0434\u0430\u0451\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a \u0443 \u0442\u0435\u0431\u044f \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438 tab-shell;<\/p>\n<\/li>\n<li>\n<p><code>dio<\/code> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0445\u043e\u0434\u0438\u0442 \u0432 API, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u0440\u0442\u0443\u044e\u0442 \u043f\u043e HTTP, \u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 WebSocket;<\/p>\n<\/li>\n<li>\n<p>Firebase Auth \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 identity, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 access-layer, \u0435\u0441\u043b\u0438 backend \u0436\u0438\u0432\u0451\u0442 \u0441\u0432\u043e\u0435\u0439 \u0436\u0438\u0437\u043d\u044c\u044e;<\/p>\n<\/li>\n<li>\n<p><code>Bloc<\/code> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u043e \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043e\u0442 \u0433\u0440\u044f\u0437\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u201c\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b\u201d \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041e\u043d\u0438 \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.<\/p>\n<h3>1. Firebase \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0434\u043b\u044f identity, \u0430 backend-\u0442\u043e\u043a\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c<\/h3>\n<p>\u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u043b\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u043c.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u044f\u043d\u0443\u0442 \u0432 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u0440\u0430\u0439\u043d\u043e\u0441\u0442\u0435\u0439. \u041b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0434\u0430\u044e\u0442 \u0432\u0441\u0451 Firebase \u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e. \u041b\u0438\u0431\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Firebase \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e auth-\u0441\u0445\u0435\u043c\u0443.<\/p>\n<p>\u042f \u043f\u043e\u0448\u0451\u043b \u043f\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.<\/p>\n<p>Firebase \u0443 \u043c\u0435\u043d\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 identity:<\/p>\n<ul>\n<li>\n<p>email\/password,<\/p>\n<\/li>\n<li>\n<p>Google,<\/p>\n<\/li>\n<li>\n<p>Apple,<\/p>\n<\/li>\n<li>\n<p>anonymous sign-in,<\/p>\n<\/li>\n<li>\n<p>linking \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 Firebase-\u0442\u043e\u043a\u0435\u043d\u0435. \u041e\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 backend JWT.<\/p>\n<p>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: Firebase \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0430 backend \u0443\u0436\u0435 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0436\u0438\u0432\u0451\u0442 \u0432 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f:<\/p>\n<ol>\n<li>\n<p>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Firebase;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 Firebase ID token;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 backend;<\/p>\n<\/li>\n<li>\n<p>backend \u043e\u0442\u0434\u0430\u0451\u0442 \u0443\u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API JWT;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u044c\u0448\u0435 REST \u0438 WebSocket \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u0423 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0447\u0438\u043d.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, backend \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0436\u0451\u0441\u0442\u043a\u043e \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e mobile auth provider. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e Firebase, \u0437\u0430\u0432\u0442\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 identity provider, \u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430. \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 JWT \u043f\u043e\u0442\u043e\u043c \u0443\u0445\u043e\u0434\u0438\u0442 \u0438 \u0432 HTTP, \u0438 \u0432 WebSocket, \u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 backend-\u043f\u0440\u0430\u0432\u0430.<\/p>\n<p>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u043e\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0436\u0438\u0442\u044c \u0441 anonymous flow. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043a \u0441\u0435\u0431\u0435 Google \u0438\u043b\u0438 email-\u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u0438 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u201c\u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0432\u0441\u0451 \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u043c\u201d.<\/p>\n<p>Linking \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0440\u0435\u043d\u0438\u0435: \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<\/p>\n<p>\u0414\u0430, \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 auth-\u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0438 \u0434\u0432\u0435 \u0437\u043e\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>Firebase-token \u043a\u0430\u043a proof of identity;<\/p>\n<\/li>\n<li>\n<p>backend-token \u043a\u0430\u043a \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 access token.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u044d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442: \u201c\u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0436\u0438\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 backend JWT \u0438 \u043d\u0435 \u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 API \u0441\u0440\u0430\u0437\u0443 \u043f\u043e Firebase?\u201d. \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0443 backend \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0430, \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0441\u0432\u043e\u0439 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u0435\u0441\u0441\u0438\u0438. \u041c\u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0443\u044e auth-\u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<h3>2. \u042f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u201c\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u201d \u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0442\u0430\u043a: \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u0437\u043b\u043e\u0433\u0438\u043d\u0438\u043b\u0441\u044f, \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0431\u043d\u0443\u043b\u044e <code>TokenCubit<\/code>, \u043f\u043e\u0442\u043e\u043c <code>UserCubit<\/code>, \u043f\u043e\u0442\u043e\u043c \u043a\u044d\u0448, \u043f\u043e\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b, \u0438 \u0432\u0441\u0451 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0434\u043d\u043e: \u0433\u0434\u0435-\u0442\u043e \u0442\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0443\u0434\u0435\u0448\u044c \u043a\u0443\u0441\u043e\u043a \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>logout -&gt; login \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c;<\/p>\n<\/li>\n<li>\n<p>anonymous -&gt; linked account;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0442\u0443\u0445\u0448\u0438\u0439 \u0442\u043e\u043a\u0435\u043d -&gt; \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0441 \u0443\u0436\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c <code>Cubit<\/code>-\u043e\u0432 \u0440\u0443\u0447\u043d\u0430\u044f \u0437\u0430\u0447\u0438\u0441\u0442\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u043e\u0439. \u0422\u044b \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0448\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u043e \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0435\u0448\u044c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<\/p>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u0441\u0430\u043d\u0438\u0442\u0430\u0440\u043d\u043e\u0439 \u0443\u0431\u043e\u0440\u043a\u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/p>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0433\u0440\u0443\u0431\u043e, \u043d\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0432 <code>AppInitializer<\/code> \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e auth-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043b\u044e\u0447 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>subtree \u0441 <code>MultiBlocProvider<\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e;<\/p>\n<\/li>\n<li>\n<p><code>Cubit<\/code>-\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u0447\u0435\u0440\u0435\u0437 <code>GetIt<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0435\u0441\u043b\u0438 \u0441\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u201c\u043c\u0438\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u201d, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0430\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 runtime-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439. \u041d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u044b\u0439, \u0437\u0430\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u041b\u043e\u0433\u0438\u043d \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430, \u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0434\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 singleton-\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f DI.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0432\u0437\u0430\u043c\u0435\u043d \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 logout\/login \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0431\u0435\u043b\u044c. \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c: \u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u0442\u0430\u043a\u043e\u0439 reset \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u044f\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0434\u0432\u0430 <code>Cubit<\/code>-\u0430, \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442 \u0436\u0438\u0437\u043d\u044c. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0440\u0443\u0447\u043d\u0430\u044f \u0437\u0430\u0447\u0438\u0441\u0442\u043a\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: reset \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">final GlobalKey&lt;_AppInitializerState&gt; appContextKey =    GlobalKey&lt;_AppInitializerState&gt;();class _AppInitializerState extends State&lt;AppInitializer&gt; {  Key _appKey = UniqueKey();  void resetApp() {    setState(() {      _appKey = UniqueKey();    });  }  @override  Widget build(BuildContext context) {    return MultiBlocProvider(      key: _appKey,      providers: ProvidersManager.getAllProviders(),      child: widget.child,    );  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<h3>3. \u0414\u043e\u043b\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0436\u0434\u0430\u0442\u044c \u043f\u043e HTTP \u0438 \u043f\u0435\u0440\u0435\u0432\u0451\u043b \u0432 \u0441\u0445\u0435\u043c\u0443 HTTP + WebSocket<\/h3>\n<p>\u041f\u043e\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u0432\u0441\u0451 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e:<\/p>\n<pre><code class=\"dart\">final response = await dio.post(...);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435:<\/p>\n<ul>\n<li>\n<p>\u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f,<\/p>\n<\/li>\n<li>\n<p>\u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438,<\/p>\n<\/li>\n<\/ul>\n<p>\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0435\u0448\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0448\u044c \u0438\u0445 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 async-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0422\u043e\u0433\u0434\u0430 \u0443 \u0442\u0435\u0431\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e\u0434 \u0434\u043e\u043b\u0433\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 UX.<\/p>\n<p>\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 endpoint \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0451\u043b\u044b\u043c \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430. \u041f\u043e\u043a\u0430 \u0444\u0438\u0447\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f, \u043e\u043d\u0430 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0436\u0438\u0432\u0451\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u201c\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u201d. \u041f\u043e\u0442\u043e\u043c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f, \u0430\u043d\u0430\u043b\u0438\u0437, \u0438 \u043f\u0440\u0435\u0436\u043d\u0438\u0439 endpoint \u0443\u0436\u0435 \u043d\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0440\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434 \u0443\u0442\u044f\u0436\u0435\u043b\u0435\u043d\u0438\u0435 backend-\u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043a\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u043c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b:<\/p>\n<ul>\n<li>\n<p>\u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b,<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0440\u0432\u043d\u044b\u0439 UX,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0430\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0441\u043a\u0430\u0447\u043a\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u0430\u0436\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0430 \u0441\u0445\u0435\u043c\u0430 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u0442\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u043a \u043d\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0415\u0441\u043b\u0438 endpoint \u0441\u0442\u0430\u043b \u0442\u044f\u0436\u0451\u043b\u044b\u043c, \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 background-\u0440\u0435\u0436\u0438\u043c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u043a\u0430\u044f:<\/p>\n<ol>\n<li>\n<p>\u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e HTTP, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u0435\u0434\u0435\u0440 <code>X-Async-Background: true<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>task_id<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043e WebSocket;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c, \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0423\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435: <code>X-Async-Background<\/code> \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u201c\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0445\u0435\u0434\u0435\u0440\u043e\u043c \u0438\u0437 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u201d. \u0417\u0430 \u043d\u0438\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 backend-\u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0434\u0430\u0447\u0438. \u041a\u043b\u0438\u0435\u043d\u0442 \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u0430 \u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u0442 async-\u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u0441\u0430\u043c.<\/p>\n<p>HTTP \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430.<\/p>\n<p>WebSocket \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u0435\u043c \u0432\u0441\u0435\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c: \u201c\u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c, \u043c\u043e\u0436\u0435\u0448\u044c \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u201d.<\/p>\n<p>\u0410 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 REST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0430\u0451\u0442:<\/p>\n<ul>\n<li>\n<p>\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c,<\/p>\n<\/li>\n<li>\n<p>\u0443\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u0440\u0435\u0442\u0440\u0430\u0435\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u0451\u0442 \u0437\u0430\u043f\u0430\u0441 \u043f\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 backend-\u0430. \u041f\u043e\u043a\u0430 endpoint \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0436\u0438\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0451\u043b\u044b\u043c, \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0432\u0441\u044e \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u041f\u043e\u0434 \u044d\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 <code>WSService<\/code>. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u201c\u0441\u0432\u043e\u0439 \u0441\u043e\u043a\u0435\u0442\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u201d, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0436\u0438\u0432\u0451\u0442 \u043d\u0435 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435.<\/p>\n<p>\u041d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>reconnect;<\/p>\n<\/li>\n<li>\n<p>heartbeat;<\/p>\n<\/li>\n<li>\n<p>message queue;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043a\u0446\u0438\u044f \u043d\u0430 lifecycle \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430, \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0430\u0447\u0435 WebSocket \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0445\u0440\u0443\u043f\u043a\u0443\u044e \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0430\u0436\u043d\u043e\u0435.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u043e\u043a\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b \u043d\u0435 \u201c\u043a\u0430\u043d\u0430\u043b\u043e\u043c \u0434\u043b\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439\u201d, \u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441 \u043d\u0438\u043c \u0441\u0442\u0430\u043b\u043e \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0440\u043e \u0441\u0430\u043c backend-\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441 <code>X-Async-Background<\/code> \u043c\u043e\u0433\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u0422\u0430\u043c \u0432\u0430\u0436\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c: \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 background, \u043a\u0430\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <code>task_id<\/code>, \u0438 \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u0437 \u0433\u0440\u044f\u0437\u043d\u043e\u0433\u043e polling.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e HTTP, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 WebSocket<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">Future&lt;Response&gt; postAsync(String path, {dynamic data}) async {  final response = await dio.post(    path,    data: data,    options: Options(headers: {\"X-Async-Background\": \"true\"}),  );  String? taskId = response.data?['meta']?['async_request_id'] as String?;  if (taskId == null) {    throw Exception('Missing async_request_id in response');  }  final completer = Completer&lt;Response&gt;();  Future&lt;void&gt; handleCompletion() async {    final result = await get(      '\/api\/v1\/async_background_response\/$taskId\/?full_response=true',    );    if (!completer.isCompleted) {      completer.complete(result);    }  }  StreamSubscription? subscription;  subscription = WSService()      .dataStream      .where((m) =&gt; m['action'] == 'async_bg' &amp;&amp; m['task_id'] == taskId)      .listen((m) async {    if (m['status'] == 'completed' || m['status'] == 'failed') {      await handleCompletion();      await subscription?.cancel();    }  });  await handleCompletion();  return completer.future;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<h3>4. \u041e\u0444\u043b\u0430\u0439\u043d \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043f\u0440\u043e\u043f\u0430\u043b Wi-Fi, \u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0443\u043c\u0435\u0440\u043b\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h3>\n<p>\u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 online\/offline \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u0442\u044c <code>wifi<\/code> \u0438\u043b\u0438 <code>mobile<\/code>,<\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0438\u0442 online;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442, \u0437\u043d\u0430\u0447\u0438\u0442 offline.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043c\u0430\u043b\u043e. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u0435\u0442\u044c. \u041e\u043d \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u0438 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430:<\/p>\n<ul>\n<li>\n<p>\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0435\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>REST \u0435\u0449\u0451 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0430 realtime \u0443\u0436\u0435 \u0443\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u044f\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u043a\u0435\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u044d\u043a\u0440\u0430\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0436\u0438\u0432\u044b\u043c, \u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0443\u0436\u0435 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0441\u043b\u0435\u043f\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0436\u0451\u0441\u0442\u043a\u0443\u044e, \u043d\u043e \u0447\u0435\u0441\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 online \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0436\u0438\u0432\u044b \u0438 connectivity, \u0438 WebSocket.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c online \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u201c\u0443 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u201d. Online \u0440\u0430\u0432\u0435\u043d \u201c\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u201d.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u043a\u0430 \u0431\u043b\u0438\u0436\u0435 \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c\u0443 UX, \u0430 \u043d\u0435 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 API. \u0414\u0430, \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0442\u0440\u043e\u0433\u043e. \u041d\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0433\u0434\u0435 \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u044b \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 realtime-\u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u044d\u0442\u043e \u0447\u0435\u0441\u0442\u043d\u0435\u0435 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>\u041f\u043e\u0432\u0435\u0440\u0445 \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0431\u0430\u0437\u043e\u0432\u044b\u0439 <code>CachedRepository<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u0444\u043b\u0430\u0439\u043d-\u0441\u043b\u043e\u0439 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0437\u0430\u043b\u0441\u044f \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e.<\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0431\u043e\u0440 \u0438\u0434\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439:<\/p>\n<ul>\n<li>\n<p>\u0435\u0434\u0438\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043a\u044d\u0448-\u043a\u043b\u044e\u0447\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u044e\u0447\u0430;<\/p>\n<\/li>\n<li>\n<p>TTL;<\/p>\n<\/li>\n<li>\n<p>fallback \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u0441\u0435\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p>fallback \u043d\u0430 \u043a\u044d\u0448, \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0443\u043c\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u0430\u044f \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f: \u043a\u044d\u0448 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0431\u044b\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0441\u0442\u0430\u043b \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u043a\u044d\u0448 \u0436\u0438\u0432\u0451\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u201c\u0437\u0434\u0435\u0441\u044c \u044f \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0432 prefs, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u201d, \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0410 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0439 \u0441\u043b\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0447\u0442\u043e \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0432\u0435\u0434\u0451\u043c \u0441\u0435\u0431\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430,<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0447\u0438\u0441\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 logout.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0444\u043b\u0430\u0439\u043d-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c, \u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u043f\u0440\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 &#8212; \u201c\u043f\u043e\u0447\u0435\u043c\u0443 <code>SharedPreferences<\/code>, \u0430 \u043d\u0435 SQLite\/Isar\/Drift?\u201d. \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439: \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043a\u044d\u0448 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 JSON-\u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0431\u044b \u0440\u0435\u0447\u044c \u0448\u043b\u0430 \u043e \u0442\u044f\u0436\u0451\u043b\u043e\u043c offline-first \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u0445 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445, \u044f \u0431\u044b \u0432 \u044d\u0442\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u043b.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: online = connectivity + \u0436\u0438\u0432\u043e\u0439 WebSocket<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">class NetworkState extends Equatable {  final bool isConnectivity;  final bool isWsConnected;  bool get isOnline =&gt; isConnectivity &amp;&amp; isWsConnected;  const NetworkState(this.isConnectivity, this.isWsConnected);}class NetworkCubit extends Cubit&lt;NetworkState&gt; {  NetworkCubit() : super(NetworkState(true, true)) {    Connectivity().onConnectivityChanged.listen((results) async {      final isConnectivity = _checkConnectivity(results);      if (isConnectivity) {        await GetIt.I&lt;AppCubit&gt;().loadData();        await WSService().reconnect();      }      emit(NetworkState(isConnectivity, state.isWsConnected));    });    WSService().statusStream.listen((status) {      emit(NetworkState(        state.isConnectivity,        status == WSStatus.connected,      ));    });  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043a\u044d\u0448\u0435\u043c \u0438 fallback-\u043b\u043e\u0433\u0438\u043a\u043e\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">abstract class CachedRepository&lt;T&gt; {  final String baseKey;  final Duration cacheExpiry;  CachedRepository({    required this.baseKey,    this.cacheExpiry = const Duration(hours: 24),  });  String _generateCacheKey(Map&lt;String, dynamic&gt;? args) {    if (args == null || args.isEmpty) {      return 'cached_repo_${F.version}_$baseKey';    }    final sortedKeys = args.keys.toList()..sort();    var argsString =        sortedKeys.map((key) =&gt; '$key:${args[key]}').join('_');    if (argsString.length &gt; 50) {      argsString = sha256.convert(utf8.encode(argsString))          .toString()          .substring(0, 16);    }    return 'cached_repo_${F.version}_${baseKey}_$argsString';  }  Future&lt;dynamic&gt; fetchFromRemote([Map&lt;String, dynamic&gt;? args]);  T fromJson(dynamic data);  Future&lt;T&gt; getData({bool forceRemote = true, Map&lt;String, dynamic&gt;? args}) async {    final cachePath = _generateCacheKey(args);    if (!GetIt.I&lt;NetworkCubit&gt;().isOnline) {      final cached = await _loadFromCache(cachePath);      if (cached != null) return fromJson(cached);    }    final remote = await fetchFromRemote(args);    await _saveToCache(cachePath, remote);    return fromJson(remote);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<h3>5. \u0412\u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u043d\u043d\u0435\u0440\u0430 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u043b\u043e\u0439 \u0434\u043b\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0441 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u043c\u0438<\/h3>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043c\u044b\u0441\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0434\u043a\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u043a\u043e\u0434\u0430: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u0435\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u0432\u0438\u0434\u0438\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u201c\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u201d, \u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043f\u0438\u043d\u043d\u0435\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u0442\u044c. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u0438\u0442\u0441\u044f 5, 10, 20 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0439 <code>LongProgressCubit<\/code>.<\/p>\n<p>\u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u043e\u0446\u0435\u043d\u043e\u0447\u043d\u0430\u044f \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u0431\u043e\u0440 \u0441\u0442\u0430\u0434\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043a\u0441\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0433\u043e\u043d\u043e\u043a \u0447\u0435\u0440\u0435\u0437 <code>operationId<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0440\u044b\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0442\u0438\u0440\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u044d\u0442\u043e \u043d\u0435 \u201c\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u201d, \u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441, \u0435\u0441\u043b\u0438 backend \u043d\u0435 \u043e\u0442\u0434\u0430\u0451\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 progress.<\/p>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u201c\u0432\u0435\u0447\u043d\u044b\u0439 \u0441\u043f\u0438\u043d\u043d\u0435\u0440 \u0431\u0435\u0437 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439\u201d;<\/p>\n<\/li>\n<li>\n<p>\u201c\u043e\u0446\u0435\u043d\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0434\u0438\u0438 \u0441 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c\u201d,<\/p>\n<\/li>\n<\/ul>\n<p>\u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0434\u043b\u044f \u0436\u0438\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u043d\u043a\u0430\u044f \u0433\u0440\u0430\u043d\u044c. \u0422\u0430\u043a\u043e\u0439 progress \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u0432\u0440\u0430\u043d\u044c\u0451. \u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u0440\u0438\u0441\u0443\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e \u0448\u043a\u0430\u043b\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u043c\u0438\u043d\u0443\u0442\u0443 \u0432\u0438\u0441\u0438\u0442 \u043d\u0430 90%, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u044d\u0442\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 staged-progress \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0433\u0434\u0435 UI \u0447\u0435\u0441\u0442\u043d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0451\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0434\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442.<\/p>\n<p>\u041f\u043e\u0432\u0435\u0440\u0445 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 loader \u201c\u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438\u201d, \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <code>CustomPainter<\/code>. \u0418 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c, \u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u043c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u0430\u0444\u043e\u0440\u0443.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0434\u0451\u0442 \u043c\u0435\u0434\u0438\u0430-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435, \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c, success-\u0441\u0442\u0430\u0434\u0438\u044f \u0442\u043e\u0436\u0435 \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c long-running \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432 UI \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u043a\u0430\u043a \u201c\u044d\u043a\u0440\u0430\u043d \u0434\u0443\u043c\u0430\u0435\u0442\u201d, \u0430 \u043a\u0430\u043a \u201c\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443\u201d.<\/p>\n<p>\u042d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0451\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0451\u0432 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u041c\u044b \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0430\u0442\u0438\u043c \u0441\u0438\u043b\u044b \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f. \u0425\u043e\u0442\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: staged progress \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 \u0433\u043e\u043d\u043e\u043a<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">class ProgressStage {  final String message;  final double progressValue;  const ProgressStage({    required this.message,    required this.progressValue,  });}abstract class LongProgressCubit extends Cubit&lt;LongProgressState&gt; {  final Stopwatch _stopwatch = Stopwatch();  final List&lt;Timer&gt; _activeTimers = [];  int _currentOperationId = 0;  Duration? get approximateDuration;  List&lt;ProgressStage&gt; get progressStages;  int loading() {    _cancelActiveTimers();    _currentOperationId++;    final operationId = _currentOperationId;    _stopwatch      ..reset()      ..start();    emit(LongProgressLoadingState(progressStages.first));    for (int i = 1; i &lt; progressStages.length - 1; i++) {      final delay = Duration(        milliseconds: (approximateDuration!.inMilliseconds *                progressStages[i].progressValue)            .toInt(),      );      _activeTimers.add(Timer(delay, () {        if (operationId != _currentOperationId) return;        emit(LongProgressLoadingState(progressStages[i]));      }));    }    return operationId;  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">class TranslateProgressCubit extends LongProgressCubit {  @override  Duration? get approximateDuration =&gt; const Duration(seconds: 4);  @override  List&lt;ProgressStage&gt; get progressStages =&gt; [    ProgressStage(      message: l10n.entryProgressInit,      progressValue: 0,    ),    ProgressStage(      message: l10n.entryPreprocessing,      progressValue: 0.1,    ),    ProgressStage(      message: l10n.entryProgressPrepare,      progressValue: 0.6,    ),    ProgressStage(      message: l10n.entryProgressDone,      progressValue: 1.0,    ),  ];}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<h3>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u043a: \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044b\u0442\u044c \u201c\u0441\u043f\u0438\u0441\u043a\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u043e\u0432\u201d<\/h3>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e <code>go_router<\/code> \u043d\u0443\u0436\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440. \u041f\u043e\u0442\u043e\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c:<\/p>\n<ul>\n<li>\n<p>tab navigation;<\/p>\n<\/li>\n<li>\n<p>shell-\u044d\u043a\u0440\u0430\u043d\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0442\u043a\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>StatefulShellRoute.indexedStack<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 navigator key \u043f\u043e\u0434 \u0432\u0435\u0442\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 shell-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0431\u0438\u043b\u0434\u0435\u0440 \u0434\u043b\u044f \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u043d\u043e\u0441\u044f\u0442 \u043d\u0430 \u0441\u043b\u0430\u0439\u0434\u044b. \u041d\u043e \u043e\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u0430 \u043a \u0440\u043e\u0441\u0442\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u043f\u043b\u043e\u0441\u043a\u0438\u0439, \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u0442\u0435\u0431\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u043d\u043e, \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u0427\u0442\u043e \u044f \u0431\u044b \u043d\u0435 \u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e<\/h3>\n<p>\u041b\u044e\u0431\u043e\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u043e\u043b\u044c. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0436\u0438\u0442\u044c \u0441\u0432\u043e\u0435\u0439 \u0436\u0438\u0437\u043d\u044c\u044e, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0443\u0437\u0435\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u0430\u043c\u0431\u0438\u0446\u0438\u0439.<\/p>\n<p>\u042f \u0431\u044b \u043d\u0435 \u0441\u0442\u0430\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0430\u0449\u0438\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 Flutter-\u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u043d\u044b\u0439 reset \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435;<\/p>\n<\/li>\n<li>\n<p>WebSocket-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0435\u0441\u043b\u0438 backend \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0436\u0438\u0432\u0451\u0442 \u043d\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u044d\u0448-\u0441\u043b\u043e\u0439 \u043d\u0430 <code>SharedPreferences<\/code>, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 offline-first;<\/p>\n<\/li>\n<li>\n<p>staged-progress, \u0435\u0441\u043b\u0438 backend \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u044b\u0439 hybrid auth, \u0435\u0441\u043b\u0438 \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0432\u0441\u0451 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u201c\u0437\u0432\u0443\u0447\u0438\u0442 \u0432\u0437\u0440\u043e\u0441\u043b\u043e\u201d, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0430\u0447\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f: \u043e\u043d\u043e \u043d\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0430 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0431\u043e\u043b\u044c.<\/p>\n<h3>\u0427\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u044f\u043c\u043e, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c: \u0432 \u0437\u0440\u0435\u043b\u043e\u043c Flutter-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435 \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043c\u0435\u0436\u0434\u0443 <code>Bloc<\/code>, <code>Riverpod<\/code> \u0438 <code>Provider<\/code>.<\/p>\n<p>\u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u0433\u0440\u044f\u0437\u043d\u044b\u0445 \u0437\u043e\u043d\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430 \u0441\u0442\u044b\u043a\u0435 identity \u0438 backend access;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u0435\u0436\u0434\u0443 HTTP \u0438 realtime;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043e\u0444\u043b\u0430\u0439\u043d-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0435 \u201c\u043a\u0430\u043a-\u0442\u043e \u0432\u044b\u0436\u0438\u0442\u044c\u201d, \u0430 \u043f\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043b\u0438\u0431\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043e\u0449\u0443\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c, \u043b\u0438\u0431\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0434\u0435\u043c\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043a\u0430 \u0432\u0441\u0451 \u0438\u0434\u0451\u0442 \u043f\u043e \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u043e\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e.<\/p>\n<p>\u041c\u043d\u0435 \u0438 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f Flutter \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u044b, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u041d\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043d\u0435 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u0443\u044e \u043f\u0440\u0430\u0432\u0434\u0443: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0437\u0430 \u0442\u0435\u0431\u044f, \u043e\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0451\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0436\u0438\u0437\u043d\u044c, \u0443\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u044b \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u201c\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 happy path\u201d, \u0430 \u0433\u0440\u044f\u0437\u043d\u0443\u044e, \u0448\u0443\u043c\u043d\u0443\u044e, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0443\u044e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0437\u0430\u0439\u0434\u0451\u0442, \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e:<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d <code>HTTP + WebSocket<\/code> \u0434\u043b\u044f \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c <code>anonymous -&gt; linked account<\/code>;<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1024656\/\">https:\/\/habr.com\/ru\/articles\/1024656\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0441\u0451 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e.\u0415\u0441\u0442\u044c Bloc, \u0435\u0441\u0442\u044c Dio, \u0435\u0441\u0442\u044c go_router, \u0435\u0441\u0442\u044c get_it. \u0413\u0434\u0435-\u0442\u043e \u0440\u044f\u0434\u043e\u043c \u043b\u0435\u0436\u0430\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0430\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438. \u041d\u0430 \u0434\u0435\u043c\u043e \u044d\u0442\u043e \u0437\u0432\u0443\u0447\u0438\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e: \u201c\u0432\u043e\u0442 UI-\u0441\u043b\u043e\u0439, \u0432\u043e\u0442 data-\u0441\u043b\u043e\u0439, \u0432\u043e\u0442 state management\u201d. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0447\u0442\u0438 \u0441\u0430\u043c\u0430 \u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f.\u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u043d\u0435 \u0432\u044b\u0448\u043b\u043e.\u042f \u0434\u0435\u043b\u0430\u044e Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 pet-\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0442\u0440\u0438 \u044d\u043a\u0440\u0430\u043d\u0430, \u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432, \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u0432\u0445\u043e\u0434, \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0443\u0447\u0435\u0431\u043d\u044b\u0435 \u043a\u0430\u043f\u0441\u0443\u043b\u044b, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e\u0444\u043b\u0430\u0439\u043d-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, WebSocket-\u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0418 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0430\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Flutter, \u0430 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0443\u0447\u0435\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.\u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435 \u0438\u0437 \u043b\u044e\u0431\u0432\u0438 \u043a \u201c\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435\u201d, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445:\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0448\u0451\u043b \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435;\u0441\u0435\u0442\u044c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c, \u043d\u043e realtime-\u0441\u043b\u043e\u0439 \u0443\u043c\u0435\u0440;\u0442\u044f\u0436\u0451\u043b\u0430\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0430 UI \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e\u0434\u0432\u0438\u0441\u0448\u0438\u043c;\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c, \u0430 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u043d\u0443 identity;\u043f\u043e\u0441\u043b\u0435 logout \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0442\u0430\u0440\u044b\u0445 Cubit-\u043e\u0432 \u0441\u0430\u043c\u0438 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0447\u0438\u0441\u0442\u044f\u0442\u0441\u044f.\u041f\u0440\u043e \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c. \u041d\u0435 \u043f\u0440\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0430 \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 happy path.\u0427\u0442\u043e \u0437\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0435\u043a \u0443 \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439:flutter_blocdiogo_routerget_itFirebase AuthWebSocketshared_preferencesflutter_secure_storage\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Flutter \u0431\u0435\u0434\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442. \u041f\u043e\u0434 \u043d\u0435\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0435\u0441\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0438\u0440\u043f\u0438\u0447\u0438, \u043d\u043e \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442 \u0437\u0434\u0430\u043d\u0438\u0435.\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:go_router \u0434\u0430\u0451\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a \u0443 \u0442\u0435\u0431\u044f \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438 tab-shell;dio \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0445\u043e\u0434\u0438\u0442 \u0432 API, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u0440\u0442\u0443\u044e\u0442 \u043f\u043e HTTP, \u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 WebSocket;Firebase Auth \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 identity, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 access-layer, \u0435\u0441\u043b\u0438 backend \u0436\u0438\u0432\u0451\u0442 \u0441\u0432\u043e\u0435\u0439 \u0436\u0438\u0437\u043d\u044c\u044e;Bloc \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u043e \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043e\u0442 \u0433\u0440\u044f\u0437\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.\u0412\u043c\u0435\u0441\u0442\u043e \u201c\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b\u201d \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041e\u043d\u0438 \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.1. Firebase \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0434\u043b\u044f identity, \u0430 backend-\u0442\u043e\u043a\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u043b\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u043c.\u041e\u0431\u044b\u0447\u043d\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u044f\u043d\u0443\u0442 \u0432 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u0440\u0430\u0439\u043d\u043e\u0441\u0442\u0435\u0439. \u041b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0434\u0430\u044e\u0442 \u0432\u0441\u0451 Firebase \u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e. \u041b\u0438\u0431\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Firebase \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e auth-\u0441\u0445\u0435\u043c\u0443.\u042f \u043f\u043e\u0448\u0451\u043b \u043f\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.Firebase \u0443 \u043c\u0435\u043d\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 identity:email\/password,Google,Apple,anonymous sign-in,linking \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c.\u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 Firebase-\u0442\u043e\u043a\u0435\u043d\u0435. \u041e\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 backend JWT.\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: Firebase \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0430 backend \u0443\u0436\u0435 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0436\u0438\u0432\u0451\u0442 \u0432 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.\u0421\u0445\u0435\u043c\u0430 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f:\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Firebase;\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 Firebase ID token;\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 backend;backend \u043e\u0442\u0434\u0430\u0451\u0442 \u0443\u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API JWT;\u0434\u0430\u043b\u044c\u0448\u0435 REST \u0438 WebSocket \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e.\u0423 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0447\u0438\u043d.\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, backend \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0436\u0451\u0441\u0442\u043a\u043e \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e mobile auth provider. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e Firebase, \u0437\u0430\u0432\u0442\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 identity provider, \u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f.\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430. \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 JWT \u043f\u043e\u0442\u043e\u043c \u0443\u0445\u043e\u0434\u0438\u0442 \u0438 \u0432 HTTP, \u0438 \u0432 WebSocket, \u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 backend-\u043f\u0440\u0430\u0432\u0430.\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u043e\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0436\u0438\u0442\u044c \u0441 anonymous flow. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043a \u0441\u0435\u0431\u0435 Google \u0438\u043b\u0438 email-\u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u0438 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u201c\u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0432\u0441\u0451 \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u043c\u201d.Linking \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0440\u0435\u043d\u0438\u0435: \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443.\u0414\u0430, \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 auth-\u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0438 \u0434\u0432\u0435 \u0437\u043e\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438:Firebase-token \u043a\u0430\u043a proof of identity;backend-token \u043a\u0430\u043a \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 access token.\u041d\u043e \u044d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f.\u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442: \u201c\u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0436\u0438\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 backend JWT \u0438 \u043d\u0435 \u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 API \u0441\u0440\u0430\u0437\u0443 \u043f\u043e Firebase?\u201d. \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0443 backend \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0430, \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0441\u0432\u043e\u0439 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u0435\u0441\u0441\u0438\u0438. \u041c\u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0443\u044e auth-\u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442.2. \u042f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u201c\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u201d \u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0442\u0430\u043a: \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u0437\u043b\u043e\u0433\u0438\u043d\u0438\u043b\u0441\u044f, \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0431\u043d\u0443\u043b\u044e TokenCubit, \u043f\u043e\u0442\u043e\u043c UserCubit, \u043f\u043e\u0442\u043e\u043c \u043a\u044d\u0448, \u043f\u043e\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b, \u0438 \u0432\u0441\u0451 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0434\u043d\u043e: \u0433\u0434\u0435-\u0442\u043e \u0442\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0443\u0434\u0435\u0448\u044c \u043a\u0443\u0441\u043e\u043a \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445:logout -&gt; login \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c;anonymous -&gt; linked account;\u043f\u0440\u043e\u0442\u0443\u0445\u0448\u0438\u0439 \u0442\u043e\u043a\u0435\u043d -&gt; \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438;\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0441 \u0443\u0436\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c.\u042f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c Cubit-\u043e\u0432 \u0440\u0443\u0447\u043d\u0430\u044f \u0437\u0430\u0447\u0438\u0441\u0442\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u043e\u0439. \u0422\u044b \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0448\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u043e \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0435\u0448\u044c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u0441\u0430\u043d\u0438\u0442\u0430\u0440\u043d\u043e\u0439 \u0443\u0431\u043e\u0440\u043a\u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0433\u0440\u0443\u0431\u043e, \u043d\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e:\u0432 AppInitializer \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447;\u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e auth-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043b\u044e\u0447 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f;subtree \u0441 MultiBlocProvider \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e;Cubit-\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u0447\u0435\u0440\u0435\u0437 GetIt.\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0435\u0441\u043b\u0438 \u0441\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u201c\u043c\u0438\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u201d, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0430\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 runtime-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.\u041f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439. \u041d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u043d\u044b\u0439, \u0437\u0430\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u041b\u043e\u0433\u0438\u043d \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\u0414\u0430, \u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b:\u043d\u0430\u0434\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 singleton-\u0430\u043c\u0438;\u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f;\u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f DI.\u041d\u043e \u0432\u0437\u0430\u043c\u0435\u043d \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 logout\/login \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0431\u0435\u043b\u044c. \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438.\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c: \u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u0442\u0430\u043a\u043e\u0439 reset \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u044f\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0434\u0432\u0430 Cubit-\u0430, \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442 \u0436\u0438\u0437\u043d\u044c. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0440\u0443\u0447\u043d\u0430\u044f \u0437\u0430\u0447\u0438\u0441\u0442\u043a\u0430.\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430: reset \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447final GlobalKey&lt;_AppInitializerState&gt; appContextKey =    GlobalKey&lt;_AppInitializerState&gt;();class _AppInitializerState extends State&lt;AppInitializer&gt; {  Key _appKey = UniqueKey();  void resetApp() {    setState(() {      _appKey = UniqueKey();    });  }  @override  Widget build(BuildContext context) {    return MultiBlocProvider(      key: _appKey,      providers: ProvidersManager.getAllProviders(),      child: widget.child,    );  }}3. \u0414\u043e\u043b\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0436\u0434\u0430\u0442\u044c \u043f\u043e HTTP \u0438 \u043f\u0435\u0440\u0435\u0432\u0451\u043b \u0432 \u0441\u0445\u0435\u043c\u0443 HTTP + WebSocket\u041f\u043e\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u0432\u0441\u0451 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e:final response = await dio.post(&#8230;);\u041d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435:\u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430,\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438,\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f,\u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438,\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.\u0425\u043e\u0440\u043e\u0448\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0435\u0448\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0448\u044c \u0438\u0445 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 async-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0422\u043e\u0433\u0434\u0430 \u0443 \u0442\u0435\u0431\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e\u0434 \u0434\u043e\u043b\u0433\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 UX.\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 endpoint \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0451\u043b\u044b\u043c \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430. \u041f\u043e\u043a\u0430 \u0444\u0438\u0447\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f, \u043e\u043d\u0430 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0436\u0438\u0432\u0451\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u201c\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u201d. \u041f\u043e\u0442\u043e\u043c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f, \u0430\u043d\u0430\u043b\u0438\u0437, \u0438 \u043f\u0440\u0435\u0436\u043d\u0438\u0439 endpoint \u0443\u0436\u0435 \u043d\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0440\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f.\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434 \u0443\u0442\u044f\u0436\u0435\u043b\u0435\u043d\u0438\u0435 backend-\u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043a\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442.\u0415\u0441\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u043c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b:\u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b,\u043d\u0435\u0440\u0432\u043d\u044b\u0439 UX,\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430,\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0430\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0441\u043a\u0430\u0447\u043a\u0430\u043c.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u0430\u0436\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0430 \u0441\u0445\u0435\u043c\u0430 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u0442\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u043a \u043d\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0415\u0441\u043b\u0438 endpoint \u0441\u0442\u0430\u043b \u0442\u044f\u0436\u0451\u043b\u044b\u043c, \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 background-\u0440\u0435\u0436\u0438\u043c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u043a\u043e\u0434\u0435.\u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u043a\u0430\u044f:\u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e HTTP, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u0435\u0434\u0435\u0440 X-Async-Background: true;\u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 task_id;\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043e WebSocket;\u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c, \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\u0423\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435: X-Async-Background \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u201c\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0445\u0435\u0434\u0435\u0440\u043e\u043c \u0438\u0437 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u201d. \u0417\u0430 \u043d\u0438\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 backend-\u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0434\u0430\u0447\u0438. \u041a\u043b\u0438\u0435\u043d\u0442 \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u0430 \u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u0442 async-\u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u0441\u0430\u043c.HTTP \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430.WebSocket \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u0435\u043c \u0432\u0441\u0435\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c: \u201c\u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c, \u043c\u043e\u0436\u0435\u0448\u044c \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u201d.\u0410 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 REST-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0430\u0451\u0442:\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443,\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c,\u0443\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a,\u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u0440\u0435\u0442\u0440\u0430\u0435\u0432.\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u0451\u0442 \u0437\u0430\u043f\u0430\u0441 \u043f\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 backend-\u0430. \u041f\u043e\u043a\u0430 endpoint \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0436\u0438\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-476328","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=476328"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476328\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}