{"id":13549,"date":"2025-11-07T11:10:45","date_gmt":"2025-11-07T11:10:45","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=13549"},"modified":"2025-11-07T11:10:45","modified_gmt":"2025-11-07T11:10:45","slug":"run-method-on-build-complete-in-flutter","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/flutter\/run-method-on-build-complete-in-flutter","title":{"rendered":"Understanding How to run method on build complete in Fluter"},"content":{"rendered":"<p>Flutter provides callback<strong>(WidgetsBinding.instance.addPostFrameCallback)<\/strong>, with help of this, we can call method after build method.<\/p>\n<h3>Example:<\/h3>\n<p>Here we use <strong>addPostFrameCallback<\/strong> and define our custom function which  we want to run after build method.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/11\/07110857\/image-8.png\" alt=\"\" width=\"459\" height=\"572\" class=\"alignnone size-full wp-image-13552\" srcset=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/11\/07110857\/image-8.png 459w, https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/11\/07110857\/image-8-241x300.png 241w\" sizes=\"(max-width: 459px) 100vw, 459px\" \/><\/p>\n<p><strong>Output:<\/strong><br \/>\n<img decoding=\"async\" src=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/11\/07110958\/image-9.png\" alt=\"\" width=\"229\" height=\"78\" class=\"alignnone size-full wp-image-13553\" \/><\/p>\n<div class=\"qanda-read-box\"><div class=\"bg-light read-more-icon\"><img decoding=\"async\" src=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/04\/24061434\/read-txt.png\" alt=\"Also Read\"><p><\/p><h3>Also Read:<\/h3><a href=\"https:\/\/www.bacancytechnology.com\/blog\/flutter-open-source-projects\" target=\"_blank\">Flutter Open Source Projects<\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Flutter provides callback(WidgetsBinding.instance.addPostFrameCallback), with help of this, we can call method after build method. Example: Here we use addPostFrameCallback and define our custom function which we want to run after build method. Output:<\/p>\n","protected":false},"author":1,"featured_media":13550,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-13549","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flutter"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/13549"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=13549"}],"version-history":[{"count":2,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/13549\/revisions"}],"predecessor-version":[{"id":13554,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/13549\/revisions\/13554"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/13550"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=13549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=13549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=13549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}