{"id":408727,"date":"2024-06-29T20:21:03","date_gmt":"2024-06-29T20:21:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=408727"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=408727","title":{"rendered":"<span>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c Hooks \u0438\u0437 React \u0432\u043e Flutter<\/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>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0445\u0443\u043a\u043e\u0432 \u0434\u043b\u044f Flutter, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/769\/95e\/59b\/76995e59b97c7bc3ceb22ce5c4e0d3e9.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/769\/95e\/59b\/76995e59b97c7bc3ceb22ce5c4e0d3e9.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0443\u043a\u0438 \u0432\u043e Flutter?<\/h2>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0442\u0435 \u0436\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u044e\u0434\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0438\u0445 \u0432 React, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e <code>Statefull<\/code> \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u043c\u0438 \u2013 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430 \u0441 <code>initState<\/code> \u0438 <code>dispose<\/code>. \u0410\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430\u043a\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"dart\">class Example extends StatefulWidget {   final Duration duration;    const Example({Key key, required this.duration})       : super(key: key);    @override   _ExampleState createState() => _ExampleState(); }  class _ExampleState extends State&lt;Example> with SingleTickerProviderStateMixin {   AnimationController? _controller;    @override   void initState() {     super.initState();     _controller = AnimationController(vsync: this, duration: widget.duration);   }    @override   void didUpdateWidget(Example oldWidget) {     super.didUpdateWidget(oldWidget);     if (widget.duration != oldWidget.duration) {       _controller!.duration = widget.duration;     }   }    @override   void dispose() {     _controller!.dispose();     super.dispose();   }    @override   Widget build(BuildContext context) {     return Container();   } }<\/code><\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043a\u043e\u0434, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u0442\u0443 \u0431\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u043b\u0438 \u0438 \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u044b.<\/p>\n<p>\u041d\u0435 \u0436\u0435\u043b\u0430\u044f \u043c\u0438\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u044e, \u043e\u043d\u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u043a\u0430\u043a \u0445\u0443\u043a\u0438, \u0438 \u0442\u043e \u043a\u0430\u043a \u0438\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0445\u0443\u043a\u043e\u0432:<\/p>\n<pre><code class=\"dart\">class Example extends HookWidget {   const Example({Key key, required this.duration})       : super(key: key);    final Duration duration;    @override   Widget build(BuildContext context) {     final controller = useAnimationController(duration: duration);     return Container();   } }<\/code><\/pre>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u0438\u043a\u0431\u0435\u0437<\/h2>\n<p>\u0425\u0443\u043a\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b, \u043d\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 &#8212; \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0445\u0443\u043a\u043e\u0432 (\u0441\u043c. \u043f\u0440\u0438\u043c\u0435\u0440).<\/p>\n<pre><code class=\"dart\">@override Widget build(BuildContext context) {   if (isCondition) {     final val = useHook();     \/\/\/ ... some code   } else {    final val2 = useHook2();     \/\/\/ ... some code   } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442, \u0442\u043e \u043a\u0430\u043a \u0445\u0443\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043c\u0430\u0433\u0438\u044f, \u0442\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0445\u0443\u043a\u043e\u0432 <a href=\"https:\/\/medium.com\/@ryardley\/react-hooks-not-magic-just-arrays-cd4f1857236e\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u0432\u0430\u0436\u0435\u043d \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u0445\u0443\u043a\u043e\u0432. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0445\u0443\u043a, \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0433\u0434\u0435 \u043a\u0430\u043a\u043e\u0439 \u0445\u0443\u043a (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 if`\u044b).<\/p>\n<h2>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0430\u0448 flutter \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/pub.dev\/packages\/flutter_hooks\" rel=\"noopener noreferrer nofollow\">flutter_hooks<\/a>.<\/p>\n<pre><code class=\"bash\">flutter pub add flutter_hooks<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 Flutter. \u0422\u0443\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. <\/p>\n<pre><code class=\"dart\">class MyHomePage extends StatefulWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);    final String title;    @override   State&lt;MyHomePage> createState() => _MyHomePageState(); }  class _MyHomePageState extends State&lt;MyHomePage> {   int _counter = 0;    void _incrementCounter() {     setState(() {       _counter++;     });   }    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(widget.title),       ),       body: Center(         child: Column(           mainAxisAlignment: MainAxisAlignment.center,           children: &lt;Widget>[             const Text(               'You have pushed the button this many times:',             ),             Text(               '$_counter',               style: Theme.of(context).textTheme.headline4,             ),           ],         ),       ),       floatingActionButton: FloatingActionButton(         onPressed: _incrementCounter,         tooltip: 'Increment',         child: const Icon(Icons.add),       ),     );   } }<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0445\u0443\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>useState<\/code> \u0438 <code>useCallback<\/code>.<\/p>\n<ul>\n<li>\n<p><code>useState<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0442\u0435\u0439\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>ValueNotifier&lt;T><\/code>. <\/p>\n<p>\u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ValueNotifier \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0432\u0438\u0434\u0436\u0435\u0442 ( <code>ValueListenableBuilder<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e). \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c \u043e\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>useCallback<\/code> &#8212; \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<p>\u0423\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 useMemoized \u0434\u043b\u044f callback`\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><code>useMemoized<\/code> &#8212; \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class MyHomePage extends HookWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);    final String title;    @override   Widget build(BuildContext context) {     final counter = useState(0);     final increment = useCallback(() => counter.value++, [counter]);     \/\/ or useMemoized(() => () => counter.value++, [counter]);          return Scaffold(       appBar: AppBar(         title: Text(title),       ),       body: Center(         child: Column(           mainAxisAlignment: MainAxisAlignment.center,           children: &lt;Widget>[             const Text(               'You have pushed the button this many times:',             ),             Text(               '${counter.value}',               style: Theme.of(context).textTheme.headline4,             ),           ],         ),       ),       floatingActionButton: FloatingActionButton(         onPressed: increment,         tooltip: 'Increment',         child: const Icon(Icons.add),       ),     );   } } <\/code><\/pre>\n<p>\u041e\u043a\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>Stream<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0445\u0443\u043a <code>useStream<\/code>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>Stream<\/code> \u0441 \u0446\u0432\u0435\u0442\u0430\u043c\u0438.<\/p>\n<pre><code class=\"dart\">Stream&lt;Color> colorsStream() async* {   final myColors = [     Colors.blue,     Colors.red,     Colors.yellow,     Colors.grey,     Colors.green,   ];   while (true) {     for (final color in myColors) {       await Future.delayed(const Duration(milliseconds: 1000));       yield color;     }   } }<\/code><\/pre>\n<p><code>Stream<\/code> \u0435\u0441\u0442\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <\/p>\n<pre><code class=\"dart\">class MyHomePage extends HookWidget {   const MyHomePage({Key? key}) : super(key: key);    @override   Widget build(BuildContext context) {     final stream = useMemoized(() => colorsStream());     final color = useStream(stream, initialData: Colors.white);      return Scaffold(       body: Center(         child: AnimatedContainer(           height: 300,           width: 300,           duration: const Duration(milliseconds: 500),           decoration: BoxDecoration(             borderRadius: BorderRadius.circular(20),             color: color.data,           ),         ),       ),     );   } } <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89c\/71a\/e9c\/89c71ae9c3686a4d9d3187e99e91a137.gif\" alt=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" title=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" width=\"730\" height=\"528\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89c\/71a\/e9c\/89c71ae9c3686a4d9d3187e99e91a137.gif\"\/><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>useStream<\/code> \u0432\u044b\u0437\u043e\u0432 <code>build<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <code>Stream<\/code> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>build<\/code>.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useEffect.html\" rel=\"noopener noreferrer nofollow\">useEffect<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useState.html\" rel=\"noopener noreferrer nofollow\">useState<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useMemoized.html\" rel=\"noopener noreferrer nofollow\">useMemoized<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useRef.html\" rel=\"noopener noreferrer nofollow\">useRef<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useCallback.html\" rel=\"noopener noreferrer nofollow\">useCallback<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useContext.html\" rel=\"noopener noreferrer nofollow\">useContext<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useValueChanged.html\" rel=\"noopener noreferrer nofollow\">useValueChanged<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useStream.html\" rel=\"noopener noreferrer nofollow\"><u>useStream<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Stream<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useFuture.html\" rel=\"noopener noreferrer nofollow\"><u>useFuture<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u00a0<code>Future<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useStreamController.html\" rel=\"noopener noreferrer nofollow\"><u>useStreamController<\/u><\/a>\u00a0&#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c\u00a0<code>StreamController<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u0439\u0442\u043e\u043c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useState.html\" rel=\"noopener noreferrer nofollow\"><u>useState<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useReducer.html\" rel=\"noopener noreferrer nofollow\"><u>useReducer<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/usePrevious.html\" rel=\"noopener noreferrer nofollow\"><u>usePrevious<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useSingleTickerProvider.html\" rel=\"noopener noreferrer nofollow\"><u>useSingleTickerProvider<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useAnimationController.html\" rel=\"noopener noreferrer nofollow\"><u>useAnimationController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useAnimation.html\" rel=\"noopener noreferrer nofollow\"><u>useAnimation<\/u><\/a> &#8212;\u00a0\u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Animation<\/code>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0451 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useListenable.html\" rel=\"noopener noreferrer nofollow\"><u>useListenable<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Listenable<\/code>\u00a0, \u043f\u043e\u043c\u0435\u0447\u0430\u044f \u0432\u0438\u0434\u0436\u0435\u0442 \u0434\u043b\u044f \u0440\u0435\u0431\u0438\u043b\u0434\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>Listener<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useValueListenable.html\" rel=\"noopener noreferrer nofollow\"><u>useValueListenable<\/u><\/a>\u00a0\u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>ValueListenable<\/code>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dev\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useTextEditingController-constant.html\" rel=\"noopener noreferrer nofollow\"><u>useTextEditingController<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useFocusNode.html\" rel=\"noopener noreferrer nofollow\"><u>useFocusNode<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u00a0<a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useTabController.html\" rel=\"noopener noreferrer nofollow\"><u>useTabController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useScrollController.html\" rel=\"noopener noreferrer nofollow\"><u>useScrollController<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/usePageController.html\" rel=\"noopener noreferrer nofollow\"><u>usePageController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useIsMounted.html\" rel=\"noopener noreferrer nofollow\"><u>useIsMounted<\/u><\/a>\u00a0&#8212; \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442<code>State.mounted<\/code><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c &#8212; \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0443\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0443\u043a\u0438 \u0432\u043e Flutter \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u0432\u0430\u0441 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u0435\u043d\u044f.<\/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\/articles\/585166\/\"> https:\/\/habr.com\/ru\/articles\/585166\/<\/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>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0445\u0443\u043a\u043e\u0432 \u0434\u043b\u044f Flutter, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0443\u043a\u0438 \u0432\u043e Flutter?<\/h2>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0442\u0435 \u0436\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u044e\u0434\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0438\u0445 \u0432 React, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0434\u043b\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e <code>Statefull<\/code> \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u043c\u0438 \u2013 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430 \u0441 <code>initState<\/code> \u0438 <code>dispose<\/code>. \u0410\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430\u043a\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"dart\">class Example extends StatefulWidget {   final Duration duration;    const Example({Key key, required this.duration})       : super(key: key);    @override   _ExampleState createState() => _ExampleState(); }  class _ExampleState extends State&lt;Example> with SingleTickerProviderStateMixin {   AnimationController? _controller;    @override   void initState() {     super.initState();     _controller = AnimationController(vsync: this, duration: widget.duration);   }    @override   void didUpdateWidget(Example oldWidget) {     super.didUpdateWidget(oldWidget);     if (widget.duration != oldWidget.duration) {       _controller!.duration = widget.duration;     }   }    @override   void dispose() {     _controller!.dispose();     super.dispose();   }    @override   Widget build(BuildContext context) {     return Container();   } }<\/code><\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043a\u043e\u0434, \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u0442\u0443 \u0431\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u043b\u0438 \u0438 \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u044b.<\/p>\n<p>\u041d\u0435 \u0436\u0435\u043b\u0430\u044f \u043c\u0438\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u044e, \u043e\u043d\u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u043a\u0430\u043a \u0445\u0443\u043a\u0438, \u0438 \u0442\u043e \u043a\u0430\u043a \u0438\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0445\u0443\u043a\u043e\u0432:<\/p>\n<pre><code class=\"dart\">class Example extends HookWidget {   const Example({Key key, required this.duration})       : super(key: key);    final Duration duration;    @override   Widget build(BuildContext context) {     final controller = useAnimationController(duration: duration);     return Container();   } }<\/code><\/pre>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u0438\u043a\u0431\u0435\u0437<\/h2>\n<p>\u0425\u0443\u043a\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b, \u043d\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 &#8212; \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0445\u0443\u043a\u043e\u0432 (\u0441\u043c. \u043f\u0440\u0438\u043c\u0435\u0440).<\/p>\n<pre><code class=\"dart\">@override Widget build(BuildContext context) {   if (isCondition) {     final val = useHook();     \/\/\/ ... some code   } else {    final val2 = useHook2();     \/\/\/ ... some code   } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442, \u0442\u043e \u043a\u0430\u043a \u0445\u0443\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043c\u0430\u0433\u0438\u044f, \u0442\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0445\u0443\u043a\u043e\u0432 <a href=\"https:\/\/medium.com\/@ryardley\/react-hooks-not-magic-just-arrays-cd4f1857236e\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u0432\u0430\u0436\u0435\u043d \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u0445\u0443\u043a\u043e\u0432. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0445\u0443\u043a, \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0433\u0434\u0435 \u043a\u0430\u043a\u043e\u0439 \u0445\u0443\u043a (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 if`\u044b).<\/p>\n<h2>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0430\u0448 flutter \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/pub.dev\/packages\/flutter_hooks\" rel=\"noopener noreferrer nofollow\">flutter_hooks<\/a>.<\/p>\n<pre><code class=\"bash\">flutter pub add flutter_hooks<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 Flutter. \u0422\u0443\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. <\/p>\n<pre><code class=\"dart\">class MyHomePage extends StatefulWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);    final String title;    @override   State&lt;MyHomePage> createState() => _MyHomePageState(); }  class _MyHomePageState extends State&lt;MyHomePage> {   int _counter = 0;    void _incrementCounter() {     setState(() {       _counter++;     });   }    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(widget.title),       ),       body: Center(         child: Column(           mainAxisAlignment: MainAxisAlignment.center,           children: &lt;Widget>[             const Text(               'You have pushed the button this many times:',             ),             Text(               '$_counter',               style: Theme.of(context).textTheme.headline4,             ),           ],         ),       ),       floatingActionButton: FloatingActionButton(         onPressed: _incrementCounter,         tooltip: 'Increment',         child: const Icon(Icons.add),       ),     );   } }<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0445\u0443\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>useState<\/code> \u0438 <code>useCallback<\/code>.<\/p>\n<ul>\n<li>\n<p><code>useState<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0442\u0435\u0439\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>ValueNotifier&lt;T><\/code>. <\/p>\n<p>\u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ValueNotifier \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0432\u0438\u0434\u0436\u0435\u0442 ( <code>ValueListenableBuilder<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e). \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c \u043e\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>useCallback<\/code> &#8212; \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<p>\u0423\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 useMemoized \u0434\u043b\u044f callback`\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><code>useMemoized<\/code> &#8212; \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class MyHomePage extends HookWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);    final String title;    @override   Widget build(BuildContext context) {     final counter = useState(0);     final increment = useCallback(() => counter.value++, [counter]);     \/\/ or useMemoized(() => () => counter.value++, [counter]);          return Scaffold(       appBar: AppBar(         title: Text(title),       ),       body: Center(         child: Column(           mainAxisAlignment: MainAxisAlignment.center,           children: &lt;Widget>[             const Text(               'You have pushed the button this many times:',             ),             Text(               '${counter.value}',               style: Theme.of(context).textTheme.headline4,             ),           ],         ),       ),       floatingActionButton: FloatingActionButton(         onPressed: increment,         tooltip: 'Increment',         child: const Icon(Icons.add),       ),     );   } } <\/code><\/pre>\n<p>\u041e\u043a\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>Stream<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0445\u0443\u043a <code>useStream<\/code>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>Stream<\/code> \u0441 \u0446\u0432\u0435\u0442\u0430\u043c\u0438.<\/p>\n<pre><code class=\"dart\">Stream&lt;Color> colorsStream() async* {   final myColors = [     Colors.blue,     Colors.red,     Colors.yellow,     Colors.grey,     Colors.green,   ];   while (true) {     for (final color in myColors) {       await Future.delayed(const Duration(milliseconds: 1000));       yield color;     }   } }<\/code><\/pre>\n<p><code>Stream<\/code> \u0435\u0441\u0442\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <\/p>\n<pre><code class=\"dart\">class MyHomePage extends HookWidget {   const MyHomePage({Key? key}) : super(key: key);    @override   Widget build(BuildContext context) {     final stream = useMemoized(() => colorsStream());     final color = useStream(stream, initialData: Colors.white);      return Scaffold(       body: Center(         child: AnimatedContainer(           height: 300,           width: 300,           duration: const Duration(milliseconds: 500),           decoration: BoxDecoration(             borderRadius: BorderRadius.circular(20),             color: color.data,           ),         ),       ),     );   } } <\/code><\/pre>\n<figure class=\"full-width\"><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>useStream<\/code> \u0432\u044b\u0437\u043e\u0432 <code>build<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <code>Stream<\/code> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>build<\/code>.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useEffect.html\" rel=\"noopener noreferrer nofollow\">useEffect<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useState.html\" rel=\"noopener noreferrer nofollow\">useState<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useMemoized.html\" rel=\"noopener noreferrer nofollow\">useMemoized<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useRef.html\" rel=\"noopener noreferrer nofollow\">useRef<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useCallback.html\" rel=\"noopener noreferrer nofollow\">useCallback<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useContext.html\" rel=\"noopener noreferrer nofollow\">useContext<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useValueChanged.html\" rel=\"noopener noreferrer nofollow\">useValueChanged<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useStream.html\" rel=\"noopener noreferrer nofollow\"><u>useStream<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Stream<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useFuture.html\" rel=\"noopener noreferrer nofollow\"><u>useFuture<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u00a0<code>Future<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useStreamController.html\" rel=\"noopener noreferrer nofollow\"><u>useStreamController<\/u><\/a>\u00a0&#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c\u00a0<code>StreamController<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u0439\u0442\u043e\u043c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useState.html\" rel=\"noopener noreferrer nofollow\"><u>useState<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useReducer.html\" rel=\"noopener noreferrer nofollow\"><u>useReducer<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/usePrevious.html\" rel=\"noopener noreferrer nofollow\"><u>usePrevious<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u0443\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useSingleTickerProvider.html\" rel=\"noopener noreferrer nofollow\"><u>useSingleTickerProvider<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useAnimationController.html\" rel=\"noopener noreferrer nofollow\"><u>useAnimationController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useAnimation.html\" rel=\"noopener noreferrer nofollow\"><u>useAnimation<\/u><\/a> &#8212;\u00a0\u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Animation<\/code>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0451 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useListenable.html\" rel=\"noopener noreferrer nofollow\"><u>useListenable<\/u><\/a>\u00a0&#8212; \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>Listenable<\/code>\u00a0, \u043f\u043e\u043c\u0435\u0447\u0430\u044f \u0432\u0438\u0434\u0436\u0435\u0442 \u0434\u043b\u044f \u0440\u0435\u0431\u0438\u043b\u0434\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>Listener<\/code><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useValueListenable.html\" rel=\"noopener noreferrer nofollow\"><u>useValueListenable<\/u><\/a>\u00a0\u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<code>ValueListenable<\/code>\u00a0\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dev\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useTextEditingController-constant.html\" rel=\"noopener noreferrer nofollow\"><u>useTextEditingController<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useFocusNode.html\" rel=\"noopener noreferrer nofollow\"><u>useFocusNode<\/u><\/a><\/p>\n<\/li>\n<li>\n<p>\u00a0<a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useTabController.html\" rel=\"noopener noreferrer nofollow\"><u>useTabController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useScrollController.html\" rel=\"noopener noreferrer nofollow\"><u>useScrollController<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/usePageController.html\" rel=\"noopener noreferrer nofollow\"><u>usePageController<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pub.dartlang.org\/documentation\/flutter_hooks\/latest\/flutter_hooks\/useIsMounted.html\" rel=\"noopener noreferrer nofollow\"><u>useIsMounted<\/u><\/a>\u00a0&#8212; \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442<code>State.mounted<\/code><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c &#8212; \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0443\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0443\u043a\u0438 \u0432\u043e Flutter \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u0432\u0430\u0441 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u0435\u043d\u044f.<\/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\/articles\/585166\/\"> https:\/\/habr.com\/ru\/articles\/585166\/<\/a><br \/><\/br><\/br><\/p>\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-408727","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408727","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=408727"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408727\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=408727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=408727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=408727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}