{"id":343442,"date":"2023-01-02T03:00:56","date_gmt":"2023-01-02T03:00:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343442"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343442","title":{"rendered":"<span>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 dart, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u043a\u0435\u0442 weather_pack?<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f dart \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443  <code>weather_pack<\/code>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/pub.dev\/static\/hash-ospklhbd\/img\/pub-dev-icon-cover-image.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>weather_pack | Dart Package<\/span><\/div>\n<p><a href=\"https:\/\/pub.dev\/packages\/weather_pack\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">pub.dev<\/a><\/div>\n<\/div>\n<p>\u041f\u0430\u043a\u0435\u0442 <code>weather_pack<\/code> \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u0443 <a href=\"https:\/\/openweathermap.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/openweathermap.org\/<\/a> (\u0434\u0430\u043b\u0435\u0435, OWM), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e (<a href=\"https:\/\/github.com\/PackRuble\/weather_pack\/blob\/master\/README.md\" rel=\"noopener noreferrer nofollow\">readme.md<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430), \u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u043e\u043d\u0443\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ul>\n<li>\n<p><a href=\"#preface\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#preparatory-stage\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#getting-the-first-weather-data\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#architecture\" rel=\"noopener noreferrer nofollow\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#write-the-code\" rel=\"noopener noreferrer nofollow\">\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#compile\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 .exe<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#afterword\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"foreword\" id=\"foreword\"><\/a><\/p>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0440\u044f\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u0434\u0430\u0447:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 habr \u0432 \u0440\u043e\u043b\u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f dart<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 <code>weather_pack<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430  <code>weather_pack<\/code> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 flutter, \u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 dart. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043c\u044b \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442.<\/p>\n<p><a class=\"anchor\" name=\"preparatory-stage\" id=\"preparatory-stage\"><\/a><\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0435 dart-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">dart create --template=console weather_in_console<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 <code>--template=console<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b <code>pubspec.yaml<\/code>. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">dart pub add weather_pack<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code class=\"yaml\">dependencies:  # \u0438\u0437 pub.dev weather_pack: ^&lt;\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f_\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f_\u0432\u0435\u0440\u0441\u0438\u044f>  # \u0438\u043b\u0438, \u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0441\u043a\u0430\u0447\u0430\u043d \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 weather_pack:   path: .\/\u043f\u0443\u0442\u044c_\u0434\u043e_\u043f\u0430\u043a\u0435\u0442\u0430\/weather_pack    # \u0438\u043b\u0438, \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0438\u0437 github weather_pack: git:   url: https:\/\/github.com\/PackRuble\/weather_pack.git   ref: master<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>dart pub get<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/afc\/07c\/3de\/afc07c3de1d52a05ef0b7b2b98d9a98f.png\" width=\"247\" height=\"336\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/afc\/07c\/3de\/afc07c3de1d52a05ef0b7b2b98d9a98f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c. <\/p>\n<p><a class=\"anchor\" name=\"getting-the-first-weather-data\" id=\"getting-the-first-weather-data\"><\/a><\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <code>0.0.2<\/code> \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u0433\u043e\u0434\u044b: <code>WeatherCurrent<\/code> \u0438 <code>WeatherOneCall<\/code>. \u0412\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f <code>WeatherCurrent<\/code>:<\/p>\n<ol>\n<li>\n<p><code>WeatherCurrent<\/code> &#8212; \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0433\u043e\u0434\u044b<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherHourly><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u0447\u0430\u0441. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 48 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherMinutely><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044f \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>precipitation<\/code> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u0430\u0434\u043a\u043e\u0432 \u0432 \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherDaily><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 7 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherAlert><\/code> &#8212; \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u044f: \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0434\u0430\u0442\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0415\u0449\u0451 \u0435\u0441\u0442\u044c \u0438\u043c\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0438 \u0442\u0435\u0433\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0418 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <code>WeatherOneCall<\/code> \u0434\u043e\u0440\u043e\u0436\u0435 (\u0431\u044b\u043b\u043e \u0442\u0430\u043a: 1000\/\u0434\u0435\u043d\u044c \u0438 30000\/\u043c\u0435\u0441\u044f\u0446). \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f <a href=\"https:\/\/openweathermap.org\/api\/one-call-api\" rel=\"noopener noreferrer nofollow\">One Call API 2.5<\/a> (\u0440\u0430\u043d\u0435\u0435 \u044d\u0442\u043e api \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u043e\u0441\u044c &#171;one call api 2.0&#187; \u0438 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u043e \u0432 \u0441\u0435\u0431\u044f 5-\u0442\u0438 \u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0433\u043e\u0434\u044b. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e 2.0, \u043d\u0430 api \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c90\/518\/5cc\/c905185ccac9561312ada7f05f75de73.png\" width=\"227\" height=\"365\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c90\/518\/5cc\/c905185ccac9561312ada7f05f75de73.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u0430\u0440\u0438\u0444 &#171;one call api 3.0&#187;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 1000 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0434\u0435\u043d\u044c, \u043d\u043e \u043f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430 &#8212; \u043f\u043bO\u0442\u0438. \u0418 \u0432\u043e\u043e\u0431\u0449\u0435, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 \u0442\u0430\u0440\u0438\u0444, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u043d\u0438\u0436\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438 &#8230; &#171;Continue with Stripe&#187; \u043a\u0430\u043a \u0431\u044b \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0435\u043b\u043e. \u041a\u043e\u0440\u043e\u0447\u0435, \u0431\u0438\u0437\u043d\u0435\u0441 \u0438 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433, \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0447\u043d\u043e\u0433\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e7\/8c6\/315\/6e78c6315f4275cb44b450a47e798db2.png\" width=\"1496\" height=\"569\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e7\/8c6\/315\/6e78c6315f4275cb44b450a47e798db2.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043d\u0430\u0448\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherCurrent]. Future&lt;WeatherCurrent> _getWeatherCurrent(PlaceGeocode city) async {   return _wService.currentWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); }  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherOneCall]. Future&lt;WeatherOneCall> _getWeatherOneCall(PlaceGeocode city) async {   return _wService.oneCallWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); } <\/code><\/pre>\n<p>\u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 OWM \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0433\u043e\u0434\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c. \u0420\u0430\u043d\u0435\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0433\u043e\u0440\u043e\u0434, \u043e\u0434\u043d\u0430\u043a\u043e:<\/p>\n<blockquote>\n<p>Please use\u00a0<a href=\"https:\/\/openweathermap.org\/api\/geocoding-api\" rel=\"noopener noreferrer nofollow\"><strong>Geocoder API<\/strong><\/a>\u00a0if you need automatic convert city names and zip-codes to geo coordinates and the other way around.<\/p>\n<p>Please note that\u00a0<a href=\"https:\/\/openweathermap.org\/current#geocoding\" rel=\"noopener noreferrer nofollow\">built-in geocoder<\/a>\u00a0has been deprecated. Although it is still available for use, bug fixing and updates are no longer available for this functionality.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <code>GeocodingService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c (<code>getLocationByCoordinates()<\/code>) \u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<code>getLocationByCityName()<\/code>).<\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><a class=\"anchor\" name=\"architecture\" id=\"architecture\"><\/a><\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u0430\u044f, \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <code>bin\\main.dart<\/code>. \u041a\u043e\u0434 \u0432 \u043d\u0451\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<pre><code class=\"dart\">import 'package:weather_in_console\/weather_in_console.dart' as service_owm;  Future&lt;void> main(List&lt;String> arguments) async {   await service_owm.getWeather(); } <\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043b\u043e\u0433\u0438\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 (\u0438 \u0434\u043e\u043b\u0436\u0435\u043d) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043f\u043e \u043f\u0443\u0442\u0438 <code>lib\/weather_in_console.dart<\/code> . \u0412\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 <code>_<\/code> \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043e\u0434\u043d\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>getWeather()<\/code>.<\/p>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u043b\u0430\u043f\u0448\u0430, \u0438\u0437-\u0437\u0430 \u0440\u043e\u043c\u0431\u0438\u043a\u043e\u0432-\u0443\u0441\u043b\u043e\u0432\u0438\u0439&#8230;<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/6f6\/e9a\/10a\/6f6e9a10ab41f351d9e4cc5ab3e8a19d.jpg\" alt=\" \u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mermaid\" title=\" \u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mermaid\" width=\"838\" height=\"1813\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f6\/e9a\/10a\/6f6e9a10ab41f351d9e4cc5ab3e8a19d.jpg\" data-blurred=\"true\"\/><figcaption> \u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mermaid<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"write-the-code\" id=\"write-the-code\"><\/a><\/p>\n<h3>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/h3>\n<p>\u0411\u0443\u0434\u0435\u043c \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434. \u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>lib\/weather_in_console.dart<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"dart\">import 'dart:io'; import 'package:weather_pack\/weather_pack.dart';  \/\/ \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438  \/\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u044b Future&lt;void> getWeather() async {   stdout.writeln(' \u2728 \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441! \u2728 \\n');    \/\/ \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 getWeather()  } <\/code><\/pre>\n<p>\u0412 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getWeather()<\/code> \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0440\u0443\u0433\u0438\u0445, \u043d\u0435\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0423\u0441\u043b\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439<\/em>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c api-\u043a\u043b\u044e\u0447 \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0cc\/5fd\/92d\/0cc5fd92dac1c09e06e1690f0a3fb718.png\" width=\"296\" height=\"437\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0cc\/5fd\/92d\/0cc5fd92dac1c09e06e1690f0a3fb718.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"dart\">Future&lt;void> _checkApiKey(String apiKey) async {   final bool isCorrectApiKey = await OWMApiTest().isCorrectApiKey(_apiKey);    if (isCorrectApiKey) {     stdout.writeln(' ? \u041a\u043b\u044e\u0447 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u043a\u0430 ^_~');   } else {     stdout.writeln(' \u274c Api-\u043a\u043b\u044e\u0447 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442!');     exit(1);   } } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043b\u044e\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>OWMApiTest.isCorrectApiKey()<\/code>. \u0415\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438\u043d\u0430\u0447\u0435, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>exit(1)<\/code>. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<blockquote>\n<p>Although you can use any number for an exit code, by convention, the codes in the table below have the following meanings:<br \/> 0 &#8212; Success, 1 &#8212; Warnings, 2 &#8212; Errors<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"dart\">\/\/ If you do not use the `--define=\"API_WEATHER=YOUR_APIKEY\"` flag, \/\/  provide the key here instead of 'null' const String _apiKey = null ?? String.fromEnvironment('API_WEATHER');  Future&lt;void> getWeather() async { ...   await _checkApiKey(_apiKey); } <\/code><\/pre>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0434\u0435 \u044f \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e! \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0448 api-\u043a\u043b\u044e\u0447, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 OWM (\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/openweathermap.org\/\" rel=\"noopener noreferrer nofollow\">openweathermap.org<\/a> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432 \u043b\u0438\u0447\u043d\u043e\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <code>API keys<\/code>. \u042d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e), \u0432\u043c\u0435\u0441\u0442\u043e <code>null<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>const String.fromEnvironment()<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0435\u0446. \u0444\u043b\u0430\u0433\u043e\u043c:<\/p>\n<pre><code class=\"dart\">dart run --define=\"API_WEATHER=YOUR_APIKEY\" bin\/main.dart <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <code>Run<\/code>, \u0432 Android Studio \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/beb\/bf1\/80e\/bebbf180e65f0e496d95b5ce9f678085.png\" width=\"1081\" height=\"855\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/beb\/bf1\/80e\/bebbf180e65f0e496d95b5ce9f678085.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 <a href=\"https:\/\/codewithandrea.com\/articles\/flutter-api-keys-dart-define-env-files\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0441\u0445\u0435\u043c\u044b:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/916\/47c\/cdc\/91647ccdc31a23e29d726085ca2e9c10.png\" width=\"470\" height=\"919\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/916\/47c\/cdc\/91647ccdc31a23e29d726085ca2e9c10.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">import 'package:interact\/interact.dart';  \/\/...  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443. String _inputCity() {   final input = Input(     prompt: '\u0412\u0430\u0448\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435?',   ).interact();    if (input.isEmpty) {     final isResume = Confirm(       prompt: '\u041c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u0440\u0430\u0437?',       defaultValue: true,       waitForNewLine: true, \/\/ \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439 enter     ).interact();      return isResume ? _inputCity() : exit(0);   } else {     return input;   } } <\/code><\/pre>\n<p>\u0414\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0432\u0432\u043e\u0434\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041f\u0430\u043a\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>interact: ^2.1.1<\/code>. \u041f\u043e\u0437\u0436\u0435, \u043e\u043d \u043d\u0430\u043c \u0435\u0449\u0451 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439.<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/pub.dev\/static\/hash-ospklhbd\/img\/pub-dev-icon-cover-image.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>interact | Dart Package<\/span><\/div>\n<p><a href=\"https:\/\/pub.dev\/packages\/interact\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">pub.dev<\/a><\/div>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>GeocodingService.getLocationByCityName()<\/code> \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 <code>weather_pack<\/code>.<\/p>\n<p>\u0412 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c api-\u043a\u043b\u044e\u0447:<\/p>\n<pre><code class=\"dart\">final _gService = GeocodingService(_apiKey);<\/code><\/pre>\n<p>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0441\u0442, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435:<\/p>\n<pre><code class=\"dart\">Future&lt;PlaceGeocode?> _selectCity(String desiredPlace) async {   final spinner = Spinner(     icon: ' ? ',     rightPrompt: (done) => done         ? '\u0412\u044b \u0432\u0432\u0435\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435'         : '\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439...',   ).interact();    final List&lt;PlaceGeocode> places =       await _gService.getLocationByCityName(desiredPlace);    spinner.done();    if (places.isEmpty) {     stdout.writeln('\u041d\u043e \"$desiredPlace\" \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e &lt;(\uff3f\u3000\uff3f)>');     return null;   }    final index = Select(     prompt: '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430?',     options: places.map((PlaceGeocode place) {       final result = StringBuffer();        if (place.countryCode != null) {         result.write('${place.countryCode}: ');       }        if (place.state != null) {         result.write('${place.state}, ');       }        if (place.name != null) {         result.write('${place.name}');       }        return result.toString();     }).toList(),   ).interact();    return places[index]; } <\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b <code>Spinner<\/code> \u0438 <code>Select<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>interact<\/code><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>Spinner<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u044b\u043c \u043d\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c <code>Spinner<\/code> \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>spinner.done()<\/code>. \u0414\u0430\u043b\u0435\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c <code>null<\/code>, \u0435\u0441\u043b\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043c\u0435\u0441\u0442 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e. \u0418\u043d\u0430\u0447\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043c\u0435\u0441\u0442\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0441\u0442. \u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u0435\u0442\u043e\u0434 <code>getLocationByCityName()<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>limit<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0441\u0442. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u043d \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c &#8212; \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 5 \u043c\u0435\u0441\u0442 (\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 api OWM).<\/p>\n<p>\u0412 <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0440\u044e\u043a &#8212; \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a (\u0442.\u0435. <code>null<\/code>):<\/p>\n<pre><code class=\"dart\">Future&lt;void> getWeather() async {    \/\/ ...    PlaceGeocode? city;   do {     final String desiredPlace = _inputCity();     city = await _selectCity(desiredPlace);   } while (city == null);  } <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0436, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0431\u043b\u043e\u043a \u0441\u0445\u0435\u043c\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1e\/faa\/13a\/a1efaa13abe00399b2c6de09e6dacea0.png\" width=\"279\" height=\"550\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1e\/faa\/13a\/a1efaa13abe00399b2c6de09e6dacea0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"dart\">enum _TypeWeather {   hourly('\u041f\u043e\u0447\u0430\u0441\u043e\u0432\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430'),   current('\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430'),   daily('\u041f\u043e\u0433\u043e\u0434\u0430 \u043d\u0430 7 \u0434\u043d\u0435\u0439'),   alerts('\u041f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f'),   all('\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435');    const _TypeWeather(this.name);    final String name; }  \/\/\/ \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. _TypeWeather _selectTypeWeather() {   final index = Select(     prompt: '\u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c?',     options: _TypeWeather.values.map((e) => e.name).toList(),     initialIndex: 1,   ).interact();    return _TypeWeather.values[index]; }<\/code><\/pre>\n<p>\u0412 <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"dart\">Future&lt;void> getWeather() async {    \/\/...    final _TypeWeather typeWeather = _selectTypeWeather();   await _getWeather(city, typeWeather); }<\/code><\/pre>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>_getWeather()<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0433\u043e\u0434\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u0440\u0438\u0444 <code>WeatherService.currentWeatherByLocation()<\/code> \u0434\u0435\u0448\u0435\u0432\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>_TypeWeather.current<\/code>, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u0448\u0435\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 (\u0445\u043e\u0442\u044f, \u043a\u0430\u043a \u043c\u044b \u0438 \u043f\u043e\u043c\u043d\u0438\u043c, \u043c\u043e\u0434\u0435\u043b\u044c <code>WeatherOneCall<\/code> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f <code>WeatherCurrent<\/code>).<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. Future&lt;void> _getWeather(PlaceGeocode city, _TypeWeather typeWeather) async {   final gift = Spinner(     icon: ' ? ',     rightPrompt: (done) =>         done ? '\u0412\u043e\u0442 \u043d\u0430\u0433\u0440\u0430\u0434\u0430 \u0437\u0430 \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u0435' : '\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435...',   ).interact();    late WeatherCurrent current;   late WeatherOneCall oneCall;    if (typeWeather == _TypeWeather.current) {     current = await _getWeatherCurrent(city);   } else {     oneCall = await _getWeatherOneCall(city);   }    gift.done();    switch (typeWeather) {     case _TypeWeather.hourly:       _printHourly(oneCall.hourly);       break;     case _TypeWeather.current:       _printCurrent(current);       break;     case _TypeWeather.daily:       _printDaily(oneCall.daily);       break;     case _TypeWeather.alerts:       _printAlerts(oneCall.alerts);       break;     case _TypeWeather.all:       _printAlerts(oneCall.alerts);       _printHourly(oneCall.hourly);       _printDaily(oneCall.daily);       break;   } }  final _wService = WeatherService(_apiKey, language: WeatherLanguage.russian);  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherCurrent]. Future&lt;WeatherCurrent> _getWeatherCurrent(PlaceGeocode city) async {   return _wService.currentWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); }  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherOneCall]. Future&lt;WeatherOneCall> _getWeatherOneCall(PlaceGeocode city) async {   return _wService.oneCallWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); }<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <code>WeatherService<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>language<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>WeatherCurrent.weatherDescription<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 <code>PlaceGeocode.localNames<\/code> &#8212; map, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 api \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 47 \u044f\u0437\u044b\u043a\u043e\u0432.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>_printDaily()<\/code> \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0412 \u043f\u0430\u043a\u0435\u0442\u0435 <code>weather_pack<\/code> \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>_printCurrent()<\/code>:<\/p>\n<pre><code class=\"dart\">void _printCurrent(WeatherCurrent current) {   final DateTime? date = current.date;    const pressureUnits = Pressure.mmHg;   const tempUnits = Temp.celsius;   const speedUnits = Speed.kph;    final temp = tempUnits.valueToString(current.temp!, 2);   final tempFeelsLike = tempUnits.valueToString(current.tempFeelsLike!, 2);    final windSpeed = speedUnits.valueToString(current.windSpeed!, 1);   final windGust = speedUnits.valueToString(current.windGust ?? 0.0, 2);    stdout.write(''' =====\u0421\u0435\u0433\u043e\u0434\u043d\u044f===== ${date?.day}.${date?.month}.${date?.year} ${date?.hour}\u0447:${date?.minute}\u043c ${current.weatherDescription} \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 $temp ${tempUnits.abbr}, \u041e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a $tempFeelsLike ${tempUnits.abbr}) \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0435\u0442\u0440\u0430 - $windSpeed ${speedUnits.abbr}, \u043f\u043e\u0440\u044b\u0432\u044b \u0434\u043e $windGust ${speedUnits.abbr} \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430: ${SideOfTheWorld.fromDegrees(current.windDegree!).name} \u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435  ( ${pressureUnits.valueToString(current.pressure!)} ${pressureUnits.abbr} ) \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c ( ${current.humidity} % ) \u0423\u043b\u044c\u0442\u0440\u0430\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 ( ${current.uvi} ) \u0412\u043e\u0441\u0445\u043e\u0434 \u0438 \u0437\u0430\u043a\u0430\u0442 \u0441\u043e\u043b\u043d\u0446\u0430   ( ${current.sunrise} --> ${current.sunset} ) ================= '''); }<\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c <a href=\"https:\/\/pub.dev\/packages\/weather_pack#usage-units-measure\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438: <code>value()<\/code> \u0438 <code>valueToString()<\/code>. \u0415\u0441\u043b\u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>valueToString()<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 (\u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439), \u0430 \u043c\u0435\u0442\u043e\u0434 <code>value()<\/code> \u2014 \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>int precision<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u0437 &#171;readmi&#187; \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"dart\">void worksTempUnits({   double temp = 270.78, \/\/ ex. received from [WeatherCurrent.temp]   int precision = 3,   Temp unitsMeasure = Temp.celsius, }) {   \/\/ The default temperature is measured in Kelvin of the `double` type.   \/\/ We need the temperature to be displayed in Celsius to 3 decimal places    print(unitsMeasure.value(temp, precision)); \/\/ `-2.37` type `double`   print(unitsMeasure.valueToString(temp, precision)); \/\/ `-2.370` type `String`    \/\/ if precision is 0:   print(unitsMeasure.value(temp, 0)); \/\/ `-2.0` type `double`   print(unitsMeasure.valueToString(temp, 0)); \/\/ `-2` type `String` }<\/code><\/pre>\n<p>\u0415\u0449\u0451 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 \u0438\u0437 api \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>SideOfTheWorld.fromDegrees()<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0433\u0440\u0430\u0434\u0443\u0441\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/323\/7c0\/63f\/3237c063f78f2e868c13b6df8ff141cb.png\" width=\"449\" height=\"700\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/323\/7c0\/63f\/3237c063f78f2e868c13b6df8ff141cb.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430\u0448\u0430 <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">Future&lt;void> getWeather() async {   stdout.writeln(' \u2728 \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441! \u2728 \\n');    await _checkApiKey(_apiKey);    bool isRepeat = true;    do {     PlaceGeocode? city;     do {       final String desiredPlace = _inputCity();       city = await _selectCity(desiredPlace);     } while (city == null);      final _TypeWeather typeWeather = _selectTypeWeather();      await _getWeather(city, typeWeather);      isRepeat = _repeat();   } while (isRepeat == true);    exit(0); }  bool _repeat() {   return Confirm(     prompt: '\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f?',     defaultValue: true,     waitForNewLine: true,   ).interact(); } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043c\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043e\u043d \u043e\u0442\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043a \u041a\u043e\u043d\u0446\u0443.<\/p>\n<p><a class=\"anchor\" name=\"compile\" id=\"compile\"><\/a><\/p>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 .exe<\/h3>\n<p>\u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442? \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>dart compile exe bin\/main.dart --define=\"API_WEATHER=YOUR_APIKEY\"<\/code><\/pre>\n<p>\u0418 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c .exe \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0437\u044c\u044f\u043c \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c. \u0421 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u043e\u0439:<\/p>\n<blockquote>\n<p>The\u00a0<code>exe<\/code>\u00a0subcommand has some known limitations:<\/p>\n<p>No cross-compilation support (<a href=\"https:\/\/github.com\/dart-lang\/sdk\/issues\/28617\" rel=\"noopener noreferrer nofollow\">issue 28617<\/a>)<\/p>\n<p>The compiler can create machine code only for the operating system on which you\u2019re compiling. To create executables for macOS, Windows, and Linux, you need to run the compiler three times. You can also use a continuous integration (CI) provider that supports all three operating systems.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u043b\u0430\u0433\u0430\u0445 (\u0435\u0441\u0442\u044c \u043a\u0440\u0443\u0442\u043e\u0439 \u0444\u043b\u0430\u0433 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439) \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/dart.dev\/tools\/dart-compile\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<hr\/>\n<p><a class=\"anchor\" name=\"afterword\" id=\"afterword\"><\/a><\/p>\n<h3>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0433\u0438\u0444\u043a\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e3\/0bf\/d5c\/9e30bfd5cab9b60f01b189b68a388a59.gif\" width=\"788\" height=\"432\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e3\/0bf\/d5c\/9e30bfd5cab9b60f01b189b68a388a59.gif\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 windows \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430\u0445 (\u0438 \u0432 cmd \u0438 \u0432 powershell) \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u044d\u043c\u043e\u0434\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043a\u043e\u0434\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/microsoft\/terminal\" rel=\"noopener noreferrer nofollow\">terminal<\/a> \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0435\u043d\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0443; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0443\u0441\u0441\u043a\u0438\u043c\u0438 \u0431\u0443\u043a\u043e\u0432\u043a\u0430\u043c\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0433\u043e\u0440\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u041e\u043c\u0441\u043a, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a: Omsk. \u0412\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 <a href=\"https:\/\/github.com\/dart-lang\/sdk\/issues\/47133\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0420\u0435\u043c\u0430\u0440\u043a\u0430 \u043a \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 null (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>city.latitude ?? 0.0<\/code> \u0438\u043b\u0438 <code>current.temp!<\/code>) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0434\u043d\u0430\u043a\u043e, \u0432 <code>weather_pack<\/code> \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>OwmApiException<\/code>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 api. \u041d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>TimeoutException<\/code> &#8212; \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0440\u0443\u043a \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 (\u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u043f\u0430\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <code>example<\/code> (\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0434\u0430).<\/p>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/github.com\/PackRuble\/weather_pack\/tree\/master\/example\/weather_in_console\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c. <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d \u0441 \u041d\u043e\u0432\u044b\u043c \u0433\u043e\u0434\u043e\u043c! ?<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/post\/708854\/\"> https:\/\/habr.com\/ru\/post\/708854\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f dart \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443  <code>weather_pack<\/code>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/pub.dev\/static\/hash-ospklhbd\/img\/pub-dev-icon-cover-image.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>weather_pack | Dart Package<\/span><\/div>\n<p><a href=\"https:\/\/pub.dev\/packages\/weather_pack\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">pub.dev<\/a><\/div>\n<\/div>\n<p>\u041f\u0430\u043a\u0435\u0442 <code>weather_pack<\/code> \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u0443 <a href=\"https:\/\/openweathermap.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/openweathermap.org\/<\/a> (\u0434\u0430\u043b\u0435\u0435, OWM), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e (<a href=\"https:\/\/github.com\/PackRuble\/weather_pack\/blob\/master\/README.md\" rel=\"noopener noreferrer nofollow\">readme.md<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430), \u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u043e\u043d\u0443\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ul>\n<li>\n<p><a href=\"#preface\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#preparatory-stage\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#getting-the-first-weather-data\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#architecture\" rel=\"noopener noreferrer nofollow\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#write-the-code\" rel=\"noopener noreferrer nofollow\">\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#compile\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 .exe<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#afterword\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"foreword\" id=\"foreword\"><\/a><\/p>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0440\u044f\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u0434\u0430\u0447:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 habr \u0432 \u0440\u043e\u043b\u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f dart<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 <code>weather_pack<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430  <code>weather_pack<\/code> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 flutter, \u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 dart. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043c\u044b \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442.<\/p>\n<p><a class=\"anchor\" name=\"preparatory-stage\" id=\"preparatory-stage\"><\/a><\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0435 dart-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">dart create --template=console weather_in_console<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 <code>--template=console<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b <code>pubspec.yaml<\/code>. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">dart pub add weather_pack<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code class=\"yaml\">dependencies:  # \u0438\u0437 pub.dev weather_pack: ^&lt;\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f_\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f_\u0432\u0435\u0440\u0441\u0438\u044f>  # \u0438\u043b\u0438, \u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0441\u043a\u0430\u0447\u0430\u043d \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 weather_pack:   path: .\/\u043f\u0443\u0442\u044c_\u0434\u043e_\u043f\u0430\u043a\u0435\u0442\u0430\/weather_pack    # \u0438\u043b\u0438, \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0438\u0437 github weather_pack: git:   url: https:\/\/github.com\/PackRuble\/weather_pack.git   ref: master<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>dart pub get<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c. <\/p>\n<p><a class=\"anchor\" name=\"getting-the-first-weather-data\" id=\"getting-the-first-weather-data\"><\/a><\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <code>0.0.2<\/code> \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u0433\u043e\u0434\u044b: <code>WeatherCurrent<\/code> \u0438 <code>WeatherOneCall<\/code>. \u0412\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f <code>WeatherCurrent<\/code>:<\/p>\n<ol>\n<li>\n<p><code>WeatherCurrent<\/code> &#8212; \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0433\u043e\u0434\u044b<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherHourly><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u0447\u0430\u0441. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 48 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherMinutely><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044f \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>precipitation<\/code> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u0430\u0434\u043a\u043e\u0432 \u0432 \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherDaily><\/code> &#8212; \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 7 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c<\/p>\n<\/li>\n<li>\n<p><code>List&lt;WeatherAlert><\/code> &#8212; \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u044f: \u0434\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0434\u0430\u0442\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0415\u0449\u0451 \u0435\u0441\u0442\u044c \u0438\u043c\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0438 \u0442\u0435\u0433\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0418 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <code>WeatherOneCall<\/code> \u0434\u043e\u0440\u043e\u0436\u0435 (\u0431\u044b\u043b\u043e \u0442\u0430\u043a: 1000\/\u0434\u0435\u043d\u044c \u0438 30000\/\u043c\u0435\u0441\u044f\u0446). \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f <a href=\"https:\/\/openweathermap.org\/api\/one-call-api\" rel=\"noopener noreferrer nofollow\">One Call API 2.5<\/a> (\u0440\u0430\u043d\u0435\u0435 \u044d\u0442\u043e api \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u043e\u0441\u044c &#171;one call api 2.0&#187; \u0438 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u043e \u0432 \u0441\u0435\u0431\u044f 5-\u0442\u0438 \u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0433\u043e\u0434\u044b. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e 2.0, \u043d\u0430 api \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442).<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u0430\u0440\u0438\u0444 &#171;one call api 3.0&#187;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 1000 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0434\u0435\u043d\u044c, \u043d\u043e \u043f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430 &#8212; \u043f\u043bO\u0442\u0438. \u0418 \u0432\u043e\u043e\u0431\u0449\u0435, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 \u0442\u0430\u0440\u0438\u0444, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u043d\u0438\u0436\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438 &#8230; &#171;Continue with Stripe&#187; \u043a\u0430\u043a \u0431\u044b \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0435\u043b\u043e. \u041a\u043e\u0440\u043e\u0447\u0435, \u0431\u0438\u0437\u043d\u0435\u0441 \u0438 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433, \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0447\u043d\u043e\u0433\u043e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043d\u0430\u0448\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherCurrent]. Future&lt;WeatherCurrent> _getWeatherCurrent(PlaceGeocode city) async {   return _wService.currentWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); }  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 [WeatherOneCall]. Future&lt;WeatherOneCall> _getWeatherOneCall(PlaceGeocode city) async {   return _wService.oneCallWeatherByLocation(     latitude: city.latitude ?? 0.0,     longitude: city.longitude ?? 0.0,   ); } <\/code><\/pre>\n<p>\u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 OWM \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0433\u043e\u0434\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c. \u0420\u0430\u043d\u0435\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0433\u043e\u0440\u043e\u0434, \u043e\u0434\u043d\u0430\u043a\u043e:<\/p>\n<blockquote>\n<p>Please use\u00a0<a href=\"https:\/\/openweathermap.org\/api\/geocoding-api\" rel=\"noopener noreferrer nofollow\"><strong>Geocoder API<\/strong><\/a>\u00a0if you need automatic convert city names and zip-codes to geo coordinates and the other way around.<\/p>\n<p>Please note that\u00a0<a href=\"https:\/\/openweathermap.org\/current#geocoding\" rel=\"noopener noreferrer nofollow\">built-in geocoder<\/a>\u00a0has been deprecated. Although it is still available for use, bug fixing and updates are no longer available for this functionality.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <code>GeocodingService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c (<code>getLocationByCoordinates()<\/code>) \u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<code>getLocationByCityName()<\/code>).<\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><a class=\"anchor\" name=\"architecture\" id=\"architecture\"><\/a><\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u0430\u044f, \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <code>bin\\main.dart<\/code>. \u041a\u043e\u0434 \u0432 \u043d\u0451\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<pre><code class=\"dart\">import 'package:weather_in_console\/weather_in_console.dart' as service_owm;  Future&lt;void> main(List&lt;String> arguments) async {   await service_owm.getWeather(); } <\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043b\u043e\u0433\u0438\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 (\u0438 \u0434\u043e\u043b\u0436\u0435\u043d) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043f\u043e \u043f\u0443\u0442\u0438 <code>lib\/weather_in_console.dart<\/code> . \u0412\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 <code>_<\/code> \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043e\u0434\u043d\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>getWeather()<\/code>.<\/p>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u043b\u0430\u043f\u0448\u0430, \u0438\u0437-\u0437\u0430 \u0440\u043e\u043c\u0431\u0438\u043a\u043e\u0432-\u0443\u0441\u043b\u043e\u0432\u0438\u0439&#8230;<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption> \u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mermaid<\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"write-the-code\" id=\"write-the-code\"><\/a><\/p>\n<h3>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/h3>\n<p>\u0411\u0443\u0434\u0435\u043c \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434. \u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>lib\/weather_in_console.dart<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"dart\">import 'dart:io'; import 'package:weather_pack\/weather_pack.dart';  \/\/ \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438  \/\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0433\u043e\u0434\u044b Future&lt;void> getWeather() async {   stdout.writeln(' \u2728 \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441! \u2728 \\n');    \/\/ \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 getWeather()  } <\/code><\/pre>\n<p>\u0412 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getWeather()<\/code> \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0440\u0443\u0433\u0438\u0445, \u043d\u0435\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0423\u0441\u043b\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439<\/em>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c api-\u043a\u043b\u044e\u0447 \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"dart\">Future&lt;void> _checkApiKey(String apiKey) async {   final bool isCorrectApiKey = await OWMApiTest().isCorrectApiKey(_apiKey);    if (isCorrectApiKey) {     stdout.writeln(' ? \u041a\u043b\u044e\u0447 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u043a\u0430 ^_~');   } else {     stdout.writeln(' \u274c Api-\u043a\u043b\u044e\u0447 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442!');     exit(1);   } } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043b\u044e\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>OWMApiTest.isCorrectApiKey()<\/code>. \u0415\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438\u043d\u0430\u0447\u0435, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>exit(1)<\/code>. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<blockquote>\n<p>Although you can use any number for an exit code, by convention, the codes in the table below have the following meanings:<br \/> 0 &#8212; Success, 1 &#8212; Warnings, 2 &#8212; Errors<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"dart\">\/\/ If you do not use the `--define=\"API_WEATHER=YOUR_APIKEY\"` flag, \/\/  provide the key here instead of 'null' const String _apiKey = null ?? String.fromEnvironment('API_WEATHER');  Future&lt;void> getWeather() async { ...   await _checkApiKey(_apiKey); } <\/code><\/pre>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0434\u0435 \u044f \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e! \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0448 api-\u043a\u043b\u044e\u0447, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 OWM (\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/openweathermap.org\/\" rel=\"noopener noreferrer nofollow\">openweathermap.org<\/a> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432 \u043b\u0438\u0447\u043d\u043e\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <code>API keys<\/code>. \u042d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e), \u0432\u043c\u0435\u0441\u0442\u043e <code>null<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>const String.fromEnvironment()<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0435\u0446. \u0444\u043b\u0430\u0433\u043e\u043c:<\/p>\n<pre><code class=\"dart\">dart run --define=\"API_WEATHER=YOUR_APIKEY\" bin\/main.dart <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <code>Run<\/code>, \u0432 Android Studio \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 <a href=\"https:\/\/codewithandrea.com\/articles\/flutter-api-keys-dart-define-env-files\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0441\u0445\u0435\u043c\u044b:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">import 'package:interact\/interact.dart';  \/\/...  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443. String _inputCity() {   final input = Input(     prompt: '\u0412\u0430\u0448\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435?',   ).interact();    if (input.isEmpty) {     final isResume = Confirm(       prompt: '\u041c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u0440\u0430\u0437?',       defaultValue: true,       waitForNewLine: true, \/\/ \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439 enter     ).interact();      return isResume ? _inputCity() : exit(0);   } else {     return input;   } } <\/code><\/pre>\n<p>\u0414\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0432\u0432\u043e\u0434\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041f\u0430\u043a\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>interact: ^2.1.1<\/code>. \u041f\u043e\u0437\u0436\u0435, \u043e\u043d \u043d\u0430\u043c \u0435\u0449\u0451 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439.<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/pub.dev\/static\/hash-ospklhbd\/img\/pub-dev-icon-cover-image.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>interact | Dart Package<\/span><\/div>\n<p><a href=\"https:\/\/pub.dev\/packages\/interact\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">pub.dev<\/a><\/div>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>GeocodingService.getLocationByCityName()<\/code> \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 <code>weather_pack<\/code>.<\/p>\n<p>\u0412 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0433\u0435\u043e\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c api-\u043a\u043b\u044e\u0447:<\/p>\n<pre><code class=\"dart\">final _gService = GeocodingService(_apiKey);<\/code><\/pre>\n<p>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0441\u0442, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435:<\/p>\n<pre><code class=\"dart\">Future&lt;PlaceGeocode?> _selectCity(String desiredPlace) async {   final spinner = Spinner(     icon: ' ? ',     rightPrompt: (done) => done         ? '\u0412\u044b \u0432\u0432\u0435\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435'         : '\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439...',   ).interact();    final List&lt;PlaceGeocode> places =       await _gService.getLocationByCityName(desiredPlace);    spinner.done();    if (places.isEmpty) {     stdout.writeln('\u041d\u043e \"$desiredPlace\" \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e &lt;(\uff3f\u3000\uff3f)>');     return null;   }    final index = Select(     prompt: '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-343442","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343442","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=343442"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343442\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}