{"id":18722,"date":"2021-05-12T12:11:06","date_gmt":"2021-05-12T07:41:06","guid":{"rendered":"https:\/\/maktabkhooneh.org\/mag\/?p=18722"},"modified":"2026-04-06T19:55:43","modified_gmt":"2026-04-06T16:25:43","slug":"basic-guide-to-flutter-application-architecture","status":"publish","type":"post","link":"https:\/\/maktabkhooneh.org\/mag\/basic-guide-to-flutter-application-architecture\/","title":{"rendered":"\u0631\u0627\u0647\u0646\u0645\u0627\u06cc \u0627\u0648\u0644\u06cc\u0647 \u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0641\u0644\u0627\u062a\u0631"},"content":{"rendered":"\n<p><span style=\"font-size: 16px;\"><a href=\"https:\/\/maktabkhooneh.org\/learn\/flutter-programming\/\">\u0641\u0644\u0627\u062a\u0631<\/a> \u0622\u0632\u0627\u062f\u06cc \u0639\u0645\u0644 \u0628\u0633\u06cc\u0627\u0631 \u0632\u06cc\u0627\u062f\u06cc \u0631\u0627 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u0645\u06cc\u200c\u062f\u0647\u062f \u0627\u0645\u0627 \u0627\u06cc\u0646 \u0622\u0632\u0627\u062f\u06cc \u0647\u0645\u06cc\u0634\u0647 \u062e\u0648\u0628 \u0646\u06cc\u0633\u062a \u0648 \u0628\u0631\u062e\u06cc \u0627\u0641\u0631\u0627\u062f\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u06cc \u067e\u0631\u0648\u0633\u0647 \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u0647\u0633\u062a\u0646\u062f\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0645\u0634\u06a9\u0644\u0627\u062a\u06cc \u0628\u0647 \u062f\u0646\u0628\u0627\u0644 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0631\u0627\u06cc <strong>\u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0641\u0644\u0627\u062a\u0631<\/strong> \u0648 \u0645\u062f\u06cc\u0631\u06cc\u062a \u062d\u0627\u0644\u062a (State) \u0635\u062f\u0642 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0633\u0627\u06cc\u062a\u200c\u0647\u0627\u06cc <a href=\"https:\/\/www.filledstacks.com\/post\/flutter-architecture-my-provider-implementation-guide\/\" rel=\"nofollow noopener\" target=\"_blank\">FilledStacks<\/a> \u0648 <a href=\"https:\/\/resocoder.com\/2019\/08\/27\/flutter-tdd-clean-architecture-course-1-explanation-project-structure\/\" rel=\"nofollow noopener\" target=\"_blank\">Reso Coder<\/a> \u0645\u062f\u0644\u200c\u0647\u0627\u06cc \u0645\u0639\u0645\u0627\u0631\u06cc \u0628\u0633\u06cc\u0627\u0631 \u06a9\u0627\u0631\u0622\u0645\u062f\u06cc \u0628\u0631\u0627\u06cc \u0645\u0628\u062a\u062f\u06cc\u200c\u0647\u0627 \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a\u0647 \u0627\u0633\u062a. \u0627\u0644\u0628\u062a\u0647 \u062f\u0631 \u0637\u0648\u0644 \u0632\u0645\u0627\u0646 \u0627\u06cc\u0646 \u0645\u0639\u0645\u0627\u0631\u06cc\u200c\u0647\u0627 \u0628\u0627 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u0647\u0645\u0631\u0627\u0647 \u0628\u0648\u062f\u0647\u200c\u0627\u0646\u062f \u0648 \u0647\u0645\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0627\u0639\u062b \u0634\u062f\u0647 \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631\u06a9 \u0622\u0646 \u0628\u0631\u0627\u06cc \u0627\u0641\u0631\u0627\u062f \u0645\u0628\u062a\u062f\u06cc \u0645\u0642\u062f\u0627\u0631\u06cc \u0633\u062e\u062a \u0628\u0627\u0634\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0647\u062f\u0641 \u0645\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0634\u0645\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633 \u0645\u0628\u062a\u062f\u06cc \u0641\u0644\u0627\u062a\u0631 \u0628\u0647 \u062f\u0631\u06a9 \u0628\u0627\u0644\u0627\u06cc\u06cc \u0627\u0632 <a href=\"https:\/\/maktabkhooneh.org\/mag\/why-programming-architecture-is-important\/\">\u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646<\/a> \u200c\u0647\u0627\u06cc \u0641\u0644\u0627\u062a\u0631 \u0628\u0631\u0633\u06cc\u062f \u0648 \u0633\u067e\u0633 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u0639\u0645\u0644\u06cc \u0631\u0627 \u0628\u0627 \u06a9\u0645\u06a9 Stacked Package \u0648\u0628\u0633\u0627\u06cc\u062a FilledStacks \u0627\u062c\u0631\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u06af\u0627\u0647\u06cc \u06a9\u0644\u06cc \u0628\u0647 \u0645\u0639\u0645\u0627\u0631\u06cc FilledStacks<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06cc\u0646 \u0648\u0628\u0633\u0627\u06cc\u062a \u0627\u0632 \u06cc\u06a9 \u0645\u0639\u0645\u0627\u0631\u06cc \u0628\u0627 \u0633\u0628\u06a9 MVVM \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0646\u0648\u0639 \u0645\u0639\u0645\u0627\u0631\u06cc \u0646\u0645\u0627 (View) \u0645\u0639\u0645\u0648\u0644\u0627 \u06cc\u06a9 \u0648\u06cc\u062c\u062a \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u06cc\u06a9\u06cc \u0627\u0632 \u0635\u0641\u062d\u0627\u062a \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a\u0647 \u0627\u0633\u062a. \u0627\u0644\u0628\u062a\u0647 \u0627\u06cc\u0646 \u0648\u06cc\u062c\u062a \u0647\u06cc\u0686\u06af\u0648\u0646\u0647 \u0645\u0646\u0637\u0642 \u06cc\u0627 \u062d\u0627\u0644\u062a\u06cc \u0646\u062f\u0627\u0631\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0627\u06cc\u0646 \u0648\u06cc\u062c\u062a \u062f\u0631 View Model \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a\u0647 \u0627\u0633\u062a \u0648 \u0647\u06cc\u0686 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u0647\u0645 \u0627\u0632 \u0646\u0645\u0627 \u0646\u062f\u0627\u0631\u062f. \u0627\u06a9\u062b\u0631 \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631\u0647\u0627 \u0628\u0647 \u0646\u06af\u0647\u200c\u062f\u0627\u0631\u06cc \u0648 \u0630\u062e\u06cc\u0631\u0647\u200c\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u0646\u062f. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u062a\u0648\u0633\u0637 \u0644\u0627\u06cc\u0647\u200c\u06cc \u0633\u0631\u0648\u06cc\u0633\u200c\u0647\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0627\u06cc\u0646 \u0644\u0627\u06cc\u0647 \u0639\u0645\u0644\u0627 \u0647\u0645\u0627\u0646 \u06a9\u0644\u0627\u0633\u200c\u0647\u0627\u06cc \u062f\u0627\u0631\u062a \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u062c\u0632\u0626\u06cc\u0627\u062a \u0631\u0627 \u062f\u0631 \u0628\u0631 \u0645\u06cc\u200c\u06af\u06cc\u0631\u0646\u062f \u062a\u0627 \u0645\u062f\u0644\u200c\u0647\u0627\u06cc \u0646\u0645\u0627 \u0646\u06cc\u0627\u0632\u06cc \u0646\u0628\u0627\u0634\u062f \u0646\u06af\u0631\u0627\u0646 \u0622\u0646\u200c\u0647\u0627 \u0628\u0627\u0634\u0646\u062f.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"205\" src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/1-Flutter-Architecture.jpg\" alt=\"\u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0641\u0644\u0627\u062a\u0631\" class=\"wp-image-18723\" title=\"\" srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/1-Flutter-Architecture.jpg 900w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/1-Flutter-Architecture-300x68.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/1-Flutter-Architecture-768x175.jpg.webp 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\"><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0647\u0631 \u06a9\u062f\u0627\u0645 \u0627\u0632 \u0635\u0641\u062d\u0627\u062a \u0648\u0628\u0633\u0627\u06cc\u062a \u062e\u0648\u062f\u062a\u0627\u0646 \u0628\u0627\u06cc\u062f \u06cc\u06a9 \u0645\u062f\u0644 \u0646\u0645\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u0627\u0645\u0627 \u0645\u062f\u0644 \u0633\u0631\u0648\u06cc\u0633\u200c\u0647\u0627 \u0628\u0631\u0627\u06cc \u062a\u0645\u0627\u0645\u06cc \u0646\u0645\u0627\u0647\u0627 \u0642\u0627\u0628\u0644 \u062f\u0633\u062a\u0631\u0633\u06cc \u0627\u0633\u062a \u0648 \u0647\u06cc\u0686 \u062a\u063a\u06cc\u06cc\u0631\u06cc \u0646\u0645\u06cc\u200c\u06a9\u0646\u062f. \u0633\u0627\u062e\u062a\u0627\u0631 \u06cc\u06a9 \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0686\u0646\u062f \u0635\u0641\u062d\u0647\u200c\u0627\u06cc \u0628\u0631\u0627\u0633\u0627\u0633 \u0645\u0639\u0645\u0627\u0631\u06cc \u0645\u0642\u062f\u0645\u0627\u062a\u06cc \u0641\u0644\u0627\u062a\u0631 \u0686\u06cc\u0632\u06cc \u0634\u0628\u06cc\u0647 \u0628\u0647 \u062a\u0635\u0648\u06cc\u0631 \u0632\u06cc\u0631 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"900\" height=\"596\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/2-Flutter-Architecture.jpg\" alt=\"\u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u062f\u0631 \u0641\u0644\u0627\u062a\u0631\" class=\"wp-image-18724 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/2-Flutter-Architecture.jpg 900w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/2-Flutter-Architecture-300x199.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/2-Flutter-Architecture-768x509.jpg.webp 768w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/596;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\"><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0639\u0645\u0644 \u0647\u0645 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627\u06cc \u0634\u0645\u0627 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0633\u0627\u062e\u062a\u0627\u0631\u06cc \u0645\u062b\u0644 \u0634\u06a9\u0644 \u0632\u06cc\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"900\" height=\"619\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/3-Flutter-Architecture.jpg\" alt=\"\u0645\u0639\u0645\u0627\u0631\u06cc \u0641\u0644\u0627\u062a\u0631\" class=\"wp-image-18725 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/3-Flutter-Architecture.jpg 900w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/3-Flutter-Architecture-300x206.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/3-Flutter-Architecture-768x528.jpg.webp 768w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/619;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\"><\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u0644\u0628\u062a\u0647 \u0634\u0645\u0627 \u0645\u062e\u062a\u0627\u0631 \u0647\u0633\u062a\u06cc\u062f \u06a9\u0647 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0631\u0627 \u0628\u0647 \u0647\u0631 \u0634\u06a9\u0644 \u062f\u06cc\u06af\u0631\u06cc \u0646\u06af\u0647\u200c\u062f\u0627\u0631\u06cc \u06a9\u0646\u06cc\u062f \u0627\u0645\u0627 FiledStacks \u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0645\u062f\u0644\u200c\u0647\u0627\u06cc \u0646\u0645\u0627 \u062f\u0631 \u067e\u0648\u0634\u0647\u200c\u06cc Core \u0642\u0631\u0627\u0631 \u0628\u06af\u06cc\u0631\u0646\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0633\u0627\u062e\u062a\u0627\u0631 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627\u06cc \u062e\u0648\u062f \u0631\u0627 \u0647\u0631 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u06cc\u062f \u0647\u0645 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u062f \u0648 \u0647\u06cc\u0686\u06af\u0648\u0646\u0647 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a\u06cc \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f.<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50192\" style=\"\"><style><\/style><section class=\"zht-related-post\" itemscope=\"\" itemtype=\"https:\/\/schema.org\/Article\" role=\"region\"\n  aria-label=\"Related article\">\n  <div class=\"zht-related-post-section-label\">\n    \u0645\u0637\u0627\u0644\u0628 \u0645\u0631\u062a\u0628\u0637\n  <\/div>\n  <img decoding=\"async\" width=\"300\" height=\"167\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/flutter_tenets-300x167.png.webp\" class=\"attachment-medium size-medium wp-post-image lazyload\" alt=\"\u0622\u0645\u0648\u0632\u0634 \u0641\u0644\u0627\u062a\u0631 \u0628\u0631\u0627\u06cc \u0648\u0628\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/flutter_tenets-300x167.png.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/flutter_tenets-1024x570.png.webp 1024w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/01\/flutter_tenets-768x428.png.webp 768w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/01\/flutter_tenets.png 1315w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/167;\">\n  <a href=\"https:\/\/maktabkhooneh.org\/mag\/flutter-training-for-the-web\/\" class=\"zht-related-post-title\" itemprop=\"headline\" target=\"_blank\">\u0622\u06cc\u0627 \u0628\u0647 \u0622\u0645\u0648\u0632\u0634 \u0641\u0644\u0627\u062a\u0631 \u0628\u0631\u0627\u06cc \u0648\u0628 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u0645\u061f<\/a>\n<\/section><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0645\u062b\u0627\u0644<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0628\u0627 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u062e\u06cc\u0644\u06cc \u0633\u0627\u062f\u0647 \u0646\u062d\u0648\u0647\u200c\u06cc \u0627\u062c\u0631\u0627\u06cc \u0645\u0639\u0645\u0627\u0631\u06cc \u0628\u0627\u0644\u0627 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u0628\u0631\u0631\u0633\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f. \u06cc\u0627\u062f \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645 \u06a9\u0647 \u0686\u0637\u0648\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u06cc\u06a9 \u0646\u0645\u0627 \u0648 \u0645\u062f\u0644 \u0646\u0645\u0627\u06cc \u062c\u062f\u06cc\u062f \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\"><strong>\u0646\u06a9\u062a\u0647: <\/strong>\u0628\u0647\u062a\u0631 \u0627\u0633\u062a \u0627\u06cc\u0646 \u0645\u062b\u0627\u0644 \u0631\u0627 \u062e\u0648\u062f\u062a\u0627\u0646 \u0647\u0645 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f \u0648 \u0641\u0642\u0637 \u0628\u0647 \u062e\u0648\u0627\u0646\u062f\u0646 \u0622\u0646 \u0628\u0633\u0646\u062f\u0647 \u0646\u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u06a9\u0645\u06a9 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f \u062f\u0631\u06a9 \u0628\u0647\u062a\u0631\u06cc \u0627\u0632 \u0645\u0641\u0647\u0648\u0645 \u0645\u0639\u0645\u0627\u0631\u06cc \u0645\u0642\u062f\u0645\u0627\u062a\u06cc \u0641\u0644\u0627\u062a\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631<\/span><\/h3>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u0628\u062a\u062f\u0627 \u06cc\u06a9 \u067e\u0631\u0648\u0698\u0647 \u062c\u062f\u06cc\u062f \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0627\u0633\u0645 \u0622\u0646 \u0631\u0627 \u0647\u0631 \u0686\u06cc\u0632\u06cc \u06a9\u0647 \u062f\u0648\u0633\u062a \u062f\u0627\u0631\u06cc\u062f \u0628\u06af\u0630\u0627\u0631\u06cc\u062f. \u0628\u0647 \u0635\u0648\u0631\u062a \u067e\u06cc\u0634\u0641\u0631\u0636 \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631 \u0634\u0645\u0627\u0631\u0646\u062f\u0647 \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 \u0627\u06cc\u062c\u0627\u062f \u062e\u0648\u0627\u0647\u062f \u0634\u062f. \u0644\u0627\u0632\u0645 \u0627\u0633\u062a \u062f\u0631 \u0627\u06cc\u0646 \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645 \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u06cc\u0645 \u0627\u0632 \u0633\u0628\u06a9 \u0645\u0639\u0645\u0627\u0631\u06cc MVVM \u0628\u0647 \u06a9\u0645\u06a9 \u067e\u06a9\u06cc\u062c Provider Architecture \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0642\u0628\u0644 \u0627\u0632 \u0647\u0631 \u06a9\u0627\u0631\u06cc \u062f\u0631 pubspec.yaml \u067e\u06a9\u06cc\u062c Stacked \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">dependencies:\n\n&nbsp; stacked: ^1.6.0<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\"><strong>\u0646\u06a9\u062a\u0647: <\/strong>\u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u0627\u06cc\u0646 \u0627\u0644\u06af\u0648\u06cc \u0645\u0639\u0645\u0627\u0631\u06cc \u0644\u0632\u0648\u0645\u0627 \u0646\u06cc\u0627\u0632\u06cc \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u067e\u06a9\u06cc\u062c Stacked \u0646\u062f\u0627\u0631\u06cc\u062f \u0627\u0645\u0627 \u0627\u06cc\u0646 \u067e\u06a9\u06cc\u062c \u0628\u0631\u062e\u06cc \u0627\u0632 \u06a9\u062f\u0647\u0627\u06cc \u063a\u06cc\u0631\u0636\u0631\u0648\u0631\u06cc \u0631\u0627 \u062d\u0630\u0641 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0628\u0631\u062e\u06cc \u0627\u0632 \u067e\u06cc\u0686\u06cc\u062f\u06af\u06cc\u200c\u0647\u0627\u06cc \u067e\u06a9\u06cc\u062c Provider \u0631\u0627 \u0647\u0645 \u0645\u062e\u0641\u06cc \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u06cc\u0646 \u0645\u062b\u0627\u0644 \u0645\u0627 \u0633\u0627\u062e\u062a\u0627\u0631 \u067e\u0648\u0634\u0647\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u062f\u0631 \u0628\u062e\u0634 \u0628\u0627\u0644\u0627 \u062f\u06cc\u062f\u06cc\u0645 \u0631\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u06a9\u0627\u0645\u0644 \u0627\u06cc\u062c\u0627\u062f \u0646\u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u0627\u0645\u0627 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0631 \u0635\u0648\u0631\u062a \u0646\u06cc\u0627\u0632 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0645\u062f\u0644 \u0646\u0645\u0627 (View Model)<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u067e\u0648\u0634\u0647\u200c\u06cc lib\/ \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062c\u062f\u06cc\u062f \u0628\u0627 \u0627\u0633\u0645 Counter_viewmodel.dart \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0633\u067e\u0633 \u06a9\u062f\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0645\u0634\u0627\u0647\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f \u0631\u0627 \u062f\u0627\u062e\u0644 \u0622\u0646 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">import 'package:flutter\/foundation.dart';\n \nclass CounterViewModel extends ChangeNotifier { \/\/ &lt;-- extends ChangeNotifier\n  int _counter = 0;\n \n  int get counter =&gt; _counter;\n \n  void increment() {\n    _counter++;\n    notifyListeners();                          \/\/ &lt;-- notify listeners\n  }\n}<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u06a9\u0644\u0627\u0633 \u0627\u0632 ChangeNotifier \u0627\u0631\u062b \u0628\u0631\u062f\u0647 \u0627\u0633\u062a \u0648 \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0627\u0639\u062b \u0634\u062f\u0647 \u0627\u0633\u062a \u0645\u062a\u062f notifyListeners() \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u0628\u06af\u06cc\u0631\u062f. \u0646\u0645\u0627\u06cc \u067e\u06cc\u0634 \u0631\u0648 \u06cc\u06a9 \u0634\u0646\u0648\u0646\u062f\u0647 \u06cc\u0627 listener \u0627\u0633\u062a \u0648 \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0627\u06cc\u0646 \u0645\u062a\u062f \u062f\u0642\u06cc\u0642\u0627 \u0686\u06cc\u0632\u06cc \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f \u06a9\u0647 \u067e\u06a9\u06cc\u062c Stacked \u0627\u0632 \u0622\u0646 \u0628\u0631\u0627\u06cc \u0628\u0627\u0632\u0633\u0627\u0632\u06cc \u0631\u0627\u0628\u0637 \u06a9\u0627\u0631\u0628\u0631\u06cc \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u067e\u0633 \u0627\u0632 \u0627\u0639\u0645\u0627\u0644 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. ChangeNotifier \u0647\u0645 \u0628\u062e\u0634\u06cc \u0627\u0632 \u0632\u06cc\u0631\u0633\u0627\u062e\u062a \u0641\u0644\u0627\u062a\u0631 \u0627\u0633\u062a \u0648 \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0647\u06cc\u0686\u06af\u0648\u0646\u0647 \u0648\u0627\u0628\u0633\u062a\u06af\u06cc \u0628\u0647 \u067e\u06a9\u06cc\u062c\u200c\u0647\u0627\u06cc Stacked \u06cc\u0627 Provider \u0646\u062f\u0627\u0631\u06cc\u0645.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0646\u0645\u0627 (View)<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u067e\u0648\u0634\u0647\u200c\u06cc lib\/ \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062c\u062f\u06cc\u062f \u0628\u0627 \u0627\u0633\u0645 counter_screen.dart \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0647\u0645\u0627\u0646 \u0648\u06cc\u062c\u062a \u0646\u0645\u0627\u06cc \u0634\u0645\u0627 \u0628\u0631\u0627\u06cc \u0635\u0641\u062d\u0647\u200c\u06cc \u0634\u0645\u0627\u0631\u0646\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f. \u067e\u0633 \u0627\u0632 \u0627\u06cc\u062c\u0627\u062f \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644\u060c \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0627\u062e\u0644 \u0622\u0646 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">import 'package:flutter\/material.dart';\nimport 'package:flutter_architecture_example\/counter_viewmodel.dart';\nimport 'package:provider_architecture\/provider_architecture.dart';\n \n\/\/ Since the state was moved to the view model, this is now a StatelessWidget.\nclass CounterScreen extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    \/\/ ViewModelProvider is what provides the view model to the widget tree.\n    return ViewModelProvider&lt;CounterViewModel&gt;.withConsumer(\n      viewModel: CounterViewModel(),\n      builder: (context, model, child) =&gt; Scaffold(\n        appBar: AppBar(\n          title: Text('Flutter Demo Home Page'),\n        ),\n        body: Center(\n          child: Column(\n            mainAxisAlignment: MainAxisAlignment.center,\n            children: &lt;Widget&gt;[\n              Text(\n                'You have pushed the button this many times:',\n              ),\n              Text(\n                '${model.counter}', \/\/                           &lt;-- view model\n                style: Theme.of(context).textTheme.display1,\n              ),\n            ],\n          ),\n        ),\n        floatingActionButton: FloatingActionButton(\n          onPressed: () {\n            model.increment(); \/\/                                &lt;-- view model\n          },\n          tooltip: 'Increment',\n          child: Icon(Icons.add),\n        ),\n      ),\n    );\n  }\n}<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0642\u0633\u0645\u062a \u0628\u0627\u0644\u0627\u06cc \u0645\u062a\u062f build() \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f ViewModelBuilder \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u0647\u0645\u0627\u0646 \u0686\u06cc\u0632\u06cc \u0627\u0633\u062a \u06a9\u0647 CounterViewModel \u0631\u0627 \u0628\u0647 \u062f\u0631\u062e\u062a\u0686\u0647 \u0648\u06cc\u062c\u062a\u200c\u0647\u0627 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u0647 \u062f\u0644\u06cc\u0644 \u0627\u06cc\u0646\u06a9\u0647 \u062d\u0627\u0644\u062a \u062f\u0631 \u0645\u062f\u0644 \u0646\u0645\u0627 \u0642\u0631\u0627\u0631 \u062f\u0627\u0631\u062f \u0647\u0645 \u0646\u06cc\u0627\u0632\u06cc \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0648\u06cc\u062c\u062a\u200c\u0647\u0627\u06cc \u0628\u0627 \u062d\u0627\u0644\u062a \u0646\u062f\u0627\u0631\u06cc\u0645. \u0628\u0627 \u0627\u06cc\u0646 \u0648\u062c\u0648\u062f \u0645\u06cc\u200c\u0628\u06cc\u0646\u06cc\u062f \u06a9\u0647 CounterScreen \u06cc\u06a9 \u0648\u06cc\u062c\u062a \u0628\u0627 \u062d\u0627\u0644\u062a \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0648\u06cc\u062c\u062a \u0645\u0642\u062f\u0627\u0631 Counter \u0631\u0627 \u0627\u0632 \u0645\u062f\u0644 \u0646\u0645\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u06a9\u0644\u06cc\u062f \u0631\u0648\u06cc \u0635\u0641\u062d\u0647 \u0641\u0634\u0627\u0631 \u062f\u0627\u062f\u0647 \u0634\u0648\u062f\u060c \u0645\u062a\u062f increment() \u0645\u062f\u0644 \u0646\u0645\u0627 \u0631\u0627 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f. \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0627\u06cc\u0646 \u0639\u0645\u0644 \u0628\u0627\u0639\u062b \u0627\u062c\u0631\u0627\u06cc \u06cc\u06a9 \u0628\u0627\u0632\u0633\u0627\u0632\u06cc \u0628\u0627 \u0645\u0642\u062f\u0627\u0631 Counter \u0645\u06cc\u200c\u0634\u0648\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0628\u0627\u06cc\u062f \u062f\u0631 \u0641\u0627\u06cc\u0644 Main.dart \u0647\u0645 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f. \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u06a9\u062f\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0631\u0627 \u0628\u0627 \u0642\u0637\u0639\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">import 'package:flutter\/material.dart';\nimport 'counter_view.dart';\n \nvoid main() =&gt; runApp(MyApp());\n \nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Flutter Demo',\n      theme: ThemeData(\n        primarySwatch: Colors.blue,\n      ),\n      home: CounterScreen(),\n    );\n  }\n}<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 \u0627\u06a9\u0646\u0648\u0646 \u06a9\u062f \u062e\u0648\u062f\u062a\u0627\u0646 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f\u060c \u0639\u0645\u0644\u06a9\u0631\u062f \u0622\u0646 \u062f\u0642\u06cc\u0642\u0627 \u0634\u0628\u06cc\u0647 \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631 \u067e\u06cc\u0634 \u0641\u0631\u0636 \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" width=\"900\" height=\"781\" data-src=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/4-Flutter-Architecture.jpg\" alt=\"\u0645\u0639\u0645\u0627\u0631\u06cc \u062f\u0631 \u0641\u0644\u0627\u062a\u0631\" class=\"wp-image-18726 lazyload\" title=\"\" data-srcset=\"https:\/\/maktabkhooneh.org\/mag\/wp-content\/uploads\/2021\/02\/4-Flutter-Architecture.jpg 900w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/4-Flutter-Architecture-300x260.jpg.webp 300w, https:\/\/maktabkhooneh.org\/mag\/wp-content\/smush-webp\/2021\/02\/4-Flutter-Architecture-768x666.jpg.webp 768w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/781;\" \/><figcaption><\/figcaption><\/figure>\n\n\n\n<p><span style=\"font-size: 16px;\"><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: 16px;\">\u0645\u0632\u0627\u06cc\u0627\u06cc Provider Architecture Package<\/span><\/h2>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062a\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0645\u0627 \u0627\u0632 \u06cc\u06a9 \u067e\u06a9\u06cc\u062c Provider \u0642\u062f\u06cc\u0645\u06cc \u0628\u0647 \u0647\u0645\u0631\u0627\u0647 ChangeNotifierProvider \u0648 Consumer \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645 \u0627\u0645\u0627 \u062e\u06cc\u0644\u06cc \u0627\u0632 \u0627\u0648\u0642\u0627\u062a \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0646\u06cc\u0627\u0632 \u0628\u0627\u0634\u062f \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a \u06cc\u0627 \u06cc\u06a9 \u062f\u06cc\u062a\u0627\u0628\u06cc\u0633 \u062a\u062d\u062a \u0634\u0628\u06a9\u0647 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0646\u06cc\u0645. \u0645\u062f\u0644 \u0646\u0645\u0627\u06cc \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u06cc\u06a9 \u0645\u062a\u062f \u0631\u0627 \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u0627\u06cc\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u062f\u0647\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u06a9\u062f\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 counter_viewmodel.dart \u0631\u0627 \u0628\u0627 \u06a9\u062f \u0632\u06cc\u0631 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">import 'package:flutter\/foundation.dart';\n\t\n\n\tclass CounterViewModel extends ChangeNotifier {\n\t  int _counter = 0;\n\t  int get counter =&gt; _counter;\n\t\n\n\t  WebApi _webApi = serviceLocator&lt;WebApi&gt;(); \/\/  &lt;-- service\n\t\n\n\t  Future loadData() async { \/\/                   &lt;-- load initial data\n\t    _counter = await _webApi.fetchValue();\n\t    notifyListeners();\n\t  }\n\t\n\n\t  void increment() {\n\t    _counter++;\n\t    notifyListeners();\n\t  }\n\t}\n\t\n\n\t\/\/ Fake service locator. Use GetIt in a real app.\n\t\/\/ Or inject the service in the view model constructor.\n\tWebApi serviceLocator&lt;T&gt;() {\n\t  return WebApi();\n\t}\n\t\n\n\t\/\/ Fake web api\n\tclass WebApi {\n\t  Future&lt;int&gt; fetchValue() =&gt; Future.delayed(Duration(seconds: 2), () =&gt; 11);\n\t}\n<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0645\u0634\u0627\u0647\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f \u0627\u06a9\u0646\u0648\u0646 \u06cc\u06a9 \u0645\u062a\u062f \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u0628\u0631\u062e\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u067e\u0627\u06cc\u0647 \u0627\u0632 \u06cc\u06a9 \u0633\u0631\u0648\u06cc\u0633 API \u062a\u062d\u062a \u0648\u0628 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a\u0647 \u0627\u0633\u062a. \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0646\u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u062f\u0631 \u0645\u0648\u0631\u062f \u0627\u06cc\u062c\u0627\u062f \u0633\u0631\u0648\u06cc\u0633\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0635\u062d\u0628\u062a \u06a9\u0646\u06cc\u0645\u060c \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0627\u0632 \u06cc\u06a9 \u06a9\u062f \u062a\u0642\u0644\u0628\u06cc \u062f\u0631 \u067e\u0627\u06cc\u0627\u0646 \u0635\u0641\u062d\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0646\u06a9\u062a\u0647 \u062c\u0627\u0644\u0628 \u062f\u0631 \u0645\u0648\u0631\u062f ViewModelBuilder \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u06cc\u06a9 \u06a9\u0627\u0644 \u0628\u06a9 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 onModelReady \u062f\u0627\u0631\u062f \u06a9\u0647 \u0628\u0647 \u0634\u0645\u0627 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc\u200c\u062f\u0647\u062f \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0645\u062f\u0644 \u0646\u0645\u0627 \u0622\u0645\u0627\u062f\u0647 \u0627\u0633\u062a \u0628\u0631\u062e\u06cc \u0645\u0642\u062f\u0627\u0631\u062f\u0647\u06cc\u200c\u0647\u0627\u06cc \u0627\u0648\u0644\u06cc\u0647 \u0631\u0627 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0641\u0627\u06cc\u0644 counter_screen.dart \u0645\u0642\u062f\u0627\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0647 ViewModelBuilder \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-size: 16px;\">onModelReady: (model) =&gt; model.loadData(),<\/span><\/pre>\n\n\n\n<p><span style=\"font-size: 16px;\">\u0627\u06a9\u0646\u0648\u0646 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0646\u0631\u0645\u200c\u0627\u0641\u0632\u0627\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f\u060c \u067e\u0633 \u0627\u0632 \u0645\u062f\u062a \u0632\u0645\u0627\u0646 \u06f2 \u062b\u0627\u0646\u06cc\u0647\u200c\u0627\u06cc \u0628\u0647 \u0635\u0648\u0631\u062a \u062e\u0648\u062f\u06a9\u0627\u0631 \u0628\u0647 \u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u062e\u0648\u0627\u0647\u062f \u0634\u062f.<\/span><\/p>\n\n\n<div class=\"jet-listing-grid--50121\" style=\"\"><div class=\"jet-listing-dynamic-field-block zht-maktab-khooneh-course cb-fb2qc30r\"data-is-block=\"jet-engine\/dynamic-field\"><div class=\"jet-listing-dynamic-field__content\" >\n<div class=\"course-card\">\n    <div class=\"course-card-img\">\n        <img decoding=\"async\" \n            data-src=\"https:\/\/media1.maktabkhooneh.org\/CACHE\/images\/courses\/images\/Hack-min_onrIbdH_1403-08-16-164622477\/1f95517e5ef398b7e536744f0f713638.webp?expire=4893471932&#038;token=443ca062539b6e7ac5889d0db18e2ee1&#038;md5=RDygYlObbnrFiJ0NsY4u4Q==\" \n            alt=\"\u062f\u0648\u0631\u0647 \u0622\u0645\u0648\u0632\u0634 \u0647\u06a9 \u0648 \u0627\u0645\u0646\u06cc\u062a - \u0647\u06a9 \u0642\u0627\u0646\u0648\u0646\u0645\u0646\u062f (CEH)\" \n            title=\"\u062f\u0648\u0631\u0647 \u0622\u0645\u0648\u0632\u0634 \u0647\u06a9 \u0648 \u0627\u0645\u0646\u06cc\u062a - \u0647\u06a9 \u0642\u0627\u0646\u0648\u0646\u0645\u0646\u062f (CEH)\" \n            width=\"100%\" \n            height=\"auto\"\n           \n         src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\">\n    <\/div>\n\n    <div class=\"course-details\">\n        <a href=\"https:\/\/maktabkhooneh.org\/course\/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%87%DA%A9-%D9%82%D8%A7%D9%86%D9%88%D9%86%D9%85%D9%86%D8%AF-ceh-mk641\/\" class=\"course-title\" target=\"_blank\" rel=\"noopener noreferrer\">\n            \u062f\u0648\u0631\u0647 \u0622\u0645\u0648\u0632\u0634 \u0647\u06a9 \u0648 \u0627\u0645\u0646\u06cc\u062a &#8211; \u0647\u06a9 \u0642\u0627\u0646\u0648\u0646\u0645\u0646\u062f (CEH)        <\/a>\n\n        <div class=\"course-price\">\n            \n                <span class=\"real-price\">\n                                            \u06f1,\u06f4\u06f9\u06f9,\u06f0\u06f0\u06f0                                    <\/span>\n\n                <span>\n                    <span class=\"discounted-price\">\n                        \u06f8\u06f9\u06f0,\u06f0\u06f0\u06f0                    <\/span>\n                    <span class=\"price-currency\">\u062a\u0648\u0645\u0627\u0646<\/span>\n                <\/span>\n\n                                    <div class=\"discount-percentage\">\n                        \u06f4\u06f1%                    <\/div>\n                \n                    <\/div>\n        <button class=\"course-cta-button\" data-course-url=\"https:\/\/maktabkhooneh.org\/course\/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%87%DA%A9-%D9%82%D8%A7%D9%86%D9%88%D9%86%D9%85%D9%86%D8%AF-ceh-mk641\/\">\n            \u0645\u0634\u0627\u0647\u062f\u0647 \u0648 \u062e\u0631\u06cc\u062f        <\/button>\n    <\/div>\n<\/div>\n<\/div><\/div><\/div>\n\n\n<p><span style=\"font-size: 16px;\">\u0633\u062e\u0646 \u0646\u0647\u0627\u06cc\u06cc<\/span><\/p>\n\n\n\n<p><span style=\"font-size: 16px;\">\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u062a\u0644\u0627\u0634 \u0634\u062f \u0634\u0645\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u06a9\u0627\u0645\u0644 \u0628\u0627 <strong>\u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0641\u0644\u0627\u062a\u0631<\/strong> \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u062f \u0648 \u062a\u0645\u0627\u0645\u06cc \u0645\u0633\u0627\u0626\u0644 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0622\u0646 \u0631\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u0639\u0645\u0644\u06cc \u06cc\u0627\u062f \u0628\u06af\u06cc\u0631\u06cc\u062f. \u0627\u0645\u06cc\u062f\u0648\u0627\u0631\u06cc\u0645 \u06a9\u0647 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 \u0645\u0641\u06cc\u062f \u0648\u0627\u0642\u0639 \u0634\u062f\u0647 \u0628\u0627\u0634\u062f.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0641\u0644\u0627\u062a\u0631 \u0622\u0632\u0627\u062f\u06cc \u0639\u0645\u0644 \u0628\u0633\u06cc\u0627\u0631 \u0632\u06cc\u0627\u062f\u06cc \u0631\u0627 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u0645\u06cc\u200c\u062f\u0647\u062f \u0627\u0645\u0627 \u0627\u06cc\u0646 \u0622\u0632\u0627\u062f\u06cc \u0647\u0645\u06cc\u0634\u0647 \u062e\u0648\u0628 \u0646\u06cc\u0633\u062a \u0648 \u0628\u0631\u062e\u06cc \u0627\u0641\u0631\u0627\u062f\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u06cc \u067e\u0631\u0648\u0633\u0647 \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u0647\u0633\u062a\u0646\u062f\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0645\u0634\u06a9\u0644\u0627\u062a\u06cc \u0628\u0647 \u062f\u0646\u0628\u0627\u0644 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0631\u0627\u06cc \u0645\u0639\u0645\u0627\u0631\u06cc \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0641\u0644\u0627\u062a\u0631 \u0648 \u0645\u062f\u06cc\u0631\u06cc\u062a \u062d\u0627\u0644\u062a (State) \u0635\u062f\u0642 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u062f\u0631 \u0633\u0627\u06cc\u062a\u200c\u0647\u0627\u06cc FilledStacks \u0648 Reso Coder \u0645\u062f\u0644\u200c\u0647\u0627\u06cc \u0645\u0639\u0645\u0627\u0631\u06cc \u0628\u0633\u06cc\u0627\u0631 \u06a9\u0627\u0631\u0622\u0645\u062f\u06cc [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":18728,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-18722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-and-it-training"],"_links":{"self":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/18722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/comments?post=18722"}],"version-history":[{"count":4,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/18722\/revisions"}],"predecessor-version":[{"id":66678,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/posts\/18722\/revisions\/66678"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/media\/18728"}],"wp:attachment":[{"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/media?parent=18722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/categories?post=18722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maktabkhooneh.org\/mag\/wp-json\/wp\/v2\/tags?post=18722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}