<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8330722259056898265</atom:id><lastBuildDate>Wed, 06 Nov 2024 03:10:59 +0000</lastBuildDate><category>tutorial</category><category>article</category><category>programming</category><category>internet</category><category>flutter</category><category>android</category><category>tips &amp; trick</category><category>knowledge</category><category>website</category><category>web programming</category><category>php</category><category>wordpress</category><category>windows</category><category>application</category><category>blogger</category><category>security</category><category>laravel</category><category>SEO</category><category>business</category><category>computer science</category><category>google</category><category>history</category><category>javascript</category><category>microsoft office</category><category>design</category><category>network</category><category>pengetahuan</category><category>artikel</category><category>html</category><category>internet marketing</category><category>library javascript</category><category>browser</category><category>pemrograman</category><category>system</category><category>css</category><category>pemrograman web</category><category>smartphone</category><category>tips dan trick</category><category>blog</category><category>how to work</category><category>microsoft excel</category><category>tools</category><category>aplikasi</category><category>big data</category><category>bootstrap</category><category>concept</category><category>e-commerce</category><category>hardware</category><category>jaringan</category><category>mysql</category><category>processor</category><category>vue js</category><category>bisnis</category><category>data mining</category><category>data warehouse</category><category>database</category><category>economic</category><category>library</category><category>media</category><category>node js</category><category>plugin</category><category>science</category><category>snippet</category><category>social media</category><category>video editing</category><title>porka one</title><description>porkaone is a website that contains various computer tips, programming tutorials, office and other technology discussions that are discussed in a cool and fun way</description><link>https://porkaone.blogspot.com/</link><managingEditor>noreply@blogger.com (sahretech)</managingEditor><generator>Blogger</generator><openSearch:totalResults>206</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-5267736044694490756</guid><pubDate>Sun, 31 Dec 2023 13:06:00 +0000</pubDate><atom:updated>2023-12-31T05:06:27.958-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">blog</category><category domain="http://www.blogger.com/atom/ns#">blogger</category><category domain="http://www.blogger.com/atom/ns#">google</category><category domain="http://www.blogger.com/atom/ns#">internet</category><category domain="http://www.blogger.com/atom/ns#">internet marketing</category><category domain="http://www.blogger.com/atom/ns#">wordpress</category><title>7 Best Free Backlink Checker Tools, You Must Use them!</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUbwmy_b4fJYKODKHCWSAZeFp8NieT2N5WLUgTcX1Umb9_4fVKUxWzOxa50W7jVlLJSP1p2YMIcix3u730WQJbP0rPP-KDIO2XMzECuYo8beDm6MxssrDOIO7cbKSTxJeQENt21O4PlPQI9lNKyLOBuaxliTYZuMJ7lr3N-ozEtQJrYdOiGCuPJEbwklA/s1500/7%20Best%20Free%20Backlink%20Checker%20Tools,%20You%20Must%20Use%20them!.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;7 Best Free Backlink Checker Tools, You Must Use them!&quot; border=&quot;0&quot; data-original-height=&quot;844&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUbwmy_b4fJYKODKHCWSAZeFp8NieT2N5WLUgTcX1Umb9_4fVKUxWzOxa50W7jVlLJSP1p2YMIcix3u730WQJbP0rPP-KDIO2XMzECuYo8beDm6MxssrDOIO7cbKSTxJeQENt21O4PlPQI9lNKyLOBuaxliTYZuMJ7lr3N-ozEtQJrYdOiGCuPJEbwklA/s16000/7%20Best%20Free%20Backlink%20Checker%20Tools,%20You%20Must%20Use%20them!.png&quot; title=&quot;7 Best Free Backlink Checker Tools, You Must Use them!&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;In the ever-growing digital era, the existence of backlinks in the online world is one of the key factors in determining the credibility and ranking of a website. Backlinks not only strengthen the authority of a web page in the eyes of search engines, but also increase visibility and visitor traffic. Therefore, it is important for website owners and online marketers to manage and monitor backlinks carefully. In this article, we&#39;ll explore seven of the best Backlink Checker tools that can help you optimize your backlink strategy, improve SEO rankings, and give you a competitive edge in the digital realm.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;1. Ahrefs&lt;/h1&gt;&lt;div&gt;&lt;div&gt;Ahrefs is the most complete digital marketing analysis tool. The features that Ahrefs has are more than enough to provide analytical data that is useful for website optimization. Amazingly, there are 16 trillion website pages that have been crawled which are always updated every 15-30 minutes!.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also check the backlink index in real time on Ahrefs. The way to check is very easy, you only need to go to Ahrefs Site Explorer then enter the link you want to check. Next, you will see backlink data pointing to your site.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEijgt0SlfHQZQoc4Jy61XhmG6ozxumleDbqI63TfUigmCuQR6HDLkN7NZcfX-INbX8xeCUXM7NJv4vnSox5o9WUiRGvnI_1sFFxDNqEN43VKnhoSoNcdupCYtFXdZq_hcPG25UnSPdNbzvJXDWEgWcGNMnAGBhKyFyJ5mH40YvWU8vVZiSoyWrbAIxlguI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;751&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEijgt0SlfHQZQoc4Jy61XhmG6ozxumleDbqI63TfUigmCuQR6HDLkN7NZcfX-INbX8xeCUXM7NJv4vnSox5o9WUiRGvnI_1sFFxDNqEN43VKnhoSoNcdupCYtFXdZq_hcPG25UnSPdNbzvJXDWEgWcGNMnAGBhKyFyJ5mH40YvWU8vVZiSoyWrbAIxlguI=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;You will get data on the top 100 backlinks from the link you are looking for. So you can also see backlinks from competitor domains. Ahrefs also helps you find out traffic from Google searches to backlink pages. This feature is very rare in other backlink checkers.&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;2. SEMrush&lt;/h1&gt;&lt;div&gt;&lt;div&gt;The second best backlink checker tool that is capable of checking backlinks is SEMrush. Because SEMrush actively crawls around 17 billion URLs per day and has analyzed more than 33 trillion backlinks.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To use this tool, you are required to create an account. After that, you only need to type the domain name that you want to check in SEMrush&#39;s Backlink Analysis.Then, you will see data like below.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhEBgc7b25nF0oAXUnB6NbxP6iSPbmIx1WSc1iGwh6mFFY8RrltRCtoddBy2F3XxAwPQSgrDtYEr-CoSLSC58mVUJgnkDtsUdt8uGPNN6iQ-p4OTFE5X73gYv2SFZEX4OZmuta_HqIEktJ7uqYb-1TxT-owtzngkg1CJed_o1IbynVRscjrsM_srVT_Zlw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;708&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhEBgc7b25nF0oAXUnB6NbxP6iSPbmIx1WSc1iGwh6mFFY8RrltRCtoddBy2F3XxAwPQSgrDtYEr-CoSLSC58mVUJgnkDtsUdt8uGPNN6iQ-p4OTFE5X73gYv2SFZEX4OZmuta_HqIEktJ7uqYb-1TxT-owtzngkg1CJed_o1IbynVRscjrsM_srVT_Zlw=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The data provided by SEMrush is fairly complete. It can be seen in the detailed analysis table for each backlink. In fact, SEMrush also has other backlink features. Such as, Backlink Audit, Link Building Tool, and Backlink Gap. You can use everything to maximize your backlink process.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;3. UberSuggest&lt;/h1&gt;&lt;div&gt;&lt;div&gt;The third backlink checker that we recommend is UberSuggest from neilpatel.com. The method is very easy because you can directly check backlinks in UberSuggest Backlink Checker, as shown in the image below. But of course, you are asked to sign up to get more complete data.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0Ijsl0y5kojXXQTdbwNVu7cvTbsTX5Q3F56SPwukRl88JkYw9Oc-s8wdZDtpSZrS0R9E6u6bBON8vIbGaDGK9eJFslSyEI6tbqUNIGWVi2CWQOTle6orw_piSdfoOYlqD6MHNbmYCLz8AXocbJck-20YM4VpBmmEJunGxqimVPplke-cU0RDs_dQsz9A&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;731&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0Ijsl0y5kojXXQTdbwNVu7cvTbsTX5Q3F56SPwukRl88JkYw9Oc-s8wdZDtpSZrS0R9E6u6bBON8vIbGaDGK9eJFslSyEI6tbqUNIGWVi2CWQOTle6orw_piSdfoOYlqD6MHNbmYCLz8AXocbJck-20YM4VpBmmEJunGxqimVPplke-cU0RDs_dQsz9A=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;4. Moz Pro&lt;/h1&gt;&lt;div&gt;&lt;div&gt;If you want complete features and in-depth data, maybe Moz Pro which has data on 40 trillion backlinks could be an option. You just need to type the domain name you want to search for in Link Research. Then, you will be asked to sign up and, voila! You will be met with data like below.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh7lvmwTr9Zw06bpcCCIXL-qvyyTDaJ68TxwpPhls1fnwoVnaZMWsKHt78VZlad7aFCWB4PoVk0i9pEbrWtJLZ6ifVLBXS1FwunStspi4m_6rv8ay3Iq6iyw5ij2ed5fzRtXOPdxnj_Y-cyWmptyrItN6aSCL7Qr7OdGyx6-3gI7Y6HH3_xvwz1f0VXT70&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;846&quot; data-original-width=&quot;1441&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh7lvmwTr9Zw06bpcCCIXL-qvyyTDaJ68TxwpPhls1fnwoVnaZMWsKHt78VZlad7aFCWB4PoVk0i9pEbrWtJLZ6ifVLBXS1FwunStspi4m_6rv8ay3Iq6iyw5ij2ed5fzRtXOPdxnj_Y-cyWmptyrItN6aSCL7Qr7OdGyx6-3gI7Y6HH3_xvwz1f0VXT70=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Moz Pro also provides a Link Intersect feature to compare backlinks on your website with five competitor websites at once. So, you can find out competitors&#39; backlinks that you don&#39;t have.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;5. OpenLinkProfiler&lt;/h1&gt;&lt;div&gt;&lt;div&gt;OpenLinkProfiler lets you check and analyze backlinks for free. After entering the URL of the domain you want to check in OpenLinkProfiler, you will be presented with a display like this.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjhelXWrpLUnV8G2LX-1Kwq_I4M1POT8WMBKKuKaA9mN82q2QsdsmA86V7-vWCYj2j_cvIuEDoiJ8DVimsmLCJfJAOoBVzWR0EHo81IMREB3lcsF8tniksN1VA-OCDfEnOvfaDVHNNQ60FwcgtdlB-dZkLG2M3ZtH6_lLDUztSx29uPD6Lxk4BbK_YV5js&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;727&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjhelXWrpLUnV8G2LX-1Kwq_I4M1POT8WMBKKuKaA9mN82q2QsdsmA86V7-vWCYj2j_cvIuEDoiJ8DVimsmLCJfJAOoBVzWR0EHo81IMREB3lcsF8tniksN1VA-OCDfEnOvfaDVHNNQ60FwcgtdlB-dZkLG2M3ZtH6_lLDUztSx29uPD6Lxk4BbK_YV5js=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;At the top of the screen, you will see the total number of backlinks and the number of domains leading to the website. This data is supported by a backlink details table at the bottom of the screen.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a Link Influence Score which shows the quality of the backlink. Complete with the dofollow or nofollow backlink type, as well as the backlink text and target link.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;6. BuzzSumo&lt;/h1&gt;&lt;div&gt;&lt;div&gt;The next tool is BuzzSumo which can analyze the content of your website and also your competitors. Before using it, you must sign up first. Next, you can check backlinks easily, just click Content and select Backlink, then enter the URL you want to check.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi80Tj8TBvPWFEg1OfAtKXrjs1dBncSTglEn7g2Dab9xYqCY6wOpTzd3OC2jiDSMHJ8e6r-j_Z4g1-eDtX_Hj631oC04Bk-q-sTXa0w35T2Ce1U8vlTt-db0g-NXWThbff-8WWADzWKAtsVhKBnzctUaJN6NSIc88YzzNKo945rB_4bfJiBq4mgJvD7CWE&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;688&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi80Tj8TBvPWFEg1OfAtKXrjs1dBncSTglEn7g2Dab9xYqCY6wOpTzd3OC2jiDSMHJ8e6r-j_Z4g1-eDtX_Hj631oC04Bk-q-sTXa0w35T2Ce1U8vlTt-db0g-NXWThbff-8WWADzWKAtsVhKBnzctUaJN6NSIc88YzzNKo945rB_4bfJiBq4mgJvD7CWE=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;You can set filters to search for backlinks on your website. There are four filters that can be searched, namely, Past Year, Domains, Target links to exact page, All results per domain. BuzzSumo provides unique data than others, namely social media engagement data for your website content. Such as, Facebook engagement, Twitter shares, and others.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;7. LinkMiner&lt;/h1&gt;&lt;div&gt;&lt;div&gt;In seventh place, there is LinkMiner as an alternative that you can use. This backlink checker from Mangools can be a solution with a minimal budget. After creating an account, you can type the URL you want to check on the dashboard in the Backlink Analysis menu and you will get a display like the one below.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgi6sJfgT2V2DofYxqsmqAjUMLNWQdgR6lPKr8ib7jH38ZgheG4rN-EVvS4rFUK9CPHlPGxWweFpPL6q0P2PJv1SWUj2wLoubrdl1yYY5h64mQ_23qUCdw_LDsjgj2xuvWKF4peIdBd9OtqUdNwQFsR7XRalstYZE8VBFtyHhFV3sSoCCaywu7z2oNLA_c&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;701&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgi6sJfgT2V2DofYxqsmqAjUMLNWQdgR6lPKr8ib7jH38ZgheG4rN-EVvS4rFUK9CPHlPGxWweFpPL6q0P2PJv1SWUj2wLoubrdl1yYY5h64mQ_23qUCdw_LDsjgj2xuvWKF4peIdBd9OtqUdNwQFsR7XRalstYZE8VBFtyHhFV3sSoCCaywu7z2oNLA_c=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;In the report above, you can set data options including All, New (new backlinks) and Lost (lost backlinks). You can also activate filters to view Dofollow and Nofollow backlinks, as well as Active or Deleted backlinks.&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Managing backlinks is no longer just an option, but a necessity in an effort to improve website performance and visibility. By using the best Backlink Checker tools discussed above, you can effectively monitor and manage your site&#39;s backlink footprint. As search engine algorithm changes continue to develop, the right backlink policy can be the key to success in facing increasingly fierce online competition. Don&#39;t hesitate to choose the tool that suits your needs and continue to hone your backlink strategy to achieve sustainable excellence in this dynamic digital world.&lt;/p&gt;</description><link>https://porkaone.blogspot.com/2023/12/7-best-free-backlink-checker-tools-you.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUbwmy_b4fJYKODKHCWSAZeFp8NieT2N5WLUgTcX1Umb9_4fVKUxWzOxa50W7jVlLJSP1p2YMIcix3u730WQJbP0rPP-KDIO2XMzECuYo8beDm6MxssrDOIO7cbKSTxJeQENt21O4PlPQI9lNKyLOBuaxliTYZuMJ7lr3N-ozEtQJrYdOiGCuPJEbwklA/s72-c/7%20Best%20Free%20Backlink%20Checker%20Tools,%20You%20Must%20Use%20them!.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-1402038383815783044</guid><pubDate>Wed, 27 Dec 2023 03:49:00 +0000</pubDate><atom:updated>2023-12-26T19:49:34.451-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Learn to Create CRUD Applications in Flutter and Firebase</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD2TvhPlrnvtn72AMrcitXXGW_SlmHCTPZvbfhm9vJZPd2Fhy1K8RPHPByohPwJkeAlRBHazbkQRFDQZ0V976rg7kpp6MqY-35SZGkYiLQtPPgAqNqgvMHyxWCr9fjPwnvtvQmDJWjNaDHpUDIpR0MWA2ouSvLhhSIRctLaTlqTdEtkTXCg8SVM0D7Gf8/s1500/Learn%20to%20Create%20CRUD%20Applications%20in%20Flutter%20and%20Firebase.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Learn to Create CRUD Applications in Flutter and Firebase&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD2TvhPlrnvtn72AMrcitXXGW_SlmHCTPZvbfhm9vJZPd2Fhy1K8RPHPByohPwJkeAlRBHazbkQRFDQZ0V976rg7kpp6MqY-35SZGkYiLQtPPgAqNqgvMHyxWCr9fjPwnvtvQmDJWjNaDHpUDIpR0MWA2ouSvLhhSIRctLaTlqTdEtkTXCg8SVM0D7Gf8/s16000/Learn%20to%20Create%20CRUD%20Applications%20in%20Flutter%20and%20Firebase.png&quot; title=&quot;Learn to Create CRUD Applications in Flutter and Firebase&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. This time we will learn how to
  create a Flutter application and use a Firebase database to store data. Are
  you curious? Come on, follow the complete tutorial below.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;Learn to Create Flutter and Firebase CRUD&lt;/h2&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  1. Create a firebase project at
  &lt;a href=&quot;https://firebase.google.com&quot; target=&quot;_blank&quot;&gt;https://firebase.google.com&lt;/a&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Then connect the flutter project with firebase. You can follow how to
  connect the two via the following link
  &lt;a href=&quot;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&lt;/a&gt;. Or follow the tutorial via the video&amp;nbsp;&lt;a href=&quot;https://www.youtube.com/watch?v=fxDusoMcWj8&quot; target=&quot;_blank&quot;&gt;How to Connect Flutter and Firebase&lt;/a&gt;. The tutorial must be followed. Because it is related to the next stage.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Open firebase. Then go to the build menu --&amp;gt; firestore database --&amp;gt;
  click start collection to create a new collection. We can equate collections
  with databases in MySQL.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg2KbV0g4cXjGtknvsdjrk7Nw240SUhHHgpehwTUSFIs1_RNcYVZZ149ltk4mOoEeS-DFK2yctsOkt15i5XZeI868tgsnd0MkHC3w1Eq_hjGJWSmDZ-7JBTS6UFlJeABM7YckMtr78j8vtAZE_dR2GCHkvod3DWbxwi-Y8AO99NFKxZQNupl-imjTb5R6NB&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sahretech Firebase&quot; data-original-height=&quot;852&quot; data-original-width=&quot;1410&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg2KbV0g4cXjGtknvsdjrk7Nw240SUhHHgpehwTUSFIs1_RNcYVZZ149ltk4mOoEeS-DFK2yctsOkt15i5XZeI868tgsnd0MkHC3w1Eq_hjGJWSmDZ-7JBTS6UFlJeABM7YckMtr78j8vtAZE_dR2GCHkvod3DWbxwi-Y8AO99NFKxZQNupl-imjTb5R6NB=s16000&quot; title=&quot;Sahretech Firebase&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Firebase&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. Click start collection -&amp;gt; fill in the collection ID with notes --&amp;gt;
  then click next
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeTbFbuqk3swCcB4M7VR0Pfqir_gykSzuxmK3Q9srRqXGrg-OUO9X6nH9tQVgPrmOHy1N84grbyUR6IbII2de-SvQYXjUqOyL9ZE5K9qeTw8E7eZuiw-PBpzvkuUl2xUKzErSmJ-Ky_w1OGmc70uXXg4dU9ZiaVYmLn0T4DqtKQGLyipWcc507PYlm1MA2&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sahretech Firebase Koneksi&quot; data-original-height=&quot;756&quot; data-original-width=&quot;1257&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeTbFbuqk3swCcB4M7VR0Pfqir_gykSzuxmK3Q9srRqXGrg-OUO9X6nH9tQVgPrmOHy1N84grbyUR6IbII2de-SvQYXjUqOyL9ZE5K9qeTw8E7eZuiw-PBpzvkuUl2xUKzErSmJ-Ky_w1OGmc70uXXg4dU9ZiaVYmLn0T4DqtKQGLyipWcc507PYlm1MA2=s16000&quot; title=&quot;Sahretech Firebase Koneksi&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Firebase&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  5. Then click auto-ID to fill in the document ID value. Fill in the first
  field and add the next field as shown in the image below. Then click save to
  save the collection.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjI2TKpzBAUVu3qMlPYZ0WG-HPgCPXnwgOCO8QZYheF9LHlxY-8GZ2-Pk8SRSG1iMejKxhJtz3egb5u_yZlXM3s7fNSKtqNnn4xFzNWk4mOEBU_udphA6PpKxxsLCari9IlmiL9aaDwxYNx_NipVYT6shsw_15mPKo2_0zHMQXDp7Xv1vVTD_H9i_kOzaAk&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Membuat Collection di Firebase Sahretech&quot; data-original-height=&quot;892&quot; data-original-width=&quot;1153&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjI2TKpzBAUVu3qMlPYZ0WG-HPgCPXnwgOCO8QZYheF9LHlxY-8GZ2-Pk8SRSG1iMejKxhJtz3egb5u_yZlXM3s7fNSKtqNnn4xFzNWk4mOEBU_udphA6PpKxxsLCari9IlmiL9aaDwxYNx_NipVYT6shsw_15mPKo2_0zHMQXDp7Xv1vVTD_H9i_kOzaAk=s16000&quot; title=&quot;Membuat Collection di Firebase Sahretech&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  6. Now your collection is ready. Next, we will display this data collection in
  the flutter project that you have prepared.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEilr_PRIHrMMUA2gG24EWjvLixdCKHwehxXhfjPswOzwsL3bGidSL9q0c3i12mBKlY3ki831MkWnr46QdOyEKowLgv-e4Y5SR6fdFwt8yFEKRfAPDvkvcz6u2yYLsKK-iu-j_yXHE0xWrI3miR7MM7BoI352yAJK3oEls45u2jsYNb8wJLknn4vYXhW2BFD&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Membuat Collection di Firebase Sahretech&quot; data-original-height=&quot;789&quot; data-original-width=&quot;1588&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEilr_PRIHrMMUA2gG24EWjvLixdCKHwehxXhfjPswOzwsL3bGidSL9q0c3i12mBKlY3ki831MkWnr46QdOyEKowLgv-e4Y5SR6fdFwt8yFEKRfAPDvkvcz6u2yYLsKK-iu-j_yXHE0xWrI3miR7MM7BoI352yAJK3oEls45u2jsYNb8wJLknn4vYXhW2BFD=s16000&quot; title=&quot;Membuat Collection di Firebase Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
        Firebase Collection
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  7. Open your respective flutter projects. I assume, you have prepared a
  flutter project and are connected to firebase. But if not, please follow the
  tutorial again in stage 2.
&lt;/p&gt;
&lt;p&gt;
  8. Ok, please open the pubspec.yaml file. Then add the firebase_core: ^2.23.0
  and cloud_firestore: ^4.4.5 packages as shown below. Then save the file to
  download the required packages.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhqC-4RqPO2X_cu6fs6Ge28v79yb6yQpkk57xv6iFwbVfAI7Z2BqgHFm3jQzTut5EfiieTNIYTgSjK4wAh_J6Yx8CFBJkodmP5SsbLaCPvcz_tKSBiVHOhtzAbkHFhY8nQ39sYu8D6Yn3MX3ghg49O0FkQM_AhUQpcXvzjkUfKIhUcuRHm43nETTEuCOhfF&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Flutter Sahretech&quot; data-original-height=&quot;548&quot; data-original-width=&quot;1051&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhqC-4RqPO2X_cu6fs6Ge28v79yb6yQpkk57xv6iFwbVfAI7Z2BqgHFm3jQzTut5EfiieTNIYTgSjK4wAh_J6Yx8CFBJkodmP5SsbLaCPvcz_tKSBiVHOhtzAbkHFhY8nQ39sYu8D6Yn3MX3ghg49O0FkQM_AhUQpcXvzjkUfKIhUcuRHm43nETTEuCOhfF=s16000&quot; title=&quot;Flutter Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;9. Open the main.dart file, then replace it with the script below.&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;&lt;br /&gt;&lt;br /&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_core/firebase_core.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;firebase_options&lt;/span&gt;.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;home_page&lt;/span&gt;.dart&#39;;

void main() async {
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WidgetsFlutterBinding&lt;/span&gt;.ensureInitialized();

  await &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Firebase&lt;/span&gt;.initializeApp(
    options: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DefaultFirebaseOptions&lt;/span&gt;.currentPlatform,
  );
  
  runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
      title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Firebase&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CRUD&lt;/span&gt;&#39;,
      theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
        primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
      ),
      home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;HomePage&lt;/span&gt;(),
    );
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  10. Create a home_page.dart file in the lib folder. Then follow the script as
  below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;&lt;br /&gt;&lt;br /&gt;// ignore_for_file: prefer_const_constructors, use_key_in_widget_constructors&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:cloud_firestore/cloud_firestore.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter_firebase_auth/input_data_page.dart&#39;;

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;HomePage&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CollectionReference&lt;/span&gt; dataCollection =
      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FirebaseFirestore&lt;/span&gt;.instance.collection(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;catata&lt;/span&gt;n&#39;);

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
      appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Firebase&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CRUD&lt;/span&gt;&#39;),
      ),
      body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;StreamBuilder&lt;/span&gt;(
        stream: dataCollection.snapshots(),
        builder: (context, snapshot) {
          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (!snapshot.hasData) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;();
          }

          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
            itemCount: snapshot.data!.docs.length,
            itemBuilder: (context, index) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; data = snapshot.data!.docs[index];
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(data[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;judu&lt;/span&gt;l&#39;]),
                subtitle: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(data[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;deskrips&lt;/span&gt;i&#39;]),
                trailing: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;IconButton&lt;/span&gt;(
                  icon: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.edit),
                  onPressed: () {
                  },
                ),
              );
            },
          );
        },
      ),
      floatingActionButton: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FloatingActionButton&lt;/span&gt;(
        onPressed: () {
          
        },
        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.add),
      ),
    );
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  11. Next, open android/app/build.gradle. Then change it to minSdkVersion 19.
  Then add multiDexEnabled = true and implementation
  &#39;com.android.support:multidex:1.0.1&#39; as shown below. This is important to add
  to avoid errors.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDWz_Yby1L6D-s2d5SgyJeiDafaqC7dAPqBZRUN83bO_ms5CRLdgnL50Ot-nJOuhcQ2YgvY4JX_x6uYrSRmAYQ4FljHdhz6Q07Dr-4jnNUvJmC8YTUbRnoxu_95_oEEkM3VUjSoweAQTyPFPk3EjuhVSptBZAvACbcyxQpKvf3Ty9Cl02xQO-Sn2TPz2cb/s1293/menambahkan%20flutter%20dex.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;918&quot; data-original-width=&quot;1293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDWz_Yby1L6D-s2d5SgyJeiDafaqC7dAPqBZRUN83bO_ms5CRLdgnL50Ot-nJOuhcQ2YgvY4JX_x6uYrSRmAYQ4FljHdhz6Q07Dr-4jnNUvJmC8YTUbRnoxu_95_oEEkM3VUjSoweAQTyPFPk3EjuhVSptBZAvACbcyxQpKvf3Ty9Cl02xQO-Sn2TPz2cb/s16000/menambahkan%20flutter%20dex.png&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Script&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;
  12. Ok, now you can do the test. Please run this flutter project via the
  emulator. If successful, the display will look like the image below.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyk4lnkdqiZz5cMgT6QM3RuD99AT2-kFUR_UbDlHnj1s0lxLiI3ZW68v-noaFBCOXDQ74HaiNH5qHG9dGtd5029RpPSSk2o7J-9sX8ZEgHVjva5xbKqvbAsbanMcIpnTJqMJFj4xNYj5q3COu7FJfm8xm3CnnGw0T2MBjAn0UG84G1b0VTH85L2V87xm1g/s616/Screenshot_1701609389.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;616&quot; data-original-width=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyk4lnkdqiZz5cMgT6QM3RuD99AT2-kFUR_UbDlHnj1s0lxLiI3ZW68v-noaFBCOXDQ74HaiNH5qHG9dGtd5029RpPSSk2o7J-9sX8ZEgHVjva5xbKqvbAsbanMcIpnTJqMJFj4xNYj5q3COu7FJfm8xm3CnnGw0T2MBjAn0UG84G1b0VTH85L2V87xm1g/s16000/Screenshot_1701609389.png&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Final Result&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/learn-to-create-crud-applications-in.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD2TvhPlrnvtn72AMrcitXXGW_SlmHCTPZvbfhm9vJZPd2Fhy1K8RPHPByohPwJkeAlRBHazbkQRFDQZ0V976rg7kpp6MqY-35SZGkYiLQtPPgAqNqgvMHyxWCr9fjPwnvtvQmDJWjNaDHpUDIpR0MWA2ouSvLhhSIRctLaTlqTdEtkTXCg8SVM0D7Gf8/s72-c/Learn%20to%20Create%20CRUD%20Applications%20in%20Flutter%20and%20Firebase.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-4713747444971427955</guid><pubDate>Wed, 27 Dec 2023 03:08:00 +0000</pubDate><atom:updated>2023-12-26T19:08:58.599-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating Google Login in Flutter with Firebase</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZPxGLTkf7E_PDsqDmCAoNVi1Y_hZFdbjBcFj3on2YcYays6ZLUKr8feHz0uYzHgyzvNcJPGzjWjiXbJeu3pxsSu5L2Sg4YErK7aQoKQgIUgL2yqXvGy9NWlFdpA_rmiUEXqJvtj3l_gNXpbNSnKYZ3s9tiEyzELq2XH8MqaE9HeyWOMZgjQfJDH4EGKE/s1500/Creating%20Google%20Login%20in%20Flutter%20with%20Firebase.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating Google Login in Flutter with Firebase&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZPxGLTkf7E_PDsqDmCAoNVi1Y_hZFdbjBcFj3on2YcYays6ZLUKr8feHz0uYzHgyzvNcJPGzjWjiXbJeu3pxsSu5L2Sg4YErK7aQoKQgIUgL2yqXvGy9NWlFdpA_rmiUEXqJvtj3l_gNXpbNSnKYZ3s9tiEyzELq2XH8MqaE9HeyWOMZgjQfJDH4EGKE/s16000/Creating%20Google%20Login%20in%20Flutter%20with%20Firebase.png&quot; title=&quot;Creating Google Login in Flutter with Firebase&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a Google login in Flutter. How do you do it? Let&#39;s follow the
  discussion below.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  Creating a Login Feature with Google Login in Flutter
&lt;/h1&gt;
&lt;p&gt;
  1. Create a new flutter project. Use flutter version 3 or newer version of
  flutter.
&lt;/p&gt;
&lt;p&gt;
  2. Connect the firebase project with your flutter project. You can follow the
  tutorial at the following link.
  &lt;a href=&quot;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&lt;/a&gt;. You must follow this link so that the data can be saved to Firebase.
&lt;/p&gt;
&lt;p&gt;
  3. Open cmd or terminal then go to the android folder and type
  &lt;b&gt;.\gradlew SigInReport&lt;/b&gt; then the SHA-1 key will appear as below. Copy and
  save the code.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiI0dqFjsqmt8XhpQkw08z-0Fs_VUcjd0MsnAPSIYAyPWIKP1N_QQBMZhrZcHFAKOxA_Q3SvDeudk292pNnPOr0wCyqs9p1eHEeBfPDIy0UtHqH2EprcNCxdhQPAUZoJJv1utTzHKo4Cx4QJ5yvyBVLKGgy7ouXdsRq1RX9TOq2iH-NAnLNtp4bbIziqGqe&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;285&quot; data-original-width=&quot;1192&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiI0dqFjsqmt8XhpQkw08z-0Fs_VUcjd0MsnAPSIYAyPWIKP1N_QQBMZhrZcHFAKOxA_Q3SvDeudk292pNnPOr0wCyqs9p1eHEeBfPDIy0UtHqH2EprcNCxdhQPAUZoJJv1utTzHKo4Cx4QJ5yvyBVLKGgy7ouXdsRq1RX9TOq2iH-NAnLNtp4bbIziqGqe=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;SHA-1 Key&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  4. Next we will add the SHA-1 key. Go back to the Firebase project, then click
  the gear icon, then select project settings
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgRKrgQ4Q5LmVWfd6gRhqjofIEjbLAmZ25oVFRqaDWRAjOecJ3rgBXZHUgKtyoWgTkOS0PlpKnqo1oxJ08JR6JSlC9k0FPGF64oqr2ucuORB20n2kinSMT9jEu53Ho0jIe648PpSufYYmeodSMBQz1I2CjOQ4Ojf_tEO4Yah3h7Wok__nVgWqEUX80er8aG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;429&quot; data-original-width=&quot;806&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgRKrgQ4Q5LmVWfd6gRhqjofIEjbLAmZ25oVFRqaDWRAjOecJ3rgBXZHUgKtyoWgTkOS0PlpKnqo1oxJ08JR6JSlC9k0FPGF64oqr2ucuORB20n2kinSMT9jEu53Ho0jIe648PpSufYYmeodSMBQz1I2CjOQ4Ojf_tEO4Yah3h7Wok__nVgWqEUX80er8aG=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;SHA-1 Key&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  5. Scroll to the bottom of the page then click the add fingerprint button to
  add the SHA-1 key. Copy the SHA-1 key that was obtained previously and click
  save to save.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdfV806qSUlo5W6YzRE0XPxzEUDU7EjxSSU-1QdZbOeSsAgNyUTwLMuWPBYk9c1r0rxal6Sasa77bR9qqmUSG3CeOwV8_uB-LXX7etyeNki6w_kGAkYxa-JgdM-qAWL5rdmkMNrJjGBLHG4BGANvDVWNt4XefHtpZr1ZOOmYSr5t95HIZGucK1Wargkjsi/s1451/Screenshot%202023-11-26%20151121.png&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;616&quot; data-original-width=&quot;1451&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdfV806qSUlo5W6YzRE0XPxzEUDU7EjxSSU-1QdZbOeSsAgNyUTwLMuWPBYk9c1r0rxal6Sasa77bR9qqmUSG3CeOwV8_uB-LXX7etyeNki6w_kGAkYxa-JgdM-qAWL5rdmkMNrJjGBLHG4BGANvDVWNt4XefHtpZr1ZOOmYSr5t95HIZGucK1Wargkjsi/s16000/Screenshot%202023-11-26%20151121.png&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;SHA-1 Key&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  6. Click the build menu --&amp;gt; Authentication --&amp;gt; then select the sign-in
  method tab --&amp;gt; then under additional providers select Google
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhDJ8oSMkwd5seYpRHn0fWPEEkJcd53pWlZeM0rsclXGOEq3BFsdYKFJIgSgV7ksuPurASxBWW6Xj3gBEXL2g7zmGdy3NuxmR_PNvtulIUr6Et5uYSLHyaZjGU52c-L185AJA-0DnBAIow3EClrOEA6X6SFHWuIYAnaU6iLAg_qdk0VJTdUb6ds6gjUs7o6&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;868&quot; data-original-width=&quot;1793&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhDJ8oSMkwd5seYpRHn0fWPEEkJcd53pWlZeM0rsclXGOEq3BFsdYKFJIgSgV7ksuPurASxBWW6Xj3gBEXL2g7zmGdy3NuxmR_PNvtulIUr6Et5uYSLHyaZjGU52c-L185AJA-0DnBAIow3EClrOEA6X6SFHWuIYAnaU6iLAg_qdk0VJTdUb6ds6gjUs7o6=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
        Add Google Providers
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  7. Click or switch enable then scroll down and click save --&amp;gt; then click
  done. At this point, all matters with Google Firebase are complete. Next, we
  start coding!
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiYY2R12VmE_gKz6iP2Vnkeryn0hqIU8ZasNFPwOE_h86r8DlnxmmwIINBuqyiOXvVpUtJH_jbOb8K0ZZxx9R88B7dyWwU81NjEA1YWKhOdPfDCeTVZE6aysoNG_0InUIjuitmUY4tUDGOZcB8x53vJYuN4NCud3PKHjEkaGq-zhH8xcSPvXlxWBH8F2gze&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;892&quot; data-original-width=&quot;1394&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiYY2R12VmE_gKz6iP2Vnkeryn0hqIU8ZasNFPwOE_h86r8DlnxmmwIINBuqyiOXvVpUtJH_jbOb8K0ZZxx9R88B7dyWwU81NjEA1YWKhOdPfDCeTVZE6aysoNG_0InUIjuitmUY4tUDGOZcB8x53vJYuN4NCud3PKHjEkaGq-zhH8xcSPvXlxWBH8F2gze=s16000&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  8. Go back to the flutter project. Open the pubspec.yaml file then add the
  &lt;b&gt;firebase_core: ^2.19.0&lt;/b&gt; package and &lt;b&gt;google_sign_in:&lt;/b&gt; as shown
  below. Then save the file to download the package
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhuz3st2-CXbnHHuU9eiiuyHQ7ahqos1zbu1CoWSU9t8eDmwWDpvmFCVhBPz4jbTr8i8WAdjWaRdU_PTd54f-f9zpPbTFH628tnlsbqc60qjvkxM_6OAFpKlRvMhrxTnNFSE0I4iIIog2zDC0HuDzvOSVIXTM0Vmd2YWSavqVhmJQZhGG4pNrib2vACHYDU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;458&quot; data-original-width=&quot;754&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhuz3st2-CXbnHHuU9eiiuyHQ7ahqos1zbu1CoWSU9t8eDmwWDpvmFCVhBPz4jbTr8i8WAdjWaRdU_PTd54f-f9zpPbTFH628tnlsbqc60qjvkxM_6OAFpKlRvMhrxTnNFSE0I4iIIog2zDC0HuDzvOSVIXTM0Vmd2YWSavqVhmJQZhGG4pNrib2vACHYDU=s16000&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;9. Open the main.dart file then add the script below.&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// ignore_for_file: prefer_const_constructors, avoid_print, unused_local_variable, prefer_const_literals_to_create_immutables, sized_box_for_whitespace, unused_field, invalid_return_type_for_catch_error&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_core/firebase_core.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;firebase_options&lt;/span&gt;.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;home&lt;/span&gt;.dart&#39;;

void main() async {
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WidgetsFlutterBinding&lt;/span&gt;.ensureInitialized();
  await &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Firebase&lt;/span&gt;.initializeApp(
    options: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DefaultFirebaseOptions&lt;/span&gt;.currentPlatform,
  );

  runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;({&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;? key}) : &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;(key: key);

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
      title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Google&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Login&lt;/span&gt;&#39;,
      home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Google&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Login&lt;/span&gt; in &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Flutter&lt;/span&gt;&#39;),
          ),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
          alignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Alignment&lt;/span&gt;.center,
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Home&lt;/span&gt;(),
        ),
      ),
    );
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  10. Create a new file with the name home.dart in the lib folder. Then replace
  the script below
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;&lt;br /&gt;&lt;br /&gt;// Import library untuk menggunakan Flutter dan Google Sign-In&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:google_sign_in/google_sign_in.dart&#39;;

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Home&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Home&lt;/span&gt;({&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;? key}) : &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;(key: key);

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Home&lt;/span&gt;&amp;gt; createState() =&amp;gt; _HomeState();
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_HomeState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;Home&amp;gt;&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;GoogleSignIn&lt;/span&gt; _googleSignIn = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;GoogleSignIn&lt;/span&gt;();
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;GoogleSignInAccount&lt;/span&gt;? _currentUser;

  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;void&amp;gt; signIn() async {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;try&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; auth = await _googleSignIn.signIn();
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (auth == &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;null&lt;/span&gt;) {
        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SnackBar&lt;/span&gt;(content: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;User&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Tidak&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Memilih&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Akun&lt;/span&gt;. &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Klik&lt;/span&gt; tombol login &#39;));
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        setState(() {
          _currentUser = auth;
        });
      }
    } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;catch&lt;/span&gt; (e) {
      print(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt; signing in: $e&#39;);
    }
  }

  void signOut() async {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; auth = await _googleSignIn.disconnect();

    setState(() {
      _currentUser = auth;
    });
  }

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; _buildWidget();
  }

  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; _buildWidget() {
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;GoogleSignInAccount&lt;/span&gt;? user = _currentUser;
    
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (user != &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;null&lt;/span&gt;) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
        mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
        children: [
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
            &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Signed in successfully&lt;/span&gt;&#39;,
            style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
            width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;175&lt;/span&gt;,
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;175&lt;/span&gt;,
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ClipRRect&lt;/span&gt;(
              borderRadius: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BorderRadius&lt;/span&gt;.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;),
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                user.photoUrl ??
                    &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2016/04/24/20/52/laundry-1350593_1280.jpg&#39;,&lt;/span&gt;
                fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
              ),
            ),
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
            user.displayName!,
            style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
            user.email,
            style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
            padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;, vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ElevatedButton&lt;/span&gt;(
                onPressed: signOut,
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                  padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                    mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
                    children: [
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.lock,
                        size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Kelua&lt;/span&gt;r&#39;, style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;))
                    ],
                  ),
                )),
          ),
        ],
      );
    } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
        mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
        children: [
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FlutterLogo&lt;/span&gt;(
            size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;250&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
            &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Anda&lt;/span&gt; belum masuk&#39;,
            style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
            padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;, vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ElevatedButton&lt;/span&gt;(
              onPressed: signIn,
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                  mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
                  children: [
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.lock,
                      size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                      width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Masuk&lt;/span&gt; dengan &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Google&lt;/span&gt;&#39;, style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;))
                  ],
                ),
              ),
            ),
          ),
        ],
      );
    }
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  11. All stages have been completed, now we can carry out trials. If the
  results are like the image below, it means you have succeeded
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDMDgKZLBVZGGl9yJ0sj4hXxwYMFRGLQ4nujUy8LJ_pmr4pKK0h6oGdaw4lptgOc_ZS4RZXsrqX0CyyxYlY_NI5T2vP6c1F8AsMI6eD8ZeKe7sm_z320ehlorVmzPAYAhzF08WNSsCl6xrh8wC3RAHJ-Lf5ZkuUKX6C50shMrsmQxaJsY_U4OO4RzNZ3Kj/s1600/WhatsApp%20Image%202023-11-26%20at%2017.54.12.jpeg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1600&quot; data-original-width=&quot;720&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDMDgKZLBVZGGl9yJ0sj4hXxwYMFRGLQ4nujUy8LJ_pmr4pKK0h6oGdaw4lptgOc_ZS4RZXsrqX0CyyxYlY_NI5T2vP6c1F8AsMI6eD8ZeKe7sm_z320ehlorVmzPAYAhzF08WNSsCl6xrh8wC3RAHJ-Lf5ZkuUKX6C50shMrsmQxaJsY_U4OO4RzNZ3Kj/s320/WhatsApp%20Image%202023-11-26%20at%2017.54.12.jpeg&quot; width=&quot;144&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzqVI-IXZd7gwM2v1N2xt1RR75q6MMTvA1oyF8dFrCcb7vOvmmbmO0hX2dcHTZ17DRsQ31PYkUe-4BafYvaVs3ppUfn_7FIj1XVlVb6im7f4rqUAAeSGLqF2W66ujdfgoO-1D-tiJub697F3TrDuKRRJvJ1qNCBDRd0CgQF5BjhmjOyjFGeSmenURh3awr/s1600/WhatsApp%20Image%202023-11-26%20at%2017.54.12%20(1).jpeg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1600&quot; data-original-width=&quot;720&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzqVI-IXZd7gwM2v1N2xt1RR75q6MMTvA1oyF8dFrCcb7vOvmmbmO0hX2dcHTZ17DRsQ31PYkUe-4BafYvaVs3ppUfn_7FIj1XVlVb6im7f4rqUAAeSGLqF2W66ujdfgoO-1D-tiJub697F3TrDuKRRJvJ1qNCBDRd0CgQF5BjhmjOyjFGeSmenURh3awr/s320/WhatsApp%20Image%202023-11-26%20at%2017.54.12%20(1).jpeg&quot; width=&quot;144&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  That&#39;s the tutorial on creating a Google login in Flutter. I hope it&#39;s useful.
  If you have any questions, please ask directly in the comments column below.
  That is all and thank you.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;br /&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-google-login-in-flutter-with.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZPxGLTkf7E_PDsqDmCAoNVi1Y_hZFdbjBcFj3on2YcYays6ZLUKr8feHz0uYzHgyzvNcJPGzjWjiXbJeu3pxsSu5L2Sg4YErK7aQoKQgIUgL2yqXvGy9NWlFdpA_rmiUEXqJvtj3l_gNXpbNSnKYZ3s9tiEyzELq2XH8MqaE9HeyWOMZgjQfJDH4EGKE/s72-c/Creating%20Google%20Login%20in%20Flutter%20with%20Firebase.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-2828786063861011553</guid><pubDate>Tue, 26 Dec 2023 12:37:00 +0000</pubDate><atom:updated>2023-12-26T04:37:16.869-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Create Login with Firebase feature in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMTBBmRA0CpFJDcIy1-DkY0NHAJdmsbq7-f0gpSZHIO3nYcfBD0VygeWyxubFniklfk47PqvnUbfvMaucNHrney63U53QaJpHmdNqGOJFAaqKSO1bJyVEyuaWyBUdEgoakJCk2bLk2C2Y0aD7gSPh7C1vz_8YG0w20LPzNLRBac661zrD4aRi-_UhkvE/s1500/Create%20Login%20with%20Firebase%20feature%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Create Login with Firebase feature in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMTBBmRA0CpFJDcIy1-DkY0NHAJdmsbq7-f0gpSZHIO3nYcfBD0VygeWyxubFniklfk47PqvnUbfvMaucNHrney63U53QaJpHmdNqGOJFAaqKSO1bJyVEyuaWyBUdEgoakJCk2bLk2C2Y0aD7gSPh7C1vz_8YG0w20LPzNLRBac661zrD4aRi-_UhkvE/s16000/Create%20Login%20with%20Firebase%20feature%20in%20Flutter.png&quot; title=&quot;Create Login with Firebase feature in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a login feature in Flutter with Firebase. How do you do it? Come on,
  follow the details below.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;How to Create Login with Firebase in Flutter&lt;/h2&gt;
&lt;p&gt;
  1. Create a flutter project, use flutter version 3 or a newer version that
  supports null safety.
&lt;/p&gt;
&lt;p&gt;
  2. Create a new project in firebase via
  &lt;a href=&quot;https://firebase.google.com&quot; target=&quot;_blank&quot;&gt;https://firebase.google.com&lt;/a&gt;. And connect the flutter project with firebase. Follow the tutorial at the
  following link
  &lt;a href=&quot;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&quot;&gt;https://www.porkaone.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html&lt;/a&gt;. You must connect Flutter to Firebase, because if not, an error will occur.
&lt;/p&gt;
&lt;p&gt;
  3. After successfully connecting, return to your Firebase dashboard. Click the
  build menu --&amp;gt; Authentication --&amp;gt; then select the sign-in method tab
  --&amp;gt; on native providers --&amp;gt; select email/password. Pay attention to the
  image below!
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgdNqlQRpRQkXgRwDxWFYrZZ0QQy8QI07CAW211o8IKJVxqkqnLozQxd3qaTAndnpmUMf-P83Cq057VRjXp-M08rVQjojvEw22E-RM1CkpmQlDRXav_i2hQPV6CCBFUQP0V1pufSbJzFo14jRbSrGzarG17ry9Im3Lpz9uriiWCRKKqe_EmOJvd7N9-Dh6S&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;901&quot; data-original-width=&quot;1755&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgdNqlQRpRQkXgRwDxWFYrZZ0QQy8QI07CAW211o8IKJVxqkqnLozQxd3qaTAndnpmUMf-P83Cq057VRjXp-M08rVQjojvEw22E-RM1CkpmQlDRXav_i2hQPV6CCBFUQP0V1pufSbJzFo14jRbSrGzarG17ry9Im3Lpz9uriiWCRKKqe_EmOJvd7N9-Dh6S=s16000&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Provider&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  4. Then click or switch enable as shown in the image below. Then click save.
  At this point, the Firebase configuration is complete. It&#39;s time for us to
  code!
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjVUh6MFq84zBAtdFEE3wEUBHnkgfA-KNoBLoEER-GdzkZ0NgEuj48S9d8iYHwKx6A3yc1FLYqrT_6y-1tnKG1Fivo6o2L56VQYI0GVaQlFaQp1gOQ-vyPl0woGXT4vqjLaFJmZpLvAcQLhp71FO71t0SgaztgoTvPKtpaXNJI9gEBhvjWyzqoF3jXBbUlk&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;798&quot; data-original-width=&quot;1453&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjVUh6MFq84zBAtdFEE3wEUBHnkgfA-KNoBLoEER-GdzkZ0NgEuj48S9d8iYHwKx6A3yc1FLYqrT_6y-1tnKG1Fivo6o2L56VQYI0GVaQlFaQp1gOQ-vyPl0woGXT4vqjLaFJmZpLvAcQLhp71FO71t0SgaztgoTvPKtpaXNJI9gEBhvjWyzqoF3jXBbUlk=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Providers&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  5. Still on the authentication page. Click the Users tab --&amp;gt; click the add
  user button, then fill in the desired email and password --&amp;gt; then click add
  user to save the data.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiC7cOomRbq4EvxXObtBBlo1_0Pi5tZSSVZuscxvbLyjkw6-ZHGfyIEEeYs8bcsB3jES9hzx3kDAUcl6xA0yy66FmJJqaowCcZ7_HQQTajbvc4sFCv4rnb6cj9j9KFUrd1VXgpkcHq-Axfvm1ESCCWbLF0Cn8YeIspJNrpDtrKM1RxdQVSBaFE1afYebqUL&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;805&quot; data-original-width=&quot;1521&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiC7cOomRbq4EvxXObtBBlo1_0Pi5tZSSVZuscxvbLyjkw6-ZHGfyIEEeYs8bcsB3jES9hzx3kDAUcl6xA0yy66FmJJqaowCcZ7_HQQTajbvc4sFCv4rnb6cj9j9KFUrd1VXgpkcHq-Axfvm1ESCCWbLF0Cn8YeIspJNrpDtrKM1RxdQVSBaFE1afYebqUL=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add User&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  6. Return to your flutter project. Then open the pubspec.yaml file and add the
  firebase_core: ^2.23.0 and firebase_auth: ^4.14.1 packages as shown below.
  Then save the file to download the package.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiiYDlFWWVK9LatDhzaNgt_i21ZtPiJwTvMJGdGa41h3D16r70QazuYTcsCjy7XnWHLAfYgE7tFdeK4QuFygy7yLpFNwxw0Hbl_whwISg5m0PlMmvZd1LUTI9EsNMjT3pZVx_fr3m9Q5ceSC8vjC4PaFP3-9VkRDAuQneMO__2p-ekEu-a-ZneQrbBTq7ZG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;484&quot; data-original-width=&quot;903&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiiYDlFWWVK9LatDhzaNgt_i21ZtPiJwTvMJGdGa41h3D16r70QazuYTcsCjy7XnWHLAfYgE7tFdeK4QuFygy7yLpFNwxw0Hbl_whwISg5m0PlMmvZd1LUTI9EsNMjT3pZVx_fr3m9Q5ceSC8vjC4PaFP3-9VkRDAuQneMO__2p-ekEu-a-ZneQrbBTq7ZG=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
  7. Open the main.dart file then modify it with the script below.&lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_core/firebase_core.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_auth/firebase_auth.dart&#39;;


&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;firebase_options&lt;/span&gt;.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;home&lt;/span&gt;.dart&#39;;


void main() async {
  
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WidgetsFlutterBinding&lt;/span&gt;.ensureInitialized();

  
  await &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Firebase&lt;/span&gt;.initializeApp(
    options: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DefaultFirebaseOptions&lt;/span&gt;.currentPlatform,
  );

  
  runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
}


&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
      title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Firebase&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Auth&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Demo&lt;/span&gt;&#39;,
      theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
        primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
      ),
      
      home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginPage&lt;/span&gt;(),
    );
  }
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginPage&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  _LoginPageState createState() =&amp;gt; _LoginPageState();
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_LoginPageState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;LoginPage&amp;gt;&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FirebaseAuth&lt;/span&gt; _auth = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FirebaseAuth&lt;/span&gt;.instance;

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt; _emailController = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt;();
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt; _passwordController = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt;();

  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;void&amp;gt; _login() async {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;try&lt;/span&gt; {
      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;UserCredential&lt;/span&gt; userCredential = await _auth.signInWithEmailAndPassword(
        email: _emailController.text,
        password: _passwordController.text,
      );

      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.pushReplacement(
        context,
        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
            builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;HomePage&lt;/span&gt;(userCredential.user?.email ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&quot;&quot;&lt;/span&gt;)),
      );
    } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;catch&lt;/span&gt; (e) {
      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ScaffoldMessenger&lt;/span&gt;.of(context).showSnackBar(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SnackBar&lt;/span&gt;(
        content: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Email&lt;/span&gt; atau &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Password&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Anda&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Salah&lt;/span&gt;!&#39;),
        action: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SnackBarAction&lt;/span&gt;(
          label: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Tutu&lt;/span&gt;p&#39;,
          onPressed: () {
          },
        ),
      ));
      print(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&quot;Error: $e&quot;&lt;/span&gt;);
    }
  }

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
      appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Logi&lt;/span&gt;n&#39;),
      ),
      body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
        padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;),
        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
          mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
          children: [
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextField&lt;/span&gt;(
              controller: _emailController,
              decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Emai&lt;/span&gt;l&#39;),
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextField&lt;/span&gt;(
              controller: _passwordController,
              decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Passwor&lt;/span&gt;d&#39;),
              obscureText: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
              width: double.infinity,
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ElevatedButton&lt;/span&gt;(
                onPressed: _login,
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Logi&lt;/span&gt;n&#39;),
              ),
            ),
          ],
        ),
      ),
    );
  }
}&lt;/pre&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;8. Create a new file with the name home.dart then add the script below.&lt;/p&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_auth/firebase_auth.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;main&lt;/span&gt;.dart&#39;;

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;HomePage&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; userEmail;

  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;HomePage&lt;/span&gt;(&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.userEmail);

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
      appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Hom&lt;/span&gt;e&#39;),
      ),
      body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
          mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
          children: [
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Selamat&lt;/span&gt; datang, $userEmail!&#39;),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ElevatedButton&lt;/span&gt;(
              onPressed: () async {
                await &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FirebaseAuth&lt;/span&gt;.instance.signOut();
                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.pushReplacement(
                  context,
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginPage&lt;/span&gt;()),
                );
              },
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Logou&lt;/span&gt;t&#39;),
            ),
          ],
        ),
      ),
    );
  }
}&lt;/pre&gt;

  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9. We have carried out all the steps. If successful, the
  display will look like the image below. Make sure all steps are carried out as
  above, if an error occurs, immediately ask directly in the comments column
  below.

  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1JflPqfP6TY0yYAmeAyeaxPEGypvjPp3qiAqn5W1lgjDb5xOWuXIfGo_Mo-RJ6QtrogJ8pZLuhXkpoTHTczGVF6Mg7NpQEmInu8MtnLRRXJLV3P2STRIsD0V9HpzH1U0dnUZlJ58GMm1cxK6FwRJsAquEbEIEWgh9QHWYhizcguVIM2p9U1w0dRsVVbb/s524/Screenshot_1701069649.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;524&quot; data-original-width=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA1JflPqfP6TY0yYAmeAyeaxPEGypvjPp3qiAqn5W1lgjDb5xOWuXIfGo_Mo-RJ6QtrogJ8pZLuhXkpoTHTczGVF6Mg7NpQEmInu8MtnLRRXJLV3P2STRIsD0V9HpzH1U0dnUZlJ58GMm1cxK6FwRJsAquEbEIEWgh9QHWYhizcguVIM2p9U1w0dRsVVbb/s16000/Screenshot_1701069649.png&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3m1m-U5aTLxxbtWiu9INVKnSHjI08efv7xeLQQbX-ddlszTgXl3xBu5GSaJSP_cziX7EHWUKk40yup5A5rQ2RIosFmuHl0G8qqYxGx1W9VhcoVHBVkvS8jhrZLcDQGlNQTw73usoCCIWgDq4WDyiCVyCzA9uN5Z70948__625P0ZX9feJxI2vS4ESE-Hc/s524/Screenshot_1701069671.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;524&quot; data-original-width=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3m1m-U5aTLxxbtWiu9INVKnSHjI08efv7xeLQQbX-ddlszTgXl3xBu5GSaJSP_cziX7EHWUKk40yup5A5rQ2RIosFmuHl0G8qqYxGx1W9VhcoVHBVkvS8jhrZLcDQGlNQTw73usoCCIWgDq4WDyiCVyCzA9uN5Z70948__625P0ZX9feJxI2vS4ESE-Hc/s16000/Screenshot_1701069671.png&quot; /&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;
    You can create an even cooler appearance by using shapes and images as you
    wish.
  &lt;/p&gt;
  &lt;p&gt;
    OK, that&#39;s the tutorial on how to create a login feature with Firebase in
    Flutter. Hopefully this short tutorial is useful. If there are any problems,
    immediately ask directly in the comments column below. That&#39;s all and thank
    you very much.
  &lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/create-login-with-firebase-feature-in.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigMTBBmRA0CpFJDcIy1-DkY0NHAJdmsbq7-f0gpSZHIO3nYcfBD0VygeWyxubFniklfk47PqvnUbfvMaucNHrney63U53QaJpHmdNqGOJFAaqKSO1bJyVEyuaWyBUdEgoakJCk2bLk2C2Y0aD7gSPh7C1vz_8YG0w20LPzNLRBac661zrD4aRi-_UhkvE/s72-c/Create%20Login%20with%20Firebase%20feature%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-7436773190299365671</guid><pubDate>Tue, 26 Dec 2023 12:16:00 +0000</pubDate><atom:updated>2023-12-26T04:16:31.766-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Cool News Detail View in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEbD6ZmasYyGnULTOVQ0Ti3PdLka1B0VZ8Oy0NziYsFFRhpDJC7d90UCkhL-yyrLH_vXONoGtpF0aJIv9GIda994eUaChHD8iFzYMoM2AiRwkJokva_BBdR1I6Dm9es0jqKUZ8TWaGodCZnhPb40TolaQDyK0Hrws442t8eWq0-WCff7WeHxaZQ2u9NE/s1500/Cool%20News%20Detail%20View%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cool News Detail View in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEbD6ZmasYyGnULTOVQ0Ti3PdLka1B0VZ8Oy0NziYsFFRhpDJC7d90UCkhL-yyrLH_vXONoGtpF0aJIv9GIda994eUaChHD8iFzYMoM2AiRwkJokva_BBdR1I6Dm9es0jqKUZ8TWaGodCZnhPb40TolaQDyK0Hrws442t8eWq0-WCff7WeHxaZQ2u9NE/s16000/Cool%20News%20Detail%20View%20in%20Flutter.png&quot; title=&quot;Cool News Detail View in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Cool Detail Page Views in Flutter. Detail Page View with Card and Container
  List View in Flutter, Detail View in Flutter. Create Cool and Beautiful Detail
  Views in Flutter. Creating Card and Detail Views in Flutter. Flutter UI Card.
  Creating Views Quickly and Easily in Flutter. Script to Create a Profile Page
  in Flutter Quickly. Combining List View and Other Flutter Widgets, Creating a
  Professional Android Appearance, Flutter Template Design. Flutter List View
  Simple Design, Flutter Login Design Fresh &amp;amp; Modern, Flutter News Grid
  Design, Flutter Product List Grid View Page View, Flutter Vertical and
  Horizontal Scoll Design, Flutter Profile View
&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  1. Create a new flutter project then copy the script below in lib/main.dart
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;

  void main() {
    runApp(const MyApp());
  }
  
  class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
  &lt;span class=&quot;hljs-attr&quot;&gt;      debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Profile Page&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      theme:&lt;/span&gt; ThemeData(primarySwatch: Colors.blue),
  &lt;span class=&quot;hljs-attr&quot;&gt;      home:&lt;/span&gt; const ProfilePage(),
      );
    }
  }
  
  class ProfilePage extends StatefulWidget {
    const ProfilePage({Key? key}) : super(key: key);
  
    @override
    State&amp;lt;ProfilePage&amp;gt; createState() =&amp;gt; _ProfilePageState();
  }
  
  class _ProfilePageState extends State&amp;lt;ProfilePage&amp;gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  &lt;span class=&quot;hljs-attr&quot;&gt;      body:&lt;/span&gt; ListView(
  &lt;span class=&quot;hljs-attr&quot;&gt;        padding:&lt;/span&gt; EdgeInsets.zero,
  &lt;span class=&quot;hljs-attr&quot;&gt;        children:&lt;/span&gt; [
            Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;            width:&lt;/span&gt; double.infinity,
  &lt;span class=&quot;hljs-attr&quot;&gt;            height:&lt;/span&gt; MediaQuery.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;            decoration:&lt;/span&gt; BoxDecoration(
                // color: Colors.grey[&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;400&lt;/span&gt;],
  &lt;span class=&quot;hljs-attr&quot;&gt;              image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  image:&lt;/span&gt; NetworkImage(
                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2019/04/12/16/52/city-4122550_1280.jpg&#39;&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  fit:&lt;/span&gt; BoxFit.cover),
              ),
            ),
            SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;            height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
            ),
            Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;            padding:&lt;/span&gt; EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;            child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;              crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;              children:&lt;/span&gt; [
                  Wrap(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; EdgeInsets.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.grey,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Text(
                          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Technology&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          color:&lt;/span&gt; Colors.white,
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; EdgeInsets.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.grey,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Text(
                          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Tutorial&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          color:&lt;/span&gt; Colors.white,
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                  ),
                  Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Creating a Beautiful Login page in Flutter using Restful Api&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.w400),
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                  ),
                  Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.all(Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          image:&lt;/span&gt; NetworkImage(
                              &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;&lt;/span&gt;,
                            ),
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      children:&lt;/span&gt; [
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Nabil Putra&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;14&lt;/span&gt;),
                          ),
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Publisher&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                          ),
                        ],
                      ),
                    ],
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                  ),
                  Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n\n&#39;&lt;/span&gt;
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n\n&#39;&lt;/span&gt;
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. \n\n&#39;&lt;/span&gt;
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? \n\n&#39;&lt;/span&gt;
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
                  )
                ],
              ),
            )
          ],
        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;      bottomNavigationBar:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;        color:&lt;/span&gt; Colors.grey[&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;],
  &lt;span class=&quot;hljs-attr&quot;&gt;        padding:&lt;/span&gt; EdgeInsets.symmetric(vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;        child:&lt;/span&gt; Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;          padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;            left:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, 
  &lt;span class=&quot;hljs-attr&quot;&gt;            right:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;
            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;          child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;            mainAxisAlignment:&lt;/span&gt; MainAxisAlignment
                  .spaceEvenly,
  &lt;span class=&quot;hljs-attr&quot;&gt;            children:&lt;/span&gt; [
                Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    color:&lt;/span&gt; Colors.white,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                    ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  padding:&lt;/span&gt; EdgeInsets.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  child:&lt;/span&gt; TextFormField(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    textAlign:&lt;/span&gt; TextAlign.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    textAlignVertical:&lt;/span&gt; TextAlignVertical.top,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    decoration:&lt;/span&gt; InputDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      hintText:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Type to Comment .....&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      hintStyle:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      border:&lt;/span&gt; InputBorder.none,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      contentPadding:&lt;/span&gt; EdgeInsets.symmetric(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        vertical:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        horizontal:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                        ),
                      ),
                    ),
                  ),
                ),
                SizedBox(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  color:&lt;/span&gt; Colors.red,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                  ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Center(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  child:&lt;/span&gt; Icon(
                      Icons.favorite,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    color:&lt;/span&gt; Colors.white,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;24&lt;/span&gt;,
                    ),
                  ),
                ),
                SizedBox(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;),
                Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                  ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Center(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  child:&lt;/span&gt; Icon(
                      Icons.share,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    color:&lt;/span&gt; Colors.white,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;24&lt;/span&gt;,
                    ),
                  ),
                )
              ],
            ),
          ),
        ),
      );
    }
  }&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  2. Display when the script is run in the emulator. We use several widgets such
  as stack, bottom navigation bar, container, button, card, column, row,
  listview, wrap.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeWRQPFyYpoukWxvN2sdMMG86tHW1VwJP6qvdSpe0a0rFPcfxu4r9gx7krl94JwFyxinKRE6-h4UkOVjFyv1FQGqgnptW1r2sCGcAsC2uJE5Ugd-BOT5FZsTzuBIy70ni8xUsG1cytKbj2LgrQGbNEAG9G37tR22uM7cYl_0Te50d8boyYGQbaUr9Y7JY/s700/Screenshot_2023-06-25-10-00-10-57_a922126b8b03a55e4df3005b30001b8a.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sahretech Detail Page Ui in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeWRQPFyYpoukWxvN2sdMMG86tHW1VwJP6qvdSpe0a0rFPcfxu4r9gx7krl94JwFyxinKRE6-h4UkOVjFyv1FQGqgnptW1r2sCGcAsC2uJE5Ugd-BOT5FZsTzuBIy70ni8xUsG1cytKbj2LgrQGbNEAG9G37tR22uM7cYl_0Te50d8boyYGQbaUr9Y7JY/s16000/Screenshot_2023-06-25-10-00-10-57_a922126b8b03a55e4df3005b30001b8a.jpg&quot; title=&quot;Sahretech Detail Page Ui in Flutter&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Detail Page&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 1. Flutter&#39;s Cool Vertical and Horizontal ListView Views &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/flutters-cool-vertical-and-horizontal.html&quot;&gt;read more&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 2.Cool Grid View Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-grid-view-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 3. Beautiful Chat Design Display Flutter Starter Template &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/beautiful-chat-design-display-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 4. Cool List Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-list-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/cool-news-detail-view-in-flutter.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEbD6ZmasYyGnULTOVQ0Ti3PdLka1B0VZ8Oy0NziYsFFRhpDJC7d90UCkhL-yyrLH_vXONoGtpF0aJIv9GIda994eUaChHD8iFzYMoM2AiRwkJokva_BBdR1I6Dm9es0jqKUZ8TWaGodCZnhPb40TolaQDyK0Hrws442t8eWq0-WCff7WeHxaZQ2u9NE/s72-c/Cool%20News%20Detail%20View%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-4146002118861489865</guid><pubDate>Tue, 26 Dec 2023 02:36:00 +0000</pubDate><atom:updated>2023-12-25T18:36:02.521-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Displaying API Data with Flutter MVC Pattern</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhVsXM5xqFbQLcmUSbPJASBlKn8KhJGb-CFiR057ltc9-JUquCVUBOCCoTyqminKbtVsVoRckp0CxVVKK88dHLQoYXI8R0CCetuhvZz_hDtmvZlUApd_L60EMXuRLIkHCUb4ldJA5UbJUqpsjALyTauGlVKOdAZFmoea2OKJaxpJIMhkX1rkcu3vT4vWg/s1500/Displaying%20API%20Data%20with%20Flutter%20MVC%20Pattern.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Displaying API Data with Flutter MVC Pattern&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhVsXM5xqFbQLcmUSbPJASBlKn8KhJGb-CFiR057ltc9-JUquCVUBOCCoTyqminKbtVsVoRckp0CxVVKK88dHLQoYXI8R0CCetuhvZz_hDtmvZlUApd_L60EMXuRLIkHCUb4ldJA5UbJUqpsjALyTauGlVKOdAZFmoea2OKJaxpJIMhkX1rkcu3vT4vWg/s16000/Displaying%20API%20Data%20with%20Flutter%20MVC%20Pattern.png&quot; title=&quot;Displaying API Data with Flutter MVC Pattern&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to tidy up our Flutter project with the MVC concept. Not only that, we will
  also learn how to retrieve fire data. Are you curious? Come on, follow the
  tutorial below.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;MVC&lt;/h1&gt;
&lt;p&gt;
  MVC stands for M(model), V(view), and C(controller). The model represents the
  structure of the stored data, the view represents the appearance in an
  application, the controller represents the logic or process in an application.
&lt;/p&gt;
&lt;p&gt;
  This concept makes it easier for programmers to maintain the applications they
  create, they are easier to read, repair, can be developed in parallel and
  scripts created on one page are not too long, because the logic, data
  structure and appearance are created separately.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;What Will You Learn?&lt;/h1&gt;
&lt;p&gt;
  In our tutorial this time, we will learn how to create a simple flutter
  application that uses the MVC design in its folder structure. Apart from that,
  we will also learn how to get API data from the internet and display it in the
  application. Regarding fire, I have written several articles that you can read
&lt;/p&gt;
  &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 1. Flutter&#39;s Cool Vertical and Horizontal ListView Views &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/flutters-cool-vertical-and-horizontal.html&quot;&gt;read more&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 2.Cool Grid View Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-grid-view-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 3. Beautiful Chat Design Display Flutter Starter Template &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/beautiful-chat-design-display-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          📰 4. Cool List Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-list-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;How to Create MVC and Get Data Api in Flutter&lt;/h1&gt;
&lt;p&gt;1. Create a new flutter project with the name flutter_mvc_app.&lt;/p&gt;
&lt;p&gt;2. Open the pubspec.yaml file and add http: ^0.13.4 as shown below.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjyiX67kRoKjerHBTfNZeN_1a-K_W7Pl9TIVtW-DaiRwnWmegpIbqQ8A-ehFlypnRnd2MAO2sRTd56wsNTVLuIyBgatcNbjqhH3ChWLooLoIQlNSzCoveOPjtG6pLXH6O-FybNrVxKU2Pby2K6v2Nw5R9-FjyeGkOeijsr5tCxtZJoqzRUVkE80NZSssQ&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Membuat MVC Flutter&quot; data-original-height=&quot;172&quot; data-original-width=&quot;383&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjyiX67kRoKjerHBTfNZeN_1a-K_W7Pl9TIVtW-DaiRwnWmegpIbqQ8A-ehFlypnRnd2MAO2sRTd56wsNTVLuIyBgatcNbjqhH3ChWLooLoIQlNSzCoveOPjtG6pLXH6O-FybNrVxKU2Pby2K6v2Nw5R9-FjyeGkOeijsr5tCxtZJoqzRUVkE80NZSssQ=s16000&quot; title=&quot;Membuat MVC Flutter&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  2. Create a new folder with the name models in the lib folder. Then create a
  file with the name product_model.dart in the models folder then fill it with
  the script below.
&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;php&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Product&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; category;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;double&lt;/span&gt; price;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; thumbnail;

  Product({required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.category, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.price, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.thumbnail});

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;factory&lt;/span&gt; Product.fromJson(&lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; json) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Product(
      title: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;],
      category: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;category&#39;&lt;/span&gt;],
      price: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;price&#39;&lt;/span&gt;].toDouble(),
      thumbnail: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;thumbnail&#39;&lt;/span&gt;],
    );
  }
}
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  3. Create a new folder with the name controllers in the lib folder. Then
  create a file with the name product_controller.dart in the controllers folder
  then fill it with the script below.
&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;php&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;../models/product.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Create a ProductController class&lt;/span&gt;
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ProductController&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Define a list to store the products&lt;/span&gt;
    &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;Product&amp;gt; products = [];
  
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Define a method to fetch the products asynchronously&lt;/span&gt;
    Future fetchProducts() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Send an HTTP GET request to the API endpoint&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response =
          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://dummyjson.com/products&#39;&lt;/span&gt;));
  
      &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Check if the response status code is 200 (OK)&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Parse the JSON response and extract the &#39;products&#39; data&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; data = jsonDecode(response.body)[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;products&#39;&lt;/span&gt;];
  
        &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Convert the JSON data to a list of Product objects and assign it to the products list&lt;/span&gt;
        products = data.map((json) =&amp;gt; Product.fromJson(json)).toList();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Throw an exception if the request fails&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to fetch products&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  4. Buatlah sebuah folder baru dengan nama&amp;nbsp;&lt;b&gt;views&lt;/b&gt;&amp;nbsp;di dalam
  folder&amp;nbsp;&lt;b&gt;lib&lt;/b&gt;. Lalu buat file dengan
  nama&amp;nbsp;&lt;b&gt;product_views.dart&lt;/b&gt;&amp;nbsp;di dalam
  folder&amp;nbsp;&lt;b&gt;views&amp;nbsp;&lt;/b&gt;lalu isi dengan script di bawah ini.
&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;php&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &#39;../controllers/product_controller.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &#39;../models/product.dart&#39;;
  
  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Define a ProductView widget which is a StatefulWidget&lt;/span&gt;
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ProductView&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    _ProductViewState createState() =&amp;gt; _ProductViewState();
  }
  
  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Define the state of the ProductView widget&lt;/span&gt;
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_ProductViewState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;ProductView&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    late &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Product&lt;/span&gt;&amp;gt;&amp;gt; _futureProducts; &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Declare a Future to store the list of products&lt;/span&gt;
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    void initState() {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.initState();
      _futureProducts = _fetchProducts(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Initialize the future with the result of _fetchProducts() method&lt;/span&gt;
    }
  
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Define a method to fetch the products asynchronously&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Product&lt;/span&gt;&amp;gt;&amp;gt; _fetchProducts() async {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; productController = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ProductController&lt;/span&gt;(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Create an instance of the ProductController&lt;/span&gt;
      await productController.fetchProducts(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Fetch the products using the controller&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; productController.products; &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Return the fetched products&lt;/span&gt;
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Product&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Product&lt;/span&gt;&amp;gt;&amp;gt;(
          future: _futureProducts, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Use the future to retrieve the list of products&lt;/span&gt;
          builder: (context, snapshot) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
              &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Show a loading indicator if the future is not yet complete&lt;/span&gt;
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
              );
            } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
              &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Show an error message if there was an error fetching the products&lt;/span&gt;
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;),
              );
            } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
              &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Show the list of products if data is available&lt;/span&gt;
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; products = snapshot.data!;
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                itemCount: products.length,
                itemBuilder: (context, index) {
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; product = products[index];
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                    leading: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                      product.thumbnail,
                      fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Set the fit property to BoxFit.cover&lt;/span&gt;
                      width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Set a fixed width for the image&lt;/span&gt;
                      height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Set a fixed height for the image&lt;/span&gt;
                    ),
                    title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(product.title),
                    subtitle: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(product.category),
                    trailing: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&#39;\$${product.price.toStringAsFixed(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)}&#39;),
                  );
                },
              );
            } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
              &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Show a message if no data is available&lt;/span&gt;
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;No&lt;/span&gt; data available&#39;),
              );
            }
          },
        ),
      );
    }
  }&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;5. Open the lib/main.dart file and change the script as below.&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;php&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;&lt;/span&gt;views/product_view.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Your&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Name&lt;/span&gt;&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
          primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
        ),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ProductView&lt;/span&gt;(),
      );
    }
  }&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Also make sure the folder structure you create is the same as the folder
  structure I created as shown in the image below.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhhfkzssZOiiwa9otBXxw8u2raAurPl8QzAwyDXtRvYSsoTCC2LglBn0gzNhNo_2esAdNGH6UGJbG2gjBWtBtCXj23uukENtdB8p9RR0e3bC0OczoKZE5JVBrCxy8QOpKraAAzRWc61w9smJxPY16hjQXqeL5Cu7MsMd_PzT3Ot19MLMa-4qjN9k8836A&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Struktur Folder MVC Flutter&quot; data-original-height=&quot;174&quot; data-original-width=&quot;342&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhhfkzssZOiiwa9otBXxw8u2raAurPl8QzAwyDXtRvYSsoTCC2LglBn0gzNhNo_2esAdNGH6UGJbG2gjBWtBtCXj23uukENtdB8p9RR0e3bC0OczoKZE5JVBrCxy8QOpKraAAzRWc61w9smJxPY16hjQXqeL5Cu7MsMd_PzT3Ot19MLMa-4qjN9k8836A=s16000&quot; title=&quot;Struktur Folder MVC Flutter&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;MVC Folder&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  6. We have done all the steps, then we can carry out trials. Open the emulator
  and run the application. If successful, the display will look like the image
  below.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiaKD-Nu8pAIzeKupge-iLvcJ8NpWXNkFQ1QAnJ6CZo9Oe5absmpV8fSv4fD-sDt5rzBPZ5o8C7V73kh93OlZPpiayudukbFIpeZknxXeIzz7DJXIXTnnAwk9TdzFnSxw3jExCfGTT1MwVkJnMVnMEoyMjp-uQBn_67Y890TRIR6UiwsfhKVDWZ5_lEJA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Membuat MVC Flutter Sahretech&quot; data-original-height=&quot;718&quot; data-original-width=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiaKD-Nu8pAIzeKupge-iLvcJ8NpWXNkFQ1QAnJ6CZo9Oe5absmpV8fSv4fD-sDt5rzBPZ5o8C7V73kh93OlZPpiayudukbFIpeZknxXeIzz7DJXIXTnnAwk9TdzFnSxw3jExCfGTT1MwVkJnMVnMEoyMjp-uQBn_67Y890TRIR6UiwsfhKVDWZ5_lEJA=s16000&quot; title=&quot;Membuat MVC Flutter Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Final Result&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Cool! Now you can create a Flutter application that can display data from the
  internet and use MVC design to make your application neater. Please improve
  the application that has been created to make it more interesting.
&lt;/p&gt;
&lt;p&gt;
  That&#39;s it for our tutorial this time on how to display API data with the MVC
  pattern in Flutter. Hopefully this short tutorial is useful. If you have
  questions, please ask in the comments column. That&#39;s all and receive a salary.
&lt;/p&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
    (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/displaying-api-data-with-flutter-mvc.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhVsXM5xqFbQLcmUSbPJASBlKn8KhJGb-CFiR057ltc9-JUquCVUBOCCoTyqminKbtVsVoRckp0CxVVKK88dHLQoYXI8R0CCetuhvZz_hDtmvZlUApd_L60EMXuRLIkHCUb4ldJA5UbJUqpsjALyTauGlVKOdAZFmoea2OKJaxpJIMhkX1rkcu3vT4vWg/s72-c/Displaying%20API%20Data%20with%20Flutter%20MVC%20Pattern.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-3215968504582729933</guid><pubDate>Tue, 26 Dec 2023 00:43:00 +0000</pubDate><atom:updated>2023-12-25T16:43:29.619-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Cool Profile Page Display in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a
    href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4G1rBzsNYwbn0iswSxdn3tfMYYAlXoYNNYUh9mYeqd6iMF6pW2euH32h5-mpqy3rxcrO7YeNXSnHF7bnuukFsYSojR-y4Ue7wOwssWQKooCIkFCnXPOIftk_zUnVrqvHtXNENwiIF82fMYrf8JRwWA6GiVMI_CqCfzmcwNRv99PllIiL17SgHdLzwxL0/s1500/Cool%20Profile%20Page%20Display%20in%20Flutter.png&quot;
    imageanchor=&quot;1&quot;
    style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;
    &gt;&lt;img
      alt=&quot;Cool Profile Page Display in Flutter&quot;
      border=&quot;0&quot;
      data-original-height=&quot;845&quot;
      data-original-width=&quot;1500&quot;
      src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4G1rBzsNYwbn0iswSxdn3tfMYYAlXoYNNYUh9mYeqd6iMF6pW2euH32h5-mpqy3rxcrO7YeNXSnHF7bnuukFsYSojR-y4Ue7wOwssWQKooCIkFCnXPOIftk_zUnVrqvHtXNENwiIF82fMYrf8JRwWA6GiVMI_CqCfzmcwNRv99PllIiL17SgHdLzwxL0/s16000/Cool%20Profile%20Page%20Display%20in%20Flutter.png&quot;
      title=&quot;Cool Profile Page Display in Flutter&quot;
  /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;
  Cool Profile Page Display in Flutter. Profile Page View with Card and
  Container List View in Flutter, Profile View in Flutter. Create a Cool and
  Beautiful Profile Display in Flutter. Creating Card and Profile Views in
  Flutter. Flutter UI Card. Creating Views Quickly and Easily in Flutter. Script
  to Create a Profile Page in Flutter Quickly. Combining List View and Other
  Flutter Widgets, Creating a Professional Android Appearance, Flutter Template
  Design. Flutter List View Simple Design, Flutter Login Design Fresh &amp;amp;
  Modern, Flutter News Grid Design, Flutter Product List Grid View Page View,
  Flutter Vertical and Horizontal Scoll Design
&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  1. Create a new flutter project then copy the script below in lib/main.dart
&lt;/p&gt;
&lt;pre
  class=&quot;line-numbers language-markup&quot;
  data-codetype=&quot;CSSku&quot;
  style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot;
  title=&quot;Script&quot;
&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;

  void main() {
    runApp(const MyApp());
  }
  
  class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
  &lt;span class=&quot;hljs-attr&quot;&gt;      debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Profile Page&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      theme:&lt;/span&gt; ThemeData(primarySwatch: Colors.blue),
  &lt;span class=&quot;hljs-attr&quot;&gt;      home:&lt;/span&gt; const ProfilePage(),
      );
    }
  }
  
  class ProfilePage extends StatefulWidget {
    const ProfilePage({Key? key}) : super(key: key);
  
    @override
    State&amp;lt;ProfilePage&amp;gt; createState() =&amp;gt; _ProfilePageState();
  }
  
  class _ProfilePageState extends State&amp;lt;ProfilePage&amp;gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  &lt;span class=&quot;hljs-attr&quot;&gt;        body:&lt;/span&gt; ListView(
  &lt;span class=&quot;hljs-attr&quot;&gt;      padding:&lt;/span&gt; EdgeInsets.zero,
  &lt;span class=&quot;hljs-attr&quot;&gt;      children:&lt;/span&gt; [
          Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;            width:&lt;/span&gt; double.infinity,
  &lt;span class=&quot;hljs-attr&quot;&gt;            height:&lt;/span&gt; MediaQuery.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.30&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;            decoration:&lt;/span&gt; BoxDecoration(
                // color: Colors.grey[&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;400&lt;/span&gt;],
  &lt;span class=&quot;hljs-attr&quot;&gt;              image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  image:&lt;/span&gt; NetworkImage(
                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2021/09/03/00/51/temple-6594770_1280.jpg&#39;&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  fit:&lt;/span&gt; BoxFit.cover),
              )),
          Transform.translate(
  &lt;span class=&quot;hljs-attr&quot;&gt;          offset:&lt;/span&gt; Offset(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.0&lt;/span&gt;, &lt;span class=&quot;hljs-bullet&quot; style=&quot;color: #6897bb;&quot;&gt;-120&lt;/span&gt; / &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;          child:&lt;/span&gt; Center(
  &lt;span class=&quot;hljs-attr&quot;&gt;            child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;              children:&lt;/span&gt; [
                  Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      borderRadius:&lt;/span&gt; BorderRadius.all(Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          image:&lt;/span&gt; NetworkImage(
                                &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2016/03/31/19/56/avatar-1295399_640.png&#39;&lt;/span&gt;))),
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;,
                  ),
                  Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Nabil Chen&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;24&lt;/span&gt;, fontWeight: FontWeight.w500),
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                  ),
                  Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Director of Sahretech&#39;&lt;/span&gt;,
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;,
                  ),
                  Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.center,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.center,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          onPressed:&lt;/span&gt; () {
                              // Implement your button action here
                            },
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
                            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            children:&lt;/span&gt; [
                                Icon(Icons.person_add_alt),
                                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                                ),
                                Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Follow&#39;&lt;/span&gt;)
                              ],
                            )),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;, // Atur tinggi Container sesuai kebutuhan Anda
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          onPressed:&lt;/span&gt; () {
                              // Implement your button action here
                            },
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
                            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            children:&lt;/span&gt; [
                                Icon(Icons.message),
                                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                                ),
                                Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Message&#39;&lt;/span&gt;)
                              ],
                            )),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          onPressed:&lt;/span&gt; () {
                              // Implement your button action here
                            },
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
                            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            children:&lt;/span&gt; [
                                Icon(Icons.settings),
                                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                                ),
                                Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Edit&#39;&lt;/span&gt;)
                              ],
                            )),
                      )
                    ],
                  ),
                  SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;24&lt;/span&gt;,
                  ),
                  Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.center,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.spaceEvenly,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      children:&lt;/span&gt; [
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;900&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.bold),
                          ),
                          Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Posts&#39;&lt;/span&gt;),
                        ],
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      color:&lt;/span&gt; Colors.black,
                      ),
                      Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      children:&lt;/span&gt; [
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;9.204&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.bold),
                          ),
                          Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Followers&#39;&lt;/span&gt;),
                        ],
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      color:&lt;/span&gt; Colors.black,
                      ),
                      Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      children:&lt;/span&gt; [
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;300&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.bold),
                          ),
                          Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Following&#39;&lt;/span&gt;),
                        ],
                      ),
                    ],
                  ),
                  
                  ListView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  padding:&lt;/span&gt; EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;, 
  &lt;span class=&quot;hljs-attr&quot;&gt;                    left:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, 
  &lt;span class=&quot;hljs-attr&quot;&gt;                    right:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;
                    ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  shrinkWrap:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  physics:&lt;/span&gt; NeverScrollableScrollPhysics(),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemBuilder:&lt;/span&gt; (_, item) {
                      return Card(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            children:&lt;/span&gt; [
                                Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  children:&lt;/span&gt; [
                                      Text(
                                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Remembers what user said earlier in the conversation&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                          fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                          fontWeight:&lt;/span&gt; FontWeight.bold),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                      ),
                                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                      ),
                                      Text(
                                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Hello everyone, back again at sahretech. On this occasion, we will learn&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                      ),
                                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                      ),
                                      Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      children:&lt;/span&gt; [
                                          Icon(
                                            Icons.bookmark_outline,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                          size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;,
                                          ),
                                          Icon(
                                            Icons.share_outlined,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                          size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;,
                                          ),
                                        ],
                                      )
                                    ],
                                  ),
                                ),
                                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                                ),
                                Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      color:&lt;/span&gt; Colors.grey,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        image:&lt;/span&gt; NetworkImage(
                                              &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2023/04/02/23/08/ai-generated-7895586_1280.jpg&#39;&lt;/span&gt;),
                                        ))),
                              ],
                            ),
                          ),
                        ),
                      );
                    },
                  )
                ],
              ),
            ),
          ),
        ],
      ));
    }
  }&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  2. Display when the script is run in the emulator. We use several widgets such
  as stack, transform, container, button, card, column, row, listview
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;table
  align=&quot;center&quot;
  cellpadding=&quot;0&quot;
  cellspacing=&quot;0&quot;
  class=&quot;tr-caption-container&quot;
  style=&quot;margin-left: auto; margin-right: auto;&quot;
&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a
          href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ89kpJg1butMxg0ar8cpLcSLjD5HbuXvDsXht7qhUsC6MhbXb0aXJMbCfjqzESdrgki4hj_70pHL9RMN90iOoMypxLbeiKwOXgiK-OMphCZ9-U2liDQQWDxxrRNZ_VZ25xvdZ8DUlpR_--bSz-NdrdWwyf9dskOqIhuPGiKK-WwjQvVG0xiO1P_avWxkw/s700/Screenshot_2023-06-24-19-05-32-66_56c0e93a6ac631b59f275df9eaff2ece.jpg&quot;
          style=&quot;margin-left: auto; margin-right: auto;&quot;
          &gt;&lt;img
            alt=&quot;Flutter Profile Page&quot;
            border=&quot;0&quot;
            data-original-height=&quot;700&quot;
            data-original-width=&quot;315&quot;
            src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ89kpJg1butMxg0ar8cpLcSLjD5HbuXvDsXht7qhUsC6MhbXb0aXJMbCfjqzESdrgki4hj_70pHL9RMN90iOoMypxLbeiKwOXgiK-OMphCZ9-U2liDQQWDxxrRNZ_VZ25xvdZ8DUlpR_--bSz-NdrdWwyf9dskOqIhuPGiKK-WwjQvVG0xiO1P_avWxkw/s16000/Screenshot_2023-06-24-19-05-32-66_56c0e93a6ac631b59f275df9eaff2ece.jpg&quot;
            title=&quot;Flutter Profile Page&quot;
        /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Profile Page&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. Flutter&#39;s Cool Vertical and Horizontal ListView Views &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/flutters-cool-vertical-and-horizontal.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2.Cool Grid View Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-grid-view-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. Beautiful Chat Design Display Flutter Starter Template &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/beautiful-chat-design-display-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. Cool List Page Display in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/cool-list-page-display-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/cool-profile-page-display-in-flutter.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4G1rBzsNYwbn0iswSxdn3tfMYYAlXoYNNYUh9mYeqd6iMF6pW2euH32h5-mpqy3rxcrO7YeNXSnHF7bnuukFsYSojR-y4Ue7wOwssWQKooCIkFCnXPOIftk_zUnVrqvHtXNENwiIF82fMYrf8JRwWA6GiVMI_CqCfzmcwNRv99PllIiL17SgHdLzwxL0/s72-c/Cool%20Profile%20Page%20Display%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-5875108776467960581</guid><pubDate>Tue, 26 Dec 2023 00:01:00 +0000</pubDate><atom:updated>2023-12-25T16:01:24.603-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Flutter&#39;s Cool Vertical and Horizontal ListView Views</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPVz28h1Z57lWKjJnJQTdGrotqjdK32KPJF7zRmQUHno86l2EuL8EdszH2DN9hg4DDORfbEXrZA64ql1pKjRch3y2hjNpRqHZBeEHV2jGzFw0wKP8xW_nSUGRgbcbUHa-Vx_cMSMp67CD1LYt8lPFrKvV81flckIvn-veK0Okm_6LQCZETnDVIHYFogA/s1500/Flutter&#39;s%20Cool%20Vertical%20and%20Horizontal%20ListView%20Views.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter&#39;s Cool Vertical and Horizontal ListView Views&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPVz28h1Z57lWKjJnJQTdGrotqjdK32KPJF7zRmQUHno86l2EuL8EdszH2DN9hg4DDORfbEXrZA64ql1pKjRch3y2hjNpRqHZBeEHV2jGzFw0wKP8xW_nSUGRgbcbUHa-Vx_cMSMp67CD1LYt8lPFrKvV81flckIvn-veK0Okm_6LQCZETnDVIHYFogA/s16000/Flutter&#39;s%20Cool%20Vertical%20and%20Horizontal%20ListView%20Views.png&quot; title=&quot;Flutter&#39;s Cool Vertical and Horizontal ListView Views&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Cool Vertical and Horizontal List View Page Views in Flutter. Page View with
  Card and Container List View in Flutter, Horizontal List View in Flutter.
  Create a Cool and Beautiful Horizontal List Display in Flutter. Example of
  Horizontal List News Flutter Display. Creating Card and Horizontal List Views
  in Flutter. Fluttering UI Card. Creating Views Quickly and Easily in Flutter.
  Script to Create a Horizontal List in Flutter Quickly. Combining Vertical List
  View and Horizontal List View, Creating a Professional Android Appearance,
  Flutter Template Design. Flutter List View Simple Design, Fresh &amp;amp; Modern
  Flutter Login Design, Flutter News Grid Design, Grid Page View View Flutter
  Product List
&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;
  &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  1. Create a new flutter project with the name you want. Then open
  lib/main.dart and replace it with the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;

  void main() =&amp;gt; runApp(ListViewApp());
  
  class ListViewApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
  &lt;span class=&quot;hljs-attr&quot;&gt;      debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;List View App&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      theme:&lt;/span&gt; ThemeData(primarySwatch: Colors.blue),
  &lt;span class=&quot;hljs-attr&quot;&gt;      home:&lt;/span&gt; ListViewPage(),
      );
    }
  }
  
  class ListViewPage extends StatefulWidget {
    @override
    _ListViewPageState createState() =&amp;gt; _ListViewPageState();
  }
  
  class _ListViewPageState extends State&amp;lt;ListViewPage&amp;gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  &lt;span class=&quot;hljs-attr&quot;&gt;      body:&lt;/span&gt; Stack(
  &lt;span class=&quot;hljs-attr&quot;&gt;        children:&lt;/span&gt; [
            Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;            width:&lt;/span&gt; double.infinity,
  &lt;span class=&quot;hljs-attr&quot;&gt;            height:&lt;/span&gt; MediaQuery.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;            color:&lt;/span&gt; Colors.grey[&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;400&lt;/span&gt;],
            ),
            ListView(
  &lt;span class=&quot;hljs-attr&quot;&gt;            padding:&lt;/span&gt; EdgeInsets.zero,
  &lt;span class=&quot;hljs-attr&quot;&gt;            children:&lt;/span&gt; [
                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                padding:&lt;/span&gt; EdgeInsets.fromLTRB(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.spaceBetween,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      children:&lt;/span&gt; [
                          Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39; SahreApp&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;24&lt;/span&gt;, fontWeight: FontWeight.w500),
                          ),
                        ],
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        children:&lt;/span&gt; [
                            Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              alignment:&lt;/span&gt; Alignment.center,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                color:&lt;/span&gt; Colors.white,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; TextFormField(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                textAlign:&lt;/span&gt; TextAlign.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                textAlignVertical:&lt;/span&gt; TextAlignVertical.top,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                decoration:&lt;/span&gt; InputDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  hintText:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39; Type to search .....&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  hintStyle:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  border:&lt;/span&gt; InputBorder.none,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  contentPadding:&lt;/span&gt; EdgeInsets.symmetric(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    vertical:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    horizontal:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                                    ),
                                  ),
                                ),
                              ),
                            ),
                            SizedBox(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
                            Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            height:&lt;/span&gt;
                                  &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                            child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              onPressed:&lt;/span&gt; () {
                                  // Implement your button action here
                                },
  &lt;span class=&quot;hljs-attr&quot;&gt;                              style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                                  ),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; Icon(Icons.search),
                              ),
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;37&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; ListView(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  scrollDirection:&lt;/span&gt; Axis.horizontal,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Container(
                          // width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          onPressed:&lt;/span&gt; () {
                              // Implement your button action here
                            },
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
                            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Text(
                              &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;All News&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
                            ),
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        onPressed:&lt;/span&gt; () {
                            // Implement your button action here
                          },
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                            ),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Tecnology&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        onPressed:&lt;/span&gt; () {
                            // Implement your button action here
                          },
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                            ),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Travel&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        onPressed:&lt;/span&gt; () {
                            // Implement your button action here
                          },
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                            ),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Financial&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
                          ),
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        onPressed:&lt;/span&gt; () {
                            // Implement your button action here
                          },
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                            ),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Text(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Sport&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;170&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; ListView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  scrollDirection:&lt;/span&gt; Axis.horizontal,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemBuilder:&lt;/span&gt; (_, int index) {
                      return Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; index == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;
                            ? EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;)
                            : EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Card(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          borderRadius:&lt;/span&gt; BorderRadius.circular(
                                &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;), // Adjust the border radius as needed
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          children:&lt;/span&gt; [
                              Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                borderRadius:&lt;/span&gt; BorderRadius.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    topLeft:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    topRight:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;)),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  image:&lt;/span&gt; NetworkImage(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2022/09/10/23/28/city-7445873_1280.jpg&#39;&lt;/span&gt;, // Ganti dengan URL gambar Anda
                                    ),
                                  ),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              width:&lt;/span&gt; MediaQuery.of(context).size.width,
                              ),
                              Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Text(
                                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Creating a Login in Flutter using Restful Api and Token&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    fontWeight:&lt;/span&gt; FontWeight.bold,
                                    ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      );
                    },
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                ),
                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Popular Posts&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.w500),
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                ),
                Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                children:&lt;/span&gt; [
                    Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;See More&#39;&lt;/span&gt;),
                    ),
                    Icon(
                      Icons.arrow_right_alt_outlined,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;,
                    )
                  ],
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;170&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; ListView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  scrollDirection:&lt;/span&gt; Axis.horizontal,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  itemBuilder:&lt;/span&gt; (_, int index) {
                      return Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; index == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;
                            ? EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;)
                            : EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Card(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          borderRadius:&lt;/span&gt; BorderRadius.circular(
                                &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;), // Adjust the border radius as needed
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          children:&lt;/span&gt; [
                              Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                borderRadius:&lt;/span&gt; BorderRadius.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    topLeft:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    topRight:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;)),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  image:&lt;/span&gt; NetworkImage(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2020/01/13/12/06/illustration-4762247_1280.jpg&#39;&lt;/span&gt;, // Ganti dengan URL gambar Anda
                                    ),
                                  ),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              width:&lt;/span&gt; MediaQuery.of(context).size.width,
                              ),
                              Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Text(
                                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Explain quantum computing in simple terms&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    fontWeight:&lt;/span&gt; FontWeight.bold,
                                    ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      );
                    },
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                ),
                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Text(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Recent Posts&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, fontWeight: FontWeight.w500),
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                ),
                Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                children:&lt;/span&gt; [
                    Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;See More&#39;&lt;/span&gt;),
                    ),
                    Icon(
                      Icons.arrow_right_alt_outlined,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;,
                    )
                  ],
                ),
                ListView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                padding:&lt;/span&gt; EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                shrinkWrap:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                physics:&lt;/span&gt; NeverScrollableScrollPhysics(),
  &lt;span class=&quot;hljs-attr&quot;&gt;                itemBuilder:&lt;/span&gt; (_, item) {
                    return Card(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                      ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          children:&lt;/span&gt; [
                              Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                children:&lt;/span&gt; [
                                    Text(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Remembers what user said earlier in the conversation&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        fontWeight:&lt;/span&gt; FontWeight.bold),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                    ),
                                    SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                    ),
                                    Text(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Hello everyone, back again at sahretech. On this occasion, we will learn&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                    ),
                                    SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                    ),
                                    Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    children:&lt;/span&gt; [
                                        Icon(
                                          Icons.bookmark_outline,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;,
                                        ),
                                        Icon(
                                          Icons.share_outlined,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                        size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;,
                                        ),
                                      ],
                                    )
                                  ],
                                ),
                              ),
                              SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                              ),
                              Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    color:&lt;/span&gt; Colors.grey,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      image:&lt;/span&gt; NetworkImage(
                                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2023/04/02/23/08/ai-generated-7895586_1280.jpg&#39;&lt;/span&gt;),
                                      ))),
                            ],
                          ),
                        ),
                      ),
                    );
                  },
                ),
              ],
            ),
          ],
        ),
      );
    }
  }&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  2. Display when the script above is executed. We use several widgets such as
  textformfield, button, text, horizontal listview, vertical listview, card,
  stack.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSgQsjJXovaEKl9kvNs2Mn9yDFPGWDrH6zDbJjg08uquDVz9PnGirFDQ33t2cywDeErl0hOD3gYbDQbR1CMCcDmNKbXaSZzG9m7_kzH2PQxuqKPmmF36CR6YiPL1WM03w1FHhojKFABMY4reYoFmAzwCPFpHTP0fW9hn3j9-fPe63ssNGmL-q2zHbB_xKy/s700/Screenshot_2023-06-24-13-01-08-25_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tampilan List Horizontal dan List Vertical Sahretech&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSgQsjJXovaEKl9kvNs2Mn9yDFPGWDrH6zDbJjg08uquDVz9PnGirFDQ33t2cywDeErl0hOD3gYbDQbR1CMCcDmNKbXaSZzG9m7_kzH2PQxuqKPmmF36CR6YiPL1WM03w1FHhojKFABMY4reYoFmAzwCPFpHTP0fW9hn3j9-fPe63ssNGmL-q2zHbB_xKy/s16000/Screenshot_2023-06-24-13-01-08-25_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; title=&quot;Tampilan List Horizontal dan List Vertical Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
        Tampilan List Horizontal dan List Vertical
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
</description><link>https://porkaone.blogspot.com/2023/12/flutters-cool-vertical-and-horizontal.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPVz28h1Z57lWKjJnJQTdGrotqjdK32KPJF7zRmQUHno86l2EuL8EdszH2DN9hg4DDORfbEXrZA64ql1pKjRch3y2hjNpRqHZBeEHV2jGzFw0wKP8xW_nSUGRgbcbUHa-Vx_cMSMp67CD1LYt8lPFrKvV81flckIvn-veK0Okm_6LQCZETnDVIHYFogA/s72-c/Flutter&#39;s%20Cool%20Vertical%20and%20Horizontal%20ListView%20Views.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-3616642676649790014</guid><pubDate>Mon, 25 Dec 2023 14:28:00 +0000</pubDate><atom:updated>2023-12-25T06:28:30.698-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Cool Grid View Page Display in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghiVsAsSUHjeq_FB1god5hyphenhyphenN5JafOta_GFqsvcUd7l7B0cMR2gQpVU_LBC_Aj1CqcXX2P2-NxXRC7kBVuopvemmgsbKVfcDGsND47bgn1NolsnPqbl21fFSgm_oMeuB2U-4Hm8-zIoFVAwzDcXgTR37c1cBtExVTuNCv5GUhwPeqZz27hYq3Gl14GTl94/s1500/Cool%20Grid%20View%20Page%20Display%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cool Grid View Page Display in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghiVsAsSUHjeq_FB1god5hyphenhyphenN5JafOta_GFqsvcUd7l7B0cMR2gQpVU_LBC_Aj1CqcXX2P2-NxXRC7kBVuopvemmgsbKVfcDGsND47bgn1NolsnPqbl21fFSgm_oMeuB2U-4Hm8-zIoFVAwzDcXgTR37c1cBtExVTuNCv5GUhwPeqZz27hYq3Gl14GTl94/s16000/Cool%20Grid%20View%20Page%20Display%20in%20Flutter.png&quot; title=&quot;Cool Grid View Page Display in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Cool Grid View Page Display in Flutter. Page View with Card and Grid View in
  Flutter, Grid View News View in Flutter. Create a Cool and Beautiful Grid
  Display in Flutter. Example of Grid View Flutter Display. Creating a Grid Card
  View in Flutter. Flutter UI Card. Creating Views Quickly and Easily in
  Flutter. Script to Create Grids in Flutter Quickly. Flutter Template Design.
  Flutter List View Simple Design, Flutter Login Design Fresh &amp;amp; Modern
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  1. Create a new flutter project with the name you want. Then open
  lib/main.dart then replace it with the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;

  void main() =&amp;gt; runApp(GridViewApp());
  
  class GridViewApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
  &lt;span class=&quot;hljs-attr&quot;&gt;      debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Grid View App&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;      theme:&lt;/span&gt; ThemeData(primarySwatch: Colors.blue),
  &lt;span class=&quot;hljs-attr&quot;&gt;      home:&lt;/span&gt; GridViewPage(),
      );
    }
  }
  
  class GridViewPage extends StatefulWidget {
    @override
    _GridViewPageState createState() =&amp;gt; _GridViewPageState();
  }
  
  class _GridViewPageState extends State&amp;lt;GridViewPage&amp;gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  &lt;span class=&quot;hljs-attr&quot;&gt;      body:&lt;/span&gt; Stack(
  &lt;span class=&quot;hljs-attr&quot;&gt;        children:&lt;/span&gt; [
            Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;            width:&lt;/span&gt; double.infinity,
  &lt;span class=&quot;hljs-attr&quot;&gt;            height:&lt;/span&gt; MediaQuery.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;            decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;              image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                image:&lt;/span&gt; NetworkImage(
                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2022/01/11/17/04/city-6931092_1280.jpg&#39;&lt;/span&gt;), // Ganti dengan URL gambar Anda
  &lt;span class=&quot;hljs-attr&quot;&gt;                fit:&lt;/span&gt; BoxFit.cover,
                ),
              ),
            ),
            ListView(
  &lt;span class=&quot;hljs-attr&quot;&gt;            padding:&lt;/span&gt; EdgeInsets.zero,
  &lt;span class=&quot;hljs-attr&quot;&gt;            children:&lt;/span&gt; [
                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                padding:&lt;/span&gt; EdgeInsets.fromLTRB(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                  children:&lt;/span&gt; [
                      Text(
                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;SahreApp&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;26&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        fontWeight:&lt;/span&gt; FontWeight.bold,
                        ),
                      ),
                      SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                      ),
                      Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;, // Set the Container height according to your needs
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        children:&lt;/span&gt; [
                            Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              alignment:&lt;/span&gt; Alignment.center,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                color:&lt;/span&gt; Colors.white,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; TextFormField(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                textAlign:&lt;/span&gt; TextAlign.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                textAlignVertical:&lt;/span&gt; TextAlignVertical.top,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                decoration:&lt;/span&gt; InputDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  hintText:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Type to search .....&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  hintStyle:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  border:&lt;/span&gt; InputBorder.none,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  contentPadding:&lt;/span&gt; EdgeInsets.symmetric(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    vertical:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    horizontal:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                                    ),
                                  ),
                                ),
                              ),
                            ),
                            SizedBox(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                            Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            height:&lt;/span&gt;
                                  &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;, // Set the Container height according to your needs
  &lt;span class=&quot;hljs-attr&quot;&gt;                            decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              color:&lt;/span&gt; Colors.blue,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                              ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                            child:&lt;/span&gt; ElevatedButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              onPressed:&lt;/span&gt; () {
                                  // Implement your button action here
                                },
  &lt;span class=&quot;hljs-attr&quot;&gt;                              style:&lt;/span&gt; ElevatedButton.styleFrom(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                primary:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                shadowColor:&lt;/span&gt; Colors.transparent,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;),
                                  ),
                                ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                              child:&lt;/span&gt; Icon(Icons.search),
                              ),
                            ),
                          ],
                        ),
                      ),
                      SizedBox(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                      GridView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; EdgeInsets.zero,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      shrinkWrap:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      physics:&lt;/span&gt; NeverScrollableScrollPhysics(),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                      gridDelegate:&lt;/span&gt; SliverGridDelegateWithFixedCrossAxisCount(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        crossAxisCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        crossAxisSpacing:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        mainAxisSpacing:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        childAspectRatio:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.62&lt;/span&gt;,
                        ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      itemBuilder:&lt;/span&gt; (context, index) {
                          return Card(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          shape:&lt;/span&gt; RoundedRectangleBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                          child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                            mainAxisAlignment:&lt;/span&gt; MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            children:&lt;/span&gt; [
                                Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  borderRadius:&lt;/span&gt; BorderRadius.only(topLeft: Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;), topRight: Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;)),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  image:&lt;/span&gt; DecorationImage(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    fit:&lt;/span&gt; BoxFit.cover,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    image:&lt;/span&gt; NetworkImage(
                                        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2022/09/10/23/28/city-7445873_1280.jpg&#39;&lt;/span&gt;, // Ganti dengan URL gambar Anda
                                      ),
                                    ),
                                  ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                width:&lt;/span&gt; MediaQuery.of(context).size.width,
                                  
                                ),
                                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                padding:&lt;/span&gt; const EdgeInsets.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    top:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  child:&lt;/span&gt; Text(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Creating a Login in Flutter using Restful Api and Token&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      fontWeight:&lt;/span&gt; FontWeight.bold,
                                      ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                    ),
                                  ),
                                ),
                                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                padding:&lt;/span&gt; const EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  child:&lt;/span&gt; Text(
                                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Hello everyone, back again at sahretech. On this occasion, we will learn how to create a login and process it in Flutter with&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    maxLines:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                    overflow:&lt;/span&gt; TextOverflow.ellipsis,
                                    ),
                                  ),
                                ),
                                Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                padding:&lt;/span&gt; const EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                                child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                                  children:&lt;/span&gt; [
                                      Icon(
                                        Icons.bookmark_outline,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                                      ),
                                      Icon(
                                        Icons.share_outlined,
  &lt;span class=&quot;hljs-attr&quot;&gt;                                      size:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                                      ),
                                    ],
                                  ),
                                ),
                              ],
                            ),
                          );
                        },
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ],
        ),
      );
    }
  }&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  2. The appearance of the application when running, here we use several flutter
  widgets such as text, textformfield, button, icon, listview, card, container,
  and grid view.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEQxYIn7cA73tHhS7-Bp8nfC1z64J2LVqkSZhMpqW5BK1iNRbghMU_CuHO5aKpu17SEEffN-VczUVsNkoK_vflk6-fOU9D3EmJxLY3C5CJ0oRGdoZwdZD2BnA6da6YXh9oFgwjdSMjBurHjbZdA18J4NST67YNZowlmU_nmUOoFLU8Y3Zoi8kfScuuAavG/s700/Screenshot_2023-06-24-08-01-54-71_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sahretech Flutter Grid View&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEQxYIn7cA73tHhS7-Bp8nfC1z64J2LVqkSZhMpqW5BK1iNRbghMU_CuHO5aKpu17SEEffN-VczUVsNkoK_vflk6-fOU9D3EmJxLY3C5CJ0oRGdoZwdZD2BnA6da6YXh9oFgwjdSMjBurHjbZdA18J4NST67YNZowlmU_nmUOoFLU8Y3Zoi8kfScuuAavG/s16000/Screenshot_2023-06-24-08-01-54-71_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; title=&quot;Sahretech Flutter Grid View&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Flutter Grid View&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/cool-grid-view-page-display-in-flutter.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghiVsAsSUHjeq_FB1god5hyphenhyphenN5JafOta_GFqsvcUd7l7B0cMR2gQpVU_LBC_Aj1CqcXX2P2-NxXRC7kBVuopvemmgsbKVfcDGsND47bgn1NolsnPqbl21fFSgm_oMeuB2U-4Hm8-zIoFVAwzDcXgTR37c1cBtExVTuNCv5GUhwPeqZz27hYq3Gl14GTl94/s72-c/Cool%20Grid%20View%20Page%20Display%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-5980965664380245379</guid><pubDate>Mon, 25 Dec 2023 09:14:00 +0000</pubDate><atom:updated>2023-12-25T01:14:58.592-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Beautiful Chat Design Display Flutter Starter Template</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOvAuLTX0b0E8FHELd0-yIgxucrPpU41WsPzkFcranAzW_GoEsnMDlVQTBzerJ2MhrM0K84o2WQg8gt-K6RHtyTxY5VdszmR3dRVMzs7jkusVQQLgg7rnJuCI47PyLKpEy4CR9nXM0mAGvYO3y2HsSPodcnmVG3mQdK-aD-lLjECBV8q19chZSDJh2XkY/s1500/Beautiful%20Chat%20Design%20Display%20Flutter%20Starter%20Template.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Beautiful Chat Design Display Flutter Starter Template&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOvAuLTX0b0E8FHELd0-yIgxucrPpU41WsPzkFcranAzW_GoEsnMDlVQTBzerJ2MhrM0K84o2WQg8gt-K6RHtyTxY5VdszmR3dRVMzs7jkusVQQLgg7rnJuCI47PyLKpEy4CR9nXM0mAGvYO3y2HsSPodcnmVG3mQdK-aD-lLjECBV8q19chZSDJh2XkY/s16000/Beautiful%20Chat%20Design%20Display%20Flutter%20Starter%20Template.png&quot; title=&quot;Beautiful Chat Design Display Flutter Starter Template&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Flutter UI Chat View. Flutter Chat UI. Professional Mobile Chat UI. Responsive
  Mobile Chat UI. Chat UI for Flutter. Android Mobile Chat. Simple and Elegant
  Mobile Chat UI. Flutter Starter Template. Flutter List View Simple Design,
  Flutter Login Design Fresh &amp;amp; Modern, Flutter News Grid Design, Flutter
  Product List Grid View Page View, Flutter Vertical and Horizontal Scoll
  Design, Flutter Profile View
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  1. Create a new flutter project then copy the script below in lib/main.dart
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;

  void main() {
    runApp(MaterialApp(
  &lt;span class=&quot;hljs-attr&quot;&gt;    debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;    title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Chat UI&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;    home:&lt;/span&gt; ChatScreen(),
    ));
  }
  
  class ChatScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  &lt;span class=&quot;hljs-attr&quot;&gt;      appBar:&lt;/span&gt; AppBar(
  &lt;span class=&quot;hljs-attr&quot;&gt;          titleSpacing:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;          leading:&lt;/span&gt; Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;            padding:&lt;/span&gt; const EdgeInsets.only(top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;            child:&lt;/span&gt; Material(
  &lt;span class=&quot;hljs-attr&quot;&gt;              shape:&lt;/span&gt; CircleBorder(),
  &lt;span class=&quot;hljs-attr&quot;&gt;              child:&lt;/span&gt; CircleAvatar(
  &lt;span class=&quot;hljs-attr&quot;&gt;                radius:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                backgroundImage:&lt;/span&gt; NetworkImage(
                    &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;&lt;/span&gt;,
                  ),
                ),
              ),
            ),
  &lt;span class=&quot;hljs-attr&quot;&gt;          title:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;            crossAxisAlignment:&lt;/span&gt; CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;            children:&lt;/span&gt; [
                Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Mr. Jhon Due&#39;&lt;/span&gt;),
                Text(
                  &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;CEO of Porkaone&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                )
              ],
            )),
  &lt;span class=&quot;hljs-attr&quot;&gt;      body:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;        child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;          children:&lt;/span&gt; [
              Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;              child:&lt;/span&gt; ListView.builder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                itemCount:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                itemBuilder:&lt;/span&gt; (context, index) {
                    return ChatBubble(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    message:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Lorem ipusm sit dolor amet consectur&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    isMe:&lt;/span&gt; index % &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt; == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt; ? &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt; : &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
                    );
                  },
                ),
              ),
              Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;              padding:&lt;/span&gt; const EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;              child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                children:&lt;/span&gt; [
                    Expanded(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; TextField(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      style:&lt;/span&gt; const TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      decoration:&lt;/span&gt; InputDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        hintText:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Type Message...&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        border:&lt;/span&gt; OutlineInputBorder(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          borderRadius:&lt;/span&gt; BorderRadius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30.0&lt;/span&gt;),
                          ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                        contentPadding:&lt;/span&gt; const EdgeInsets.symmetric(
  &lt;span class=&quot;hljs-attr&quot;&gt;                          vertical:&lt;/span&gt;
                                &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                          horizontal:&lt;/span&gt;
                                &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;, 
                          ),
                        ),
                      ),
                    ),
                    const SizedBox(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10.0&lt;/span&gt;),
                    Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; FloatingActionButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      onPressed:&lt;/span&gt; () {},
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; Icon(Icons.send),
                      ),
                    ),
                    SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                    ),
                    Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    width:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45.0&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    child:&lt;/span&gt; FloatingActionButton(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        onPressed:&lt;/span&gt; () {},
  &lt;span class=&quot;hljs-attr&quot;&gt;                        child:&lt;/span&gt; Icon(Icons.camera_alt_outlined)),
                    )
                  ],
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  
  class ChatBubble extends StatelessWidget {
    final String message;
    final bool isMe;
  
    ChatBubble({required this.message, required this.isMe});
  
    @override
    Widget build(BuildContext context) {
      return Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;      padding:&lt;/span&gt; const EdgeInsets.symmetric(vertical: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;, horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;      child:&lt;/span&gt; Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;        mainAxisAlignment:&lt;/span&gt;
              isMe ? MainAxisAlignment.end : MainAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;        children:&lt;/span&gt; [
            Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;            crossAxisAlignment:&lt;/span&gt;
                  isMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;            children:&lt;/span&gt; [
                ConstrainedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                constraints:&lt;/span&gt; BoxConstraints(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  maxWidth:&lt;/span&gt; MediaQuery.of(context).size.width *
                        &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.5&lt;/span&gt;, // Maksimal setengah lebar layar
                  ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                child:&lt;/span&gt; Container(
  &lt;span class=&quot;hljs-attr&quot;&gt;                  padding:&lt;/span&gt; const EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12.0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  decoration:&lt;/span&gt; BoxDecoration(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    color:&lt;/span&gt; isMe ? Colors.blue : Colors.grey[&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;300&lt;/span&gt;],
  &lt;span class=&quot;hljs-attr&quot;&gt;                    borderRadius:&lt;/span&gt; BorderRadius.only(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      topLeft:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      topRight:&lt;/span&gt; Radius.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      bottomLeft:&lt;/span&gt; Radius.circular(isMe ? &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt; : &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      bottomRight:&lt;/span&gt; Radius.circular(isMe ? &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt; : &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
                      ),
                    ),
  &lt;span class=&quot;hljs-attr&quot;&gt;                  child:&lt;/span&gt; Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    crossAxisAlignment:&lt;/span&gt; isMe
                          ? CrossAxisAlignment.end
                          : CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    children:&lt;/span&gt; [
                        Wrap(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        alignment:&lt;/span&gt; WrapAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        children:&lt;/span&gt; [
                            Text(
                              message,
  &lt;span class=&quot;hljs-attr&quot;&gt;                            style:&lt;/span&gt; TextStyle(
  &lt;span class=&quot;hljs-attr&quot;&gt;                              color:&lt;/span&gt; isMe ? Colors.white : Colors.black,
  &lt;span class=&quot;hljs-attr&quot;&gt;                              fontSize:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;,
                              ),
                            ),
                          ],
                        ),
                      ],
                    ),
                  ),
                ),
                SizedBox(
  &lt;span class=&quot;hljs-attr&quot;&gt;                height:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                ),
                Row(
  &lt;span class=&quot;hljs-attr&quot;&gt;                children:&lt;/span&gt; [
                    if (!isMe)
                      Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; const EdgeInsets.only(right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; CircleAvatar(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        radius:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10.0&lt;/span&gt;, // Mengatur ukuran lingkaran avatar
  &lt;span class=&quot;hljs-attr&quot;&gt;                        backgroundImage:&lt;/span&gt; NetworkImage(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;&lt;/span&gt;,
                          ),
                        ),
                      ),
                    Column(
  &lt;span class=&quot;hljs-attr&quot;&gt;                    crossAxisAlignment:&lt;/span&gt; isMe
                          ? CrossAxisAlignment.end
                          : CrossAxisAlignment.start,
  &lt;span class=&quot;hljs-attr&quot;&gt;                    children:&lt;/span&gt; [
                        Text(
                          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Monday 20 Mei 2023 15:31&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt; TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;9&lt;/span&gt;),
                        ),
                        Text(
                          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Nabil Putra&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;                        style:&lt;/span&gt;
                              TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;9&lt;/span&gt;, fontWeight: FontWeight.w500),
                        ),
                      ],
                    ),
                    if (isMe)
                      Padding(
  &lt;span class=&quot;hljs-attr&quot;&gt;                      padding:&lt;/span&gt; const EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;),
  &lt;span class=&quot;hljs-attr&quot;&gt;                      child:&lt;/span&gt; CircleAvatar(
  &lt;span class=&quot;hljs-attr&quot;&gt;                        radius:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10.0&lt;/span&gt;, // Mengatur ukuran lingkaran avatar
  &lt;span class=&quot;hljs-attr&quot;&gt;                        backgroundImage:&lt;/span&gt; NetworkImage(
                            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;&lt;/span&gt;,
                          ),
                        ),
                      ),
                  ],
                ),
              ],
            ),
          ],
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;div&gt;&lt;b&gt;Explanation of the script above:&lt;/b&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ol style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        Import Flutter Packages: In this line of code, we import the necessary
        packages or libraries from Flutter to build the user interface (UI) of
        the application.
      &lt;/li&gt;
      &lt;li&gt;
        main() function: This is the main function that will be executed when
        the application starts. In it, we use runApp() to run the application.
        MaterialApp is used as the main widget that provides the basic framework
        of the Flutter application. The properties set in MaterialApp are:
        debugShowCheckedModeBanner: Used to show or hide the &quot;Debug&quot; label in
        the top right corner of the application.
      &lt;/li&gt;
      &lt;li&gt;title: Used to provide the title of the application.&lt;/li&gt;
      &lt;li&gt;
        home: Directs to the ChatScreen() widget as the main page of the
        application.
      &lt;/li&gt;
      &lt;li&gt;
        ChatScreen Class: This is a class that implements the StatelessWidget
        widget. In it, we define the user interface using the Scaffold widget.
        Scaffold is the basic component used to organize the application layout.
        The properties set in Scaffold are: appBar: Sets the top bar of the
        application. Inside, there is an AppBar widget with a title, avatar
        image and user information.
      &lt;/li&gt;
      &lt;li&gt;
        body: Sets the main content of the application. In it, there is a
        Container widget which contains a Column to display the ChatBubble list.
      &lt;/li&gt;
      &lt;li&gt;
        Class ChatBubble: This is a class that implements the StatelessWidget
        widget. In it, we define the appearance of the chat balloon using the
        Row widget. The chat balloon display consists of several elements, such
        as message text, time, and sender&#39;s avatar.
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/div&gt;
  &lt;div&gt;
    Overall, this script builds a user interface (UI) for a simple chat
    application. This includes a chat list view and the ability for users to
    send new messages via text input and the send button.
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;div&gt;
    2. Display when the script is run in the emulator. Simple but looks
    luxurious and professional. We use several widgets such as app bar, network
    image, text, container, textformfield, row, column and others.
  &lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1TjtJA2fBMH4H9okRXNyDfbPriWhB5u70VKRhdpdB5GXthLO8BdXbAsN-XVr2EUSMqS82rwkf3EdCqmqhx3V54lUmzJbVd2JLKHTWQcXDMCtGdy4B9IZzoMTUsqtpfYT1ggWMDuMe99RTMYCXfcor550CUEMzVP5xHFwHuZQ6jBnScePGXW6svjBmw-ld/s700/Screenshot_2023-06-28-10-50-26-94_06389150be7b4136b933f89e60be31fc.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Flutter Chat UI Sahretech&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1TjtJA2fBMH4H9okRXNyDfbPriWhB5u70VKRhdpdB5GXthLO8BdXbAsN-XVr2EUSMqS82rwkf3EdCqmqhx3V54lUmzJbVd2JLKHTWQcXDMCtGdy4B9IZzoMTUsqtpfYT1ggWMDuMe99RTMYCXfcor550CUEMzVP5xHFwHuZQ6jBnScePGXW6svjBmw-ld/s16000/Screenshot_2023-06-28-10-50-26-94_06389150be7b4136b933f89e60be31fc.jpg&quot; title=&quot;Flutter Chat UI Sahretech&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Flutter Chat UI&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;br /&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;div&gt;
    &lt;p&gt;&lt;/p&gt;

  &lt;/div&gt;
  &lt;div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/beautiful-chat-design-display-flutter.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOvAuLTX0b0E8FHELd0-yIgxucrPpU41WsPzkFcranAzW_GoEsnMDlVQTBzerJ2MhrM0K84o2WQg8gt-K6RHtyTxY5VdszmR3dRVMzs7jkusVQQLgg7rnJuCI47PyLKpEy4CR9nXM0mAGvYO3y2HsSPodcnmVG3mQdK-aD-lLjECBV8q19chZSDJh2XkY/s72-c/Beautiful%20Chat%20Design%20Display%20Flutter%20Starter%20Template.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-7842900854674599954</guid><pubDate>Mon, 25 Dec 2023 08:21:00 +0000</pubDate><atom:updated>2023-12-25T00:22:23.937-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>How to Create a Currency Conversion App in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBtE6iX31rg2AgdoLkXWkebNAtyoNAx5Ghg4pgyZvZ8qYLPXyaAQFUhRj1CzgV1hy9-0M7eIXpZMwFqzboSF1zOpyM2kCCCnLZVvstF69N6q7WZ1yI5YQIY7ckL4lADUz3ARyejr1ESo95dbtuMXpsRxdQL8LNjuC1WsaBZpMLtKyXSLvwu7mi5g3wH9o/s1500/How%20to%20Create%20a%20Currency%20Conversion%20App%20in%20Flutter.png&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Create a Currency Conversion App in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBtE6iX31rg2AgdoLkXWkebNAtyoNAx5Ghg4pgyZvZ8qYLPXyaAQFUhRj1CzgV1hy9-0M7eIXpZMwFqzboSF1zOpyM2kCCCnLZVvstF69N6q7WZ1yI5YQIY7ckL4lADUz3ARyejr1ESo95dbtuMXpsRxdQL8LNjuC1WsaBZpMLtKyXSLvwu7mi5g3wH9o/s16000/How%20to%20Create%20a%20Currency%20Conversion%20App%20in%20Flutter.png&quot; title=&quot;How to Create a Currency Conversion App in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a currency conversion application in Flutter. How do you do it? Come
  on, follow the complete tutorial below.
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;
    We will create a currency conversion application using the api from the
    website
    &lt;a href=&quot;http://app.freecurrencyapi.com&quot; target=&quot;_blank&quot;&gt;app.freecurrencyapi.com&lt;/a&gt;. The application is quite simple, it only has one page display. input form
    for currency from, input form for currency to, and total money to be
    converted, then there is a button and the results will be displayed below
    the button. To see the final results, please scroll to the bottom of this
    page.
  &lt;/div&gt;
  &lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;
  &lt;h1 style=&quot;text-align: left;&quot;&gt;
    How to Create a Currency Conversion App in Flutter
  &lt;/h1&gt;
  &lt;div&gt;
    1. First, you have to register on the website
    &lt;a href=&quot;http://app.freecurrencyapi.com&quot; target=&quot;_blank&quot;&gt;app.freecurrencyapi.com&lt;/a&gt;
    to get the apikey. How to register is quite easy and simple, you can use
    Gmail for quick access.
  &lt;/div&gt;
  &lt;div&gt;
    &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;text-align: center;&quot;&gt;
            &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhHeBcRQzPVZvDjzyqPWKKBxFWY0m8DHp2l-e_Od6sWRDrHt7rO2UPtS1zTdtqtiR1iIRN7YuqWYQsCLzFn51yFQv_Sq6b4Gg0HvFvk2JWH3iZkE96Gm_U5uVvaxMgi-9R-ohn-n76DxR_fuGL9BROM6Jy5oZga6PRGGjg1jqS3s2yu4hsLYB0ripiCAUCW&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;website konversi - sahretech&quot; data-original-height=&quot;955&quot; data-original-width=&quot;1920&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhHeBcRQzPVZvDjzyqPWKKBxFWY0m8DHp2l-e_Od6sWRDrHt7rO2UPtS1zTdtqtiR1iIRN7YuqWYQsCLzFn51yFQv_Sq6b4Gg0HvFvk2JWH3iZkE96Gm_U5uVvaxMgi-9R-ohn-n76DxR_fuGL9BROM6Jy5oZga6PRGGjg1jqS3s2yu4hsLYB0ripiCAUCW=s16000&quot; title=&quot;website konversi - sahretech&quot; /&gt;&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;br /&gt;
  &lt;/div&gt;
  &lt;p style=&quot;text-align: left;&quot;&gt;
    2. Next, create a new flutter project with the name you want. Use flutter
    version 3+ or a version that supports null safety.
  &lt;/p&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;
    3. Next, open the pubspec.yaml file. Then add the http: and intl: ^0.18.1
    packages. The http package functions to make data requests to the server.
    Meanwhile, the intl package functions to format the date to make it easier
    to understand. See an example of adding a package in the image below.
  &lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;
    &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;text-align: center;&quot;&gt;
            &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhTryigIeDRl_2saKPSCRiRIdFKEjYOeVv-2V7EDm7SlSt0jCoYPMrdtYol2HXgb1TgzuipPGaUkCxgSYTj3GfFe2drmMpH1fi4N2wDeiyCmifHG-ZTNu_TQ80wFeP41KL3X8_OoChCquIIms1LRtNf9waPWR_Lm5CqWHNB4cqKWbBMNtwdlqbZed9muG0x&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Menambahkan Paket di Flutter - sahretech&quot; data-original-height=&quot;592&quot; data-original-width=&quot;1062&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhTryigIeDRl_2saKPSCRiRIdFKEjYOeVv-2V7EDm7SlSt0jCoYPMrdtYol2HXgb1TgzuipPGaUkCxgSYTj3GfFe2drmMpH1fi4N2wDeiyCmifHG-ZTNu_TQ80wFeP41KL3X8_OoChCquIIms1LRtNf9waPWR_Lm5CqWHNB4cqKWbBMNtwdlqbZed9muG0x=s16000&quot; title=&quot;Menambahkan Paket di Flutter - sahretech&quot; /&gt;&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;br /&gt;&lt;br /&gt;
  &lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;
    4. Open the main.dart file in the lib folder. Then change the script in it
    with the script below.
  &lt;/div&gt;
  &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:intl/intl.dart&#39;&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt; main() {
  runApp(
    MaterialApp(
      &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//menghilangkan debug di kanan atas&lt;/span&gt;
      debugShowCheckedModeBanner: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;false&lt;/span&gt;,
      home: MyApp(),
    ),
  );
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;const&lt;/span&gt; MyApp({&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.key});

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  State&amp;lt;MyApp&amp;gt; createState() =&amp;gt; _MyAppState();
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_MyAppState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;&amp;gt; &lt;/span&gt;{

  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//inisialisasi variabel&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; apiKey = &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;fca_live_xtFj0eIq32x9YL7pTsdsScDLNsWTfHOE0ppapTmE&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt; data;
  &lt;span class=&quot;hljs-built_in&quot;&gt;bool&lt;/span&gt; isLoading = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;false&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; hasilKonversi;

  TextEditingController fromController = TextEditingController();
  TextEditingController toController = TextEditingController();
  TextEditingController totalController = TextEditingController();

  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//this method for get data from the internet&lt;/span&gt;
  Future&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt;&amp;gt; convert(base_currency, currencies) &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {

    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//the destination endpoint&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//you must have api key&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(
      &lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(
        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://api.freecurrencyapi.com/v1/latest?apikey=&lt;span class=&quot;hljs-subst&quot;&gt;${apiKey}&lt;/span&gt;&#39;&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;base_currency=&lt;span class=&quot;hljs-subst&quot;&gt;${base_currency}&lt;/span&gt;&amp;amp;currencies=&lt;span class=&quot;hljs-subst&quot;&gt;${currencies}&lt;/span&gt;,&lt;span class=&quot;hljs-subst&quot;&gt;${base_currency}&lt;/span&gt;&#39;&lt;/span&gt;,
      ),
    );


    setState(() {
      data = json.decode(response.body);

      hasilKonversi = &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;.parse(totalController.text) * data[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;data&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&lt;span class=&quot;hljs-subst&quot;&gt;${currencies}&lt;/span&gt;&#39;&lt;/span&gt;] / data[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;data&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&lt;span class=&quot;hljs-subst&quot;&gt;${base_currency}&lt;/span&gt;&#39;&lt;/span&gt;];
      isLoading = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;false&lt;/span&gt;;
    });
  }

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  Widget build(BuildContext context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Scaffold(
      appBar: AppBar(
        title: Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Flutter Conversion&#39;&lt;/span&gt;),
      ),
      body: ListView(
        padding: EdgeInsets.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
        children: [
          Row(
            children: [
              Expanded(
                flex: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;, 
                child: Container(
                  height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;,
                  child: TextFormField(
                    controller: fromController,
                    decoration: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;const&lt;/span&gt; InputDecoration(
                      labelText: &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;From&#39;&lt;/span&gt;,
                    ),
                  ),
                ),
              ),
              SizedBox(
                width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
              ),
              Icon(Icons.repeat),
              SizedBox(
                width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
              ),
              Expanded(
                flex: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,
                child: Container(
                  height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;,
                  child: TextFormField(
                    controller: toController,
                    decoration: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;const&lt;/span&gt; InputDecoration(
                      labelText: &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;To&#39;&lt;/span&gt;,
                    ),
                  ),
                ),
              ),
            ],
          ),
          Container(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;,
            child: TextFormField(
              keyboardType: TextInputType.number,
              controller: totalController,
              decoration: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;const&lt;/span&gt; InputDecoration(
                labelText: &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Amount of money&#39;&lt;/span&gt;,
              ),
            ),
          ),
          ElevatedButton(
            onPressed: () {
              setState(() {
                isLoading = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;true&lt;/span&gt;; &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Activate the progress indicator&lt;/span&gt;
              });
              convert(fromController.text, toController.text);
            },
            child: isLoading
            ? CircularProgressIndicator(
                valueColor: AlwaysStoppedAnimation&amp;lt;Color&amp;gt;(
                  Colors.white, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Change color here&lt;/span&gt;
                ),
              ) &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Show indicator when isLoading is true&lt;/span&gt;
            : Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Convert&#39;&lt;/span&gt;),
          ),
          SizedBox(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
          ),
          Text(
            &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Hasil Konversi&#39;&lt;/span&gt;,
            style: TextStyle(
              fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
            ),
          ),
          SizedBox(
            height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
          ),
          data != &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;null&lt;/span&gt; ? Column(
         
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;1 &lt;span class=&quot;hljs-subst&quot;&gt;${fromController.text}&lt;/span&gt; = &lt;span class=&quot;hljs-subst&quot;&gt;${data[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;data&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&lt;span class=&quot;hljs-subst&quot;&gt;${toController.text}&lt;/span&gt;&#39;&lt;/span&gt;]}&lt;/span&gt; &lt;span class=&quot;hljs-subst&quot;&gt;${toController.text}&lt;/span&gt; \n&#39;&lt;/span&gt;
                &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&lt;span class=&quot;hljs-subst&quot;&gt;${totalController.text}&lt;/span&gt; &lt;span class=&quot;hljs-subst&quot;&gt;${fromController.text}&lt;/span&gt; = &lt;span class=&quot;hljs-subst&quot;&gt;${hasilKonversi}&lt;/span&gt; &lt;span class=&quot;hljs-subst&quot;&gt;${toController.text}&lt;/span&gt; \n&#39;&lt;/span&gt;,
                style: TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
              ),
              Text(
                &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Conversion Time \n&#39;&lt;/span&gt;
                &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&lt;span class=&quot;hljs-subst&quot;&gt;${DateFormat(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dd-MM-yyyy HH:mm:ss&#39;&lt;/span&gt;).format(DateTime.now())}&lt;/span&gt;&#39;&lt;/span&gt;,
                style: TextStyle(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
              ),
            ],
          ) : Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Belum Ada Data&#39;&lt;/span&gt;)
        ],
      ),
    );
  }
}&lt;/pre&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;
    5. We have carried out all the steps, please open the emulator and run the
    project. If successful, the display will look like the image below.
  &lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii4d8N7Nlu-Pb99G4Tm15ZZtQu-vFnh6kWBYwwptvsOPc-7vMaHk2Cu9CcxrO6nRT5zf9Wkah_eR8JRU-LdKTrV6dKkk0Bkflq5V9J714jiBG-zIop1rGhnH5i07UcTA8B7XdF-s3-1Ch3HnqYKLDY6VlpmBSq27zEoiCPUiEm31FeziCrL4Nu-7nLd32j/s500/Screenshot_1693648819.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii4d8N7Nlu-Pb99G4Tm15ZZtQu-vFnh6kWBYwwptvsOPc-7vMaHk2Cu9CcxrO6nRT5zf9Wkah_eR8JRU-LdKTrV6dKkk0Bkflq5V9J714jiBG-zIop1rGhnH5i07UcTA8B7XdF-s3-1Ch3HnqYKLDY6VlpmBSq27zEoiCPUiEm31FeziCrL4Nu-7nLd32j/s16000/Screenshot_1693648819.png&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy7DOTAL-F38_4K4CWBiZCDgQwae5cr0yGq9BGlwtyfHiTmg3v78pN2s31QLI5sTDI920fhGTyfoFZXnpRZst_V36LCGbYNTsetVN5WMez3dkiPIlBjuOTQBTklRLQFMJcaYiMJ186ca1kWyIaVou0dkXFqSuOPf7M9kGAojuPpLtQ8dOrp-42jv8uQSER/s500/Screenshot_1693661104.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy7DOTAL-F38_4K4CWBiZCDgQwae5cr0yGq9BGlwtyfHiTmg3v78pN2s31QLI5sTDI920fhGTyfoFZXnpRZst_V36LCGbYNTsetVN5WMez3dkiPIlBjuOTQBTklRLQFMJcaYiMJ186ca1kWyIaVou0dkXFqSuOPf7M9kGAojuPpLtQ8dOrp-42jv8uQSER/s16000/Screenshot_1693661104.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;
    You can see the list of available currencies here
    &lt;a href=&quot;https://freecurrencyapi.com/docs/currency-list&quot; target=&quot;_blank&quot;&gt;https://freecurrencyapi.com/docs/currency-list&lt;/a&gt;. You can also modify the input from form and input to form to become a
    dropdown select to make it easier to search for currencies.
  &lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;
    That&#39;s the tutorial on how to create a currency conversion application in
    Flutter. Hopefully this short tutorial is useful. Don&#39;t forget to comment
    and share, that&#39;s all and thank you.
  &lt;/div&gt;
  &lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/how-to-create-currency-conversion-app.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBtE6iX31rg2AgdoLkXWkebNAtyoNAx5Ghg4pgyZvZ8qYLPXyaAQFUhRj1CzgV1hy9-0M7eIXpZMwFqzboSF1zOpyM2kCCCnLZVvstF69N6q7WZ1yI5YQIY7ckL4lADUz3ARyejr1ESo95dbtuMXpsRxdQL8LNjuC1WsaBZpMLtKyXSLvwu7mi5g3wH9o/s72-c/How%20to%20Create%20a%20Currency%20Conversion%20App%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-7525050592250891640</guid><pubDate>Mon, 25 Dec 2023 00:32:00 +0000</pubDate><atom:updated>2023-12-24T16:32:51.745-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">web programming</category><title>Cool List Page Display in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7hJCQavJmSWaGBtvqWyWrhgbBY1w_QhcoGIXGtQlVRVhyyzTIZwJGfan1uj_wLijRDu-6d-kmlo9cYKc_WIm467bAIuPBx9qod20DIE6CyF8QpnPo9HFl2Sk4e8Vx3UgY4skChi8GXsDTyoFzX4lwBwrOEjkVfKk5iTgpX0r8gaPVqrlaqaizsL0oHFY/s1500/Cool%20List%20Page%20Display%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cool List Page Display in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7hJCQavJmSWaGBtvqWyWrhgbBY1w_QhcoGIXGtQlVRVhyyzTIZwJGfan1uj_wLijRDu-6d-kmlo9cYKc_WIm467bAIuPBx9qod20DIE6CyF8QpnPo9HFl2Sk4e8Vx3UgY4skChi8GXsDTyoFzX4lwBwrOEjkVfKk5iTgpX0r8gaPVqrlaqaizsL0oHFY/s16000/Cool%20List%20Page%20Display%20in%20Flutter.png&quot; title=&quot;Cool List Page Display in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Cool List Page Display in Flutter. Page View with Cards in Flutter, List View
  News View in Flutter. Create Cool and Beautiful List Displays in Flutter.
  Example of List View Flutter Display. Creating a List Card View in Flutter.
  Flutter UI Card. Creating Views Quickly and Easily in Flutter. Script to
  Create Lists in Flutter Quickly. Flutter Template Design. Flutter Login Design
  Fresh &amp;amp; Modern
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;br /&gt;&lt;br /&gt;import &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;
  
  void main() =&amp;gt; runApp(ListViewApp());
  
  class ListViewApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
&lt;span class=&quot;hljs-attr&quot;&gt;        debugShowCheckedModeBanner:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
&lt;span class=&quot;hljs-attr&quot;&gt;        title:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;List View App&#39;&lt;/span&gt;,
&lt;span class=&quot;hljs-attr&quot;&gt;        theme:&lt;/span&gt; ThemeData(primarySwatch: Colors.blue),
&lt;span class=&quot;hljs-attr&quot;&gt;        home:&lt;/span&gt; ListViewPage(),
      );
    }
  }
  
  class ListViewPage extends StatefulWidget {
    @override
    _ListViewPageState createState() =&amp;gt; _ListViewPageState();
  }
  
  class _ListViewPageState extends State&amp;lt;ListViewPage&amp;gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
&lt;span class=&quot;hljs-attr&quot;&gt;        body:&lt;/span&gt; Stack(
&lt;span class=&quot;hljs-attr&quot;&gt;          children:&lt;/span&gt; [
            Container(
&lt;span class=&quot;hljs-attr&quot;&gt;              width:&lt;/span&gt; double.infinity,
&lt;span class=&quot;hljs-attr&quot;&gt;              height:&lt;/span&gt; MediaQuery.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,
&lt;span class=&quot;hljs-attr&quot;&gt;              decoration:&lt;/span&gt; BoxDecoration(
&lt;span class=&quot;hljs-attr&quot;&gt;                image:&lt;/span&gt; DecorationImage(
&lt;span class=&quot;hljs-attr&quot;&gt;                  image:&lt;/span&gt; NetworkImage(
                      &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2022/01/11/17/04/city-6931092_1280.jpg&#39;&lt;/span&gt;), // Ganti dengan URL gambar Anda
&lt;span class=&quot;hljs-attr&quot;&gt;                  fit:&lt;/span&gt; BoxFit.cover,
                ),
              ),
            ),
            ListView(
&lt;span class=&quot;hljs-attr&quot;&gt;              padding:&lt;/span&gt; EdgeInsets.zero,
&lt;span class=&quot;hljs-attr&quot;&gt;              children:&lt;/span&gt; [
                Padding(
&lt;span class=&quot;hljs-attr&quot;&gt;                  padding:&lt;/span&gt; EdgeInsets.fromLTRB(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                  child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Column(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                    mainAxisAlignment:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; MainAxisAlignment.start,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                    crossAxisAlignment:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; CrossAxisAlignment.start,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                    children:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; [
                      Text(
                        &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;SahreApp&#39;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        style:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextStyle(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                          fontSize:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;26&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, 
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                          fontWeight:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; FontWeight.bold
                        ),
                      ),
                      SizedBox(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                      ),
                      Container(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, // Atur tinggi Container sesuai kebutuhan Anda
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Row(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                          children:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; [
                            Expanded(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Container(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                alignment:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Alignment.center,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                decoration:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BoxDecoration(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  color:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Colors.white,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  borderRadius:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BorderRadius.circular(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                                ),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextFormField(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  textAlign:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextAlign.start,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  textAlignVertical:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextAlignVertical.top,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  decoration:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; InputDecoration(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                    hintText:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Type to search .....&#39;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                    hintStyle:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextStyle(fontSize: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                    border:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; InputBorder.none,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                    contentPadding:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; EdgeInsets.symmetric(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                      vertical:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                      horizontal:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                    ),
                                  ),
                                ),
                              ),
                            ),
                            SizedBox(width: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                            Container(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;
                                  &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, // Atur tinggi Container sesuai kebutuhan Anda
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              decoration:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BoxDecoration(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                color:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Colors.blue,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                borderRadius:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BorderRadius.circular(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                              ),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; ElevatedButton(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                onPressed:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; () {
                                  // Implement your button action here
                                },
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                style:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; ElevatedButton.styleFrom(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  primary:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Colors.transparent,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  shadowColor:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Colors.transparent,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  shape:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; RoundedRectangleBorder(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                    borderRadius:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BorderRadius.circular(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                                  ),
                                ),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Icon(Icons.search),
                              ),
                            ),
                          ],
                        ),
                      ),
                      ListView.builder(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        padding:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; EdgeInsets.only(top: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        shrinkWrap:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        physics:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; NeverScrollableScrollPhysics(),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        itemCount:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                        itemBuilder:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; (context, index) {
                          return Card(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                            shape:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; RoundedRectangleBorder(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              borderRadius:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BorderRadius.circular(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                            ),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                            child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Padding(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              padding:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; const EdgeInsets.only(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  top:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, left: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, right: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;, bottom: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                              child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Container(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Row(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                  children:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; [
                                    Expanded(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                      child:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Column(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        mainAxisAlignment:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;
                                            MainAxisAlignment.start,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        crossAxisAlignment:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;
                                            CrossAxisAlignment.start,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        children:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; [
                                          Text(
                                            &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Creating a Login in Flutter using Restful Api and Token&#39;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            style:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextStyle(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                                fontSize:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                                fontWeight:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; FontWeight.bold),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            maxLines:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            overflow:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextOverflow.ellipsis,
                                          ),
                                          SizedBox(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                          ),
                                          Text(
                                            &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Hello everyone, back again at sahretech. On this occasion, we will learn how to create a login and process it in Flutter with&#39;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            style:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextStyle(fontSize: &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            maxLines:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            overflow:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; TextOverflow.ellipsis,
                                          ),
                                          SizedBox(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                          ),
                                          Row(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            children:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; [
                                              Icon(
                                                Icons.bookmark_outline,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                                size:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                              ),
                                              Icon(
                                                Icons.share_outlined,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                                size:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;23&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                              ),
                                            ],
                                          )
                                        ],
                                      ),
                                    ),
                                    SizedBox(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                      width:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
                                    ),
                                    Container(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        width:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        height:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                        decoration:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BoxDecoration(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            color:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; Colors.grey,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            borderRadius:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;
                                                BorderRadius.circular(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                            image:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; DecorationImage(
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                              fit:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; BoxFit.cover,
&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #a9b7c6;&quot;&gt;                                              image:&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt; NetworkImage(
                                                  &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://cdn.pixabay.com/photo/2022/09/10/23/28/city-7445873_1280.jpg&#39;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;),
                                            ))),
                                  ],
                                ),
                              ),
                            ),
                          );
                        },
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ],
        ),
      );
    }
  }&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzTf6s5OkkBGmOcDvuo6vawbLwhycXF3u7ojt1rA-863C2p3wUUMnkaF_xEafnyAozJWHWh5jrPXofCNlPWBWj8ZRAC85qsDoJdGPQnuP_SSfPlgjvDMu_AWxakMYl9FU7e0-IPeLQKcQITVfXFQduvnxLk8yV0ovw2KtewqsEVd_4nYT7_WzrxmGR6XPD/s700/Screenshot_2023-06-24-08-07-25-30_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;img alt=&quot;Flutter List View&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzTf6s5OkkBGmOcDvuo6vawbLwhycXF3u7ojt1rA-863C2p3wUUMnkaF_xEafnyAozJWHWh5jrPXofCNlPWBWj8ZRAC85qsDoJdGPQnuP_SSfPlgjvDMu_AWxakMYl9FU7e0-IPeLQKcQITVfXFQduvnxLk8yV0ovw2KtewqsEVd_4nYT7_WzrxmGR6XPD/s16000/Screenshot_2023-06-24-08-07-25-30_e5d051f78feb770f9bf43ba992bf1446.jpg&quot; title=&quot;Flutter List View&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Flutter List View&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;br /&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/cool-list-page-display-in-flutter.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7hJCQavJmSWaGBtvqWyWrhgbBY1w_QhcoGIXGtQlVRVhyyzTIZwJGfan1uj_wLijRDu-6d-kmlo9cYKc_WIm467bAIuPBx9qod20DIE6CyF8QpnPo9HFl2Sk4e8Vx3UgY4skChi8GXsDTyoFzX4lwBwrOEjkVfKk5iTgpX0r8gaPVqrlaqaizsL0oHFY/s72-c/Cool%20List%20Page%20Display%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-2463421929674336054</guid><pubDate>Mon, 25 Dec 2023 00:18:00 +0000</pubDate><atom:updated>2023-12-24T16:18:30.846-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">design</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Simple But Cool Flutter Login Display</title><description>&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKInU6QKY4hOl7X5dChyo9FIpcK5KnEAPdMSeZMvk5B8akoLMSC3N1a7R_sfE8Cc5Z8Zlz-1GHP4cOSOf03KNDdA0r5uuX01PzL6N0h-UqZYY7FvtFUfoI6ORCmC5xU5uuVJa56k05_m0zz3xSjdJJ2QOtnbzyrONzrqeAn3s3nr9xo3WBTj0Vshs4_sg/s1500/Simple%20But%20Cool%20Flutter%20Login%20Display.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Simple But Cool Flutter Login Display&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKInU6QKY4hOl7X5dChyo9FIpcK5KnEAPdMSeZMvk5B8akoLMSC3N1a7R_sfE8Cc5Z8Zlz-1GHP4cOSOf03KNDdA0r5uuX01PzL6N0h-UqZYY7FvtFUfoI6ORCmC5xU5uuVJa56k05_m0zz3xSjdJJ2QOtnbzyrONzrqeAn3s3nr9xo3WBTj0Vshs4_sg/s16000/Simple%20But%20Cool%20Flutter%20Login%20Display.png&quot; title=&quot;Simple But Cool Flutter Login Display&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;A simple but cool flutter login page display. Flutter login UI script.&lt;/div&gt;&lt;div&gt;Flutter login template free. Flutter login free UI design. Creating a modern login interface in flutter. Quick login view in flutter. Guide to Creating a Login View Using Flutter: Easy to Understand Script and Code. How to create an attractive and responsive login display using Flutter. Cool and Modern ListView Page Display&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;

&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;

&lt;br /&gt;&lt;br /&gt;1. Create a new flutter project with a name you like. Then open lib/main.dart then replace it with the script below.&lt;br /&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables&lt;/span&gt;

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  
  void main() =&amp;gt; runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginApp&lt;/span&gt;());
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        debugShowCheckedModeBanner: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Logi&lt;/span&gt;n&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginPage&lt;/span&gt;(),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;LoginPage&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    _LoginPageState createState() =&amp;gt; _LoginPageState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_LoginPageState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;LoginPage&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
          children: [
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
              width: double.infinity,
              height: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MediaQuery&lt;/span&gt;.of(context).size.height * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.35&lt;/span&gt;,
              decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DecorationImage&lt;/span&gt;(
                  image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NetworkImage&lt;/span&gt;(
                      &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2022/01/11/17/04/city-6931092_1280.jpg&#39;), // Ganti dengan URL gambar Anda&lt;/span&gt;
                  fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                ),
              ),
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                  mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
                  crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                  children: [
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                      mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
                      crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                      children: [
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Welcome&lt;/span&gt; to \nSahreApp 👏&#39;,
                          style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;,
                            fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.bold,
                            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// color: Colors.white,&lt;/span&gt;
                          ),
                        ),
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Please&lt;/span&gt; login to get started&#39;,
                          style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// color: Colors.white,&lt;/span&gt;
                          ),
                        ),
                      ],
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                      height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextFormField&lt;/span&gt;(
                      decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(
                        labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Emai&lt;/span&gt;l&#39;,
                        border: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;OutlineInputBorder&lt;/span&gt;(),
                        contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(
                          vertical:
                              &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Ubah ukuran vertikal sesuai keinginan Anda&lt;/span&gt;
                          horizontal:
                              &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Ubah ukuran horizontal sesuai keinginan Anda&lt;/span&gt;
                        ),
                      ),
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextFormField&lt;/span&gt;(
                      obscureText: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
                      decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(
                        labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Passwor&lt;/span&gt;d&#39;,
                        border: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;OutlineInputBorder&lt;/span&gt;(),
                        contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(
                          vertical:
                              &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                          horizontal:
                              &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                        ),
                      ),
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                      mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.end,
                      children: [
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Forgot&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Password&lt;/span&gt;&#39;,
                          style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;14&lt;/span&gt;,
                            color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
                          ),
                        )
                      ],
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                      height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
                      width: double.infinity,
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ElevatedButton&lt;/span&gt;(
                        onPressed: () {},
                        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Logi&lt;/span&gt;n&#39;),
                      ),
                    ),
                  ],
                ),
              ),
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Align&lt;/span&gt;(
              alignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Alignment&lt;/span&gt;.bottomCenter,
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FractionallySizedBox&lt;/span&gt;(
                widthFactor: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.8&lt;/span&gt;,
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                  padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                    crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.center,
                    mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
                    children: [
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Dont&lt;/span&gt; have an account yet? &#39;,
                        style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                          fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                        ),
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Register&lt;/span&gt;!&#39;,
                        style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                          fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                          color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ],
        ),
      );
    }
  }&lt;/pre&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;2. The display when running is as shown below. We use several widgets such as network image, text, textformfield, listview, column, row, and button&lt;div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiizrLX3hMiI5yWvug1u-TU0lPAPfXJ-ExAikQHUUTmTsJCkc9DnvC2sEBgl7cwNVjWAxhiZIHNCsgXpJWtaNT-3v6frM-BB2JUxm_68kkJEP6xAPcxZLBpdXx-LBiSCvP-dSpTqc-ty1_RIYTpbOuts7EmInpYVk-iNJCHMO7wHfyunaIRphz-kPdwZOEk&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Login Page UI&quot; data-original-height=&quot;719&quot; data-original-width=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiizrLX3hMiI5yWvug1u-TU0lPAPfXJ-ExAikQHUUTmTsJCkc9DnvC2sEBgl7cwNVjWAxhiZIHNCsgXpJWtaNT-3v6frM-BB2JUxm_68kkJEP6xAPcxZLBpdXx-LBiSCvP-dSpTqc-ty1_RIYTpbOuts7EmInpYVk-iNJCHMO7wHfyunaIRphz-kPdwZOEk=s16000&quot; title=&quot;Login Page UI&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/div&gt;</description><link>https://porkaone.blogspot.com/2023/12/simple-but-cool-flutter-login-display.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKInU6QKY4hOl7X5dChyo9FIpcK5KnEAPdMSeZMvk5B8akoLMSC3N1a7R_sfE8Cc5Z8Zlz-1GHP4cOSOf03KNDdA0r5uuX01PzL6N0h-UqZYY7FvtFUfoI6ORCmC5xU5uuVJa56k05_m0zz3xSjdJJ2QOtnbzyrONzrqeAn3s3nr9xo3WBTj0Vshs4_sg/s72-c/Simple%20But%20Cool%20Flutter%20Login%20Display.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-829448022142750989</guid><pubDate>Sun, 24 Dec 2023 06:30:00 +0000</pubDate><atom:updated>2023-12-23T22:31:41.555-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating a News App with Grid View Flutter and WordPress Api</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a
    href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH29pA1m8sUiHtcNuiurftkRu7eWgv2rbgg1RRjwL9IROtD1eSzaGcAccVYZOMDEcjD2ZEyJaxIurBM0V4sWMkYQ-gSw1DFIQZCuvRWWPnmy_CIV55wqSoQlayUcDEZ8v1aFfuPm-JKy-rarvuc8e-pIiGhrSIGdQ9nbu3RYEc1bnkmwOcx6HJPlgPc4g/s1500/Creating%20a%20News%20App%20with%20Grid%20View%20Flutter%20and%20WordPress%20Api.png&quot;
    style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;
    &gt;&lt;img
      alt=&quot;Creating a News App with Grid View Flutter and WordPress Api&quot;
      border=&quot;0&quot;
      data-original-height=&quot;845&quot;
      data-original-width=&quot;1500&quot;
      src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH29pA1m8sUiHtcNuiurftkRu7eWgv2rbgg1RRjwL9IROtD1eSzaGcAccVYZOMDEcjD2ZEyJaxIurBM0V4sWMkYQ-gSw1DFIQZCuvRWWPnmy_CIV55wqSoQlayUcDEZ8v1aFfuPm-JKy-rarvuc8e-pIiGhrSIGdQ9nbu3RYEc1bnkmwOcx6HJPlgPc4g/s16000/Creating%20a%20News%20App%20with%20Grid%20View%20Flutter%20and%20WordPress%20Api.png&quot;
      title=&quot;Creating a News App with Grid View Flutter and WordPress Api&quot;
  /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a simple news application using the grid view widget and WordPress
  api. Are you curious? Come on, follow the details below.
&lt;/p&gt;
&lt;ins
  class=&quot;adsbygoogle&quot;
  data-ad-client=&quot;ca-pub-9737321595122081&quot;
  data-ad-format=&quot;auto&quot;
  data-ad-slot=&quot;4546313114&quot;
  data-full-width-responsive=&quot;true&quot;
  style=&quot;display: block;&quot;
&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;
  I have previously made a news application with WordPress API at the following
  link
  &lt;a
    href=&quot;https://www.porkaone.com/2023/12/creating-news-application-with.html&quot;
    target=&quot;_blank&quot;
    &gt;https://www.porkaone.com/2023/12/creating-news-application-with.html&lt;/a
  &gt;. But the display still uses a list view. So, for those of you who are still
  confused about how to use grid view, then this is the right tutorial for those
  of you who want to implement this widget. Scroll down to immediately see the
  results.
&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
  How to Create a Grid View Flutter Application with WordPress Api
&lt;/h2&gt;
&lt;div&gt;
  1. Create a new project with the name you want. Use flutter version 3+ which
  supports null safety.
&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Then open the pubspec.yaml file. Then add the &lt;b&gt;http:&lt;/b&gt; and
  &lt;b&gt;flutter_widget_from_html_core:&lt;/b&gt; packages. Follow the example as below.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table
  align=&quot;center&quot;
  cellpadding=&quot;0&quot;
  cellspacing=&quot;0&quot;
  class=&quot;tr-caption-container&quot;
  style=&quot;margin-left: auto; margin-right: auto;&quot;
&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a
          href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj8AQ1G71tcCWL5heW--St_AuXydatCs3RNh7asYSgFUmEwleleF-7erwhdQge4fv5PLmMzN6nVeCo3uO4CvUA4x1g8GPDFUpTXtDDcH_oCWmzzlBjH4sfBBLFnTYKjom2Typ3xetvXzTL-c_GNgOcAAJRyBOps3qOFVInYoTHt_OUOuu_YCJpeRDNRStUT&quot;
          style=&quot;margin-left: 1em; margin-right: 1em;&quot;
          &gt;&lt;img
            alt=&quot;Menambahkan Package Flutter - Sahretech&quot;
            data-original-height=&quot;594&quot;
            data-original-width=&quot;1020&quot;
            src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj8AQ1G71tcCWL5heW--St_AuXydatCs3RNh7asYSgFUmEwleleF-7erwhdQge4fv5PLmMzN6nVeCo3uO4CvUA4x1g8GPDFUpTXtDDcH_oCWmzzlBjH4sfBBLFnTYKjom2Typ3xetvXzTL-c_GNgOcAAJRyBOps3qOFVInYoTHt_OUOuu_YCJpeRDNRStUT=s16000&quot;
            title=&quot;Menambahkan Package Flutter - Sahretech&quot;
        /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Create a new file in the lib folder with the name api.dart. Copy the script
  below.
&lt;/p&gt;
&lt;pre
  class=&quot;line-numbers language-markup&quot;
  data-codetype=&quot;CSSku&quot;
  style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot;
  title=&quot;Script&quot;
&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Api&lt;/span&gt; &lt;/span&gt;{

  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//method untuk mengambil data&lt;/span&gt;
  Future fetchData() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
    
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//get data from api&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//we get data from the website hipwee and store it into dataJson variable&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//you can use url from the other website&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; dataJson = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://hipwee.com/wp-json/wp/v2/posts?_embed&#39;&lt;/span&gt;));

    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//convert string into dart object&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//This change aims to ensure that data can be managed easily&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; data = jsonDecode(dataJson.body);

    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//get data&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; data;
    
  }
}&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. Create a new file in the lib folder with the name detail.dart. Copy the
  script below.
&lt;/p&gt;
&lt;pre
  class=&quot;line-numbers language-markup&quot;
  data-codetype=&quot;CSSku&quot;
  style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot;
  title=&quot;Script&quot;
&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart&#39;&lt;/span&gt;;

class Detail extends StatelessWidget {
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; content;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;;

  Detail({
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;,
  });

  @override
  Widget build(BuildContext context) {
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//remove the text &#39;data&#39; in &#39;data-src&#39;, this is usually found in&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; modifiedHtmlString = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content.replaceAll(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;data-src&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;src&#39;&lt;/span&gt;);


    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Scaffold(
      appBar: AppBar(
        title: Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Detail&#39;&lt;/span&gt;),
      ),
      body: ListView(
        padding: EdgeInsets.zero,
        children: [
          Container(
            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//device-wide image size&lt;/span&gt;
            &lt;span class=&quot;hljs-built_in&quot;&gt;width&lt;/span&gt;: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;double&lt;/span&gt;.infinity,
            &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: MediaQuery.of(context).&lt;span class=&quot;hljs-built_in&quot;&gt;size&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt; * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,


            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//you can fill the container with images using this property&lt;/span&gt;
            decoration: BoxDecoration(
              &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;: DecorationImage(
                &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;: NetworkImage(&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// show image&lt;/span&gt;
                fit: BoxFit.cover,
              ),
            ),
          ),
          SizedBox(
            &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//distance between image and content&lt;/span&gt;
          ),
          Padding(
            padding: EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//show title&lt;/span&gt;
                  style: TextStyle(
                    fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//font size&lt;/span&gt;
                    fontWeight: FontWeight.w400, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//letter thickness&lt;/span&gt;
                  ),
                ),
                SizedBox(
                  &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//distance between title and content&lt;/span&gt;
                ),
                HtmlWidget(
                  modifiedHtmlString,
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  5. Open the main.dart file. Then edit with the script below.
&lt;/p&gt;
&lt;pre
  class=&quot;line-numbers language-markup&quot;
  data-codetype=&quot;CSSku&quot;
  style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot;
  title=&quot;Script&quot;
&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// ignore_for_file: prefer_const_constructors&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;api&lt;/span&gt;.dart&#39;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;detail&lt;/span&gt;.dart&#39;;

void main() {
  runApp(
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
      debugShowCheckedModeBanner: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
      home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;(),
    ),
  );
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;({&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.key});

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;&amp;gt; createState() =&amp;gt; _MyAppState();
}

&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_MyAppState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;MyApp&amp;gt;&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Api&lt;/span&gt; api = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Api&lt;/span&gt;();

  &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;(
          future: api.fetchData(),
          builder: (_, snapshot) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.done) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;var&lt;/span&gt; list = snapshot.data as &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;;

              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;GridView&lt;/span&gt;.builder(
                itemCount: list.length,
                gridDelegate: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SliverGridDelegateWithFixedCrossAxisCount&lt;/span&gt;(
                  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// multiple grids displayed in one row&lt;/span&gt;
                  crossAxisCount: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                ),
                itemBuilder: (_, index) {
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                    margin: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
                    decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                      border: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Border&lt;/span&gt;.all(
                        color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.grey,
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1.0&lt;/span&gt;,
                      ),
                    ),
                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
                      onTap: () {
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                          context,
                          &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// DetailPage is the destination page&lt;/span&gt;
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                            builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                              title: list[index][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;titl&lt;/span&gt;e&#39;][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;rendere&lt;/span&gt;d&#39;],
                              content: list[index][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;conten&lt;/span&gt;t&#39;][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;rendere&lt;/span&gt;d&#39;],
                              image: list[index][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;_embedde&lt;/span&gt;d&#39;]
                                  [&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;wp&lt;/span&gt;:featuredmedia&#39;][&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;source_ur&lt;/span&gt;l&#39;],
                            ),
                          ),
                        );
                      },
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                        children: [
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Flexible&lt;/span&gt;(
                            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                              list[index][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;_embedde&lt;/span&gt;d&#39;][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;wp&lt;/span&gt;:featuredmedia&#39;][&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;]
                                  [&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;source_ur&lt;/span&gt;l&#39;],
                              height:
                                  &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,
                              fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                              width: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MediaQuery&lt;/span&gt;.of(context).size.width,
                            ),
                          ),
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                            padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(
                                left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, bottom: 5,),
                            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                              list[index][&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;titl&lt;/span&gt;e&#39;]
                                  [&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;rendere&lt;/span&gt;d&#39;],
                              style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                              ),
                              maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;,
                            ),
                          ),
                        ],
                      ),
                    ),
                  );
                },
              );
            } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
              );
            }
          },
        ));
  }
}&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  6. Ok, now we have done all the steps. Try running it now with the emulator.
  If successful, the display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a
    href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQzKl9pQ1a-WvH4mLB5NJnQwVc5X1s5jOj3yYyHVYUGloLC4PgUZ8hkA7cED_MbBH4zXVkHHucJWxxT3B1tI3wvckkTidmkx6aH1YD-JeMNrX5zLhUOvMqNI1Z7VPqhfifxCH_YczeMEgt-26juVoBCeG1nBVIzqnfuJqgJ1a8Tguwcqu7BFs36DxJOQXD/s500/Screenshot_2023-09-02-13-32-39-03_8f49471faf9efb8b724217eb3759b3e9.jpg&quot;
    style=&quot;margin-left: 1em; margin-right: 1em;&quot;
    &gt;&lt;img
      alt=&quot;flutter grid view&quot;
      border=&quot;0&quot;
      data-original-height=&quot;500&quot;
      data-original-width=&quot;225&quot;
      src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQzKl9pQ1a-WvH4mLB5NJnQwVc5X1s5jOj3yYyHVYUGloLC4PgUZ8hkA7cED_MbBH4zXVkHHucJWxxT3B1tI3wvckkTidmkx6aH1YD-JeMNrX5zLhUOvMqNI1Z7VPqhfifxCH_YczeMEgt-26juVoBCeG1nBVIzqnfuJqgJ1a8Tguwcqu7BFs36DxJOQXD/s16000/Screenshot_2023-09-02-13-32-39-03_8f49471faf9efb8b724217eb3759b3e9.jpg&quot;
      title=&quot;flutter grid view&quot; /&gt;&lt;/a
  &gt;&lt;a
    href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghkM7X-SgCgo81HmdB9oDEDAAqk2M5o4VdYcEnFQdghtVij2sTuwJUVBarmyCyj2c0SuoAwHywhQKl6-2vu8jDg74v-4Yc8t9yQZJlz-EARxa65TR4BQRvlQyafEYhdvDxRSrwIjTW-lvb2TPYAmHG7vlyweLA9njZqXaY3xJOhtBROhdeNvFSu6PAgsPp/s500/Screenshot_2023-09-02-13-33-04-89_8f49471faf9efb8b724217eb3759b3e9.jpg&quot;
    style=&quot;margin-left: 1em; margin-right: 1em;&quot;
    &gt;&lt;img
      alt=&quot;flutter grid view&quot;
      border=&quot;0&quot;
      data-original-height=&quot;500&quot;
      data-original-width=&quot;225&quot;
      src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghkM7X-SgCgo81HmdB9oDEDAAqk2M5o4VdYcEnFQdghtVij2sTuwJUVBarmyCyj2c0SuoAwHywhQKl6-2vu8jDg74v-4Yc8t9yQZJlz-EARxa65TR4BQRvlQyafEYhdvDxRSrwIjTW-lvb2TPYAmHG7vlyweLA9njZqXaY3xJOhtBROhdeNvFSu6PAgsPp/s16000/Screenshot_2023-09-02-13-33-04-89_8f49471faf9efb8b724217eb3759b3e9.jpg&quot;
      title=&quot;flutter grid view&quot;
  /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  That&#39;s it for our short tutorial this time on how to create a news application
  with Flutter grid view and WordPress API. Hopefully this short tutorial is
  useful, that&#39;s all and thank you.
&lt;/p&gt;
&lt;ins
  class=&quot;adsbygoogle&quot;
  data-ad-client=&quot;ca-pub-9737321595122081&quot;
  data-ad-format=&quot;auto&quot;
  data-ad-slot=&quot;4546313114&quot;
  data-full-width-responsive=&quot;true&quot;
  style=&quot;display: block;&quot;
&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-news-app-with-grid-view.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH29pA1m8sUiHtcNuiurftkRu7eWgv2rbgg1RRjwL9IROtD1eSzaGcAccVYZOMDEcjD2ZEyJaxIurBM0V4sWMkYQ-gSw1DFIQZCuvRWWPnmy_CIV55wqSoQlayUcDEZ8v1aFfuPm-JKy-rarvuc8e-pIiGhrSIGdQ9nbu3RYEc1bnkmwOcx6HJPlgPc4g/s72-c/Creating%20a%20News%20App%20with%20Grid%20View%20Flutter%20and%20WordPress%20Api.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-8660530844764196199</guid><pubDate>Sun, 24 Dec 2023 04:35:00 +0000</pubDate><atom:updated>2023-12-23T20:35:09.601-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>How to Create a Map in Flutter and Add Markers</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkxkuwwWMWnpcebuhXBDAsvnL7CJew9MYO9MYiGdiwPxpRiQYNEXTk8mt4qA01mh9EUuVIb4HDSZGtciys4uBiMPmEkTcj5AaySineGS6eAlZzDJFDFem9PsJYEfA71mAIb3D1O0QS2a3CeJ8XhtbevQAWDY6kE8MwA8NSUt1lyZfyj9YAY50004NcIl0/s1500/How%20to%20Create%20a%20Map%20in%20Flutter%20and%20Add%20Markers.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Create a Map in Flutter and Add Markers&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkxkuwwWMWnpcebuhXBDAsvnL7CJew9MYO9MYiGdiwPxpRiQYNEXTk8mt4qA01mh9EUuVIb4HDSZGtciys4uBiMPmEkTcj5AaySineGS6eAlZzDJFDFem9PsJYEfA71mAIb3D1O0QS2a3CeJ8XhtbevQAWDY6kE8MwA8NSUt1lyZfyj9YAY50004NcIl0/s16000/How%20to%20Create%20a%20Map%20in%20Flutter%20and%20Add%20Markers.png&quot; title=&quot;How to Create a Map in Flutter and Add Markers&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to display a map in Flutter and provide markers. Are you curious? Come on,
  follow the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  In our tutorial this time, we will create a simple application that displays a
  map. Then there is a marker and if you tap this marker, a bottom sheet will
  appear in the form of information about that place.
&lt;/p&gt;
&lt;p&gt;
  Apart from that, this time we didn&#39;t use Google Maps. We will use
  openstreetmap instead. If you have credit card problems and have difficulty
  using Google Maps, OpenStreetmap could be the solution. Scroll to the bottom
  of this article to see the final results.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Create a Map in Flutter and Add Markers
&lt;/h1&gt;
&lt;p&gt;
  1. Create a new project with the name you want. Use the latest version of
  flutter. For flutter I use version 2.10 with sdk: &quot;&amp;gt;=2.16.2 &amp;lt;3.0.0&quot;
&lt;/p&gt;
&lt;p&gt;
  2. Open the pubspec.yaml file then add the flutter_map: and latlong: ^0.6.1
  packages, follow the example as shown in the image below. And don&#39;t forget to
  save the file so the package can be downloaded.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEioq5XtKF9S9FGybqacv-wsxTEMZ4eqcCrESMeloGc4w_LdrbuxqEKKsbA3ahTnPI8BUvsM3MbVgQ3DiP0RAE5h5EXw9kIZPb2gQwcros2nTPY5znnEuuJCA5PlzUcbgYCiNmwPPXgin6t_Mx9JljLeKegrDJ-SpJ17DbPcoshsQyMGs7J2WLooGIxkFINA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;317&quot; data-original-width=&quot;610&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEioq5XtKF9S9FGybqacv-wsxTEMZ4eqcCrESMeloGc4w_LdrbuxqEKKsbA3ahTnPI8BUvsM3MbVgQ3DiP0RAE5h5EXw9kIZPb2gQwcros2nTPY5znnEuuJCA5PlzUcbgYCiNmwPPXgin6t_Mx9JljLeKegrDJ-SpJ17DbPcoshsQyMGs7J2WLooGIxkFINA=s16000&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;3. Open the main.dart file then replace it with the script below.&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;php&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter_map/flutter_map.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:latlong2/latlong.dart&#39;;
  
  void main() {
    runApp(const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;({&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;? key}) : &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;(key: key);
  
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// This widget is the root of your application.&lt;/span&gt;
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Demo&lt;/span&gt;&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
          primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
        ),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
          body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;OpenStreetMapWidget&lt;/span&gt;(),
        ),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;OpenStreetMapWidget&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;OpenStreetMapWidget&lt;/span&gt;&amp;gt; createState() =&amp;gt; _OpenStreetMapWidgetState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_OpenStreetMapWidgetState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;OpenStreetMapWidget&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    void _showDetailsSheet(
        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context, &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; name, &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; about, &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; latlng) {
      showModalBottomSheet(
        context: context,
        isScrollControlled: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
        builder: (&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SingleChildScrollView&lt;/span&gt;(
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
              padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;),
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                children: [
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                    padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(name),
                  ),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Divider&lt;/span&gt;(),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                    padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                        about,
                        softWrap: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
                      ),
                    ),
                  ),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Divider&lt;/span&gt;(),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                    padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;LatLong&lt;/span&gt;: &#39;+latlng,
                        softWrap: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
                      ),
                    ),
                  ),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Divider&lt;/span&gt;(),
                ],
              ),
            ),
          );
        },
      );
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Marker&lt;/span&gt;&amp;gt; markers = [
        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Marker&lt;/span&gt;(
          width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80.0&lt;/span&gt;,
          height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80.0&lt;/span&gt;,
          point: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LatLng&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;-2.9917713&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;104.7624691&lt;/span&gt;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// marker coordinat&lt;/span&gt;
          builder: (ctx) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
            onTap: () {
              _showDetailsSheet(
                  context,
                  &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Ampera&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Bridge&lt;/span&gt;&#39;,
                  &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Ampera&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Bridge&lt;/span&gt;, the icon of the capital city of &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;South&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Sumatra&lt;/span&gt;, is a bridge erected on the &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Sumatran&lt;/span&gt; route that stretches over the &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Musi&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;River&lt;/span&gt;. &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Built&lt;/span&gt; to link two areas, &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Ampera&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Bridge&lt;/span&gt; connects &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Seberang&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Ilir&lt;/span&gt; and &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Seberang&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Ulu&lt;/span&gt;, and further serves as a primary route &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt; locals on a daily basis.&#39;,
                  &#39;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;-2.9917713&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;104.7624691&lt;/span&gt;&#39;);
            },
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.place,
                size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;,
                color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.red,
              ),
            ),
          ),
        ),
      ];
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FlutterMap&lt;/span&gt;(
        options: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MapOptions&lt;/span&gt;(
          center: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;LatLng&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;-2.9917713&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;104.7624691&lt;/span&gt;),
          zoom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;14.0&lt;/span&gt;, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Tingkat zoom awal&lt;/span&gt;
        ),
        layers: [
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TileLayerOptions&lt;/span&gt;(
            urlTemplate: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&#39;,&lt;/span&gt;
            subdomains: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;],
          ),
          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MarkerLayerOptions&lt;/span&gt;(
            markers: markers,
          ),
        ],
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Explanation of the script above:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    The OpenStreetMapWidget class is an instance of StatefulWidget, which means
    that this widget has a state that can change. In it, we implement the
    build() function which will render the OpenStreetMap map view.
  &lt;/li&gt;
  &lt;li&gt;
    In the build() function, we create a list of markers containing one marker.
    A marker is an object that represents a marker on a map. Here, we set
    several properties such as width, height, point (marker coordinates), and
    builder (function to render the marker display).
  &lt;/li&gt;
  &lt;li&gt;
    The _showDetailsSheet() function is used to display a modal bottom sheet
    when the user taps a marker on the map. A bottom sheet modal is an interface
    component that appears from the bottom of the screen and presents additional
    information or actions.\
  &lt;/li&gt;
  &lt;li&gt;
    Inside _showDetailsSheet(), we use showModalBottomSheet() to display the
    modal bottom sheet. We define the context and build the bottom sheet modal
    view using the SingleChildScrollView, Container, and Column widgets.
  &lt;/li&gt;
  &lt;li&gt;
    List&amp;lt;Marker&amp;gt; markers = [ ... ]: Creates a list of markers containing
    Marker objects. Each Marker represents a marker on the map.
  &lt;/li&gt;
  &lt;li&gt;
    return FlutterMap(...);: Returns a FlutterMap widget that displays a map
    with predefined configurations and layers.
  &lt;/li&gt;
  &lt;li&gt;
    MapOptions(...): Set configurations for the map display such as center and
    initial zoom level.
  &lt;/li&gt;
  &lt;li&gt;
    TileLayerOptions(...): Sets a map tile layer from OpenStreetMap with the
    specified template URL.
  &lt;/li&gt;
  &lt;li&gt;
    MarkerLayerOptions(...): Sets a marker layer on the map using previously
    defined markers.
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;/ol&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;
  4. After all the steps have been completed, please run the emulator. If
  successful, the display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtDjLPLnKSUHIzlUf5NDj_dQNuzOe8cz68i50kWWvKIinMjzlowfthqpGFayfpyYYTYer4PgJeLn7XaBCmWP1tDE6wZG_Xf0E0gW9yNQwG4tXRlMY0Xg2LvdCkHwjdNrGGiINTZlb3asXwq5oKTACCjTZDX4fs5QRnFMcWqLv6Ix-SgJ9ZtmdwIeSOhAE-/s500/Screenshot_2023-07-15-16-04-27-26_dfbcaeac50cadedc5132987cd31594f8.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtDjLPLnKSUHIzlUf5NDj_dQNuzOe8cz68i50kWWvKIinMjzlowfthqpGFayfpyYYTYer4PgJeLn7XaBCmWP1tDE6wZG_Xf0E0gW9yNQwG4tXRlMY0Xg2LvdCkHwjdNrGGiINTZlb3asXwq5oKTACCjTZDX4fs5QRnFMcWqLv6Ix-SgJ9ZtmdwIeSOhAE-/s16000/Screenshot_2023-07-15-16-04-27-26_dfbcaeac50cadedc5132987cd31594f8.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkDblXMx5d0tR0_lWooqYkzksWAsOI573ETv1RPsdQxZAL8amdd6PYU2cZUrU_eaa0J3KGhCXII32z3Zd5hdXEML--Y1dRwssz13pkerMkCqeYTqmKja1kkEUCoduCaS9QDuLOU2SyOcvk2Bmejpk4TAtXXRvFzZLvA0fvj4qEAJInxvsDX0P4Pl_kSMI/s500/Screenshot_2023-07-15-16-04-52-98_dfbcaeac50cadedc5132987cd31594f8.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkDblXMx5d0tR0_lWooqYkzksWAsOI573ETv1RPsdQxZAL8amdd6PYU2cZUrU_eaa0J3KGhCXII32z3Zd5hdXEML--Y1dRwssz13pkerMkCqeYTqmKja1kkEUCoduCaS9QDuLOU2SyOcvk2Bmejpk4TAtXXRvFzZLvA0fvj4qEAJInxvsDX0P4Pl_kSMI/s16000/Screenshot_2023-07-15-16-04-52-98_dfbcaeac50cadedc5132987cd31594f8.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  It&#39;s easy isn&#39;t it?, now you can create an Android application that can
  display maps. You can also display markers and display the information in
  them. Improve your maps application again by using Google Maps, API data and
  other features.
&lt;/p&gt;
&lt;p&gt;
  That&#39;s it for this tutorial on How to Make a Map in Flutter and Add Markers.
  Hopefully this short tutorial is useful. If there is something you don&#39;t
  understand, please ask directly in the comments column below. That&#39;s all and
  receive a salary.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/how-to-create-map-in-flutter-and-add.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkxkuwwWMWnpcebuhXBDAsvnL7CJew9MYO9MYiGdiwPxpRiQYNEXTk8mt4qA01mh9EUuVIb4HDSZGtciys4uBiMPmEkTcj5AaySineGS6eAlZzDJFDFem9PsJYEfA71mAIb3D1O0QS2a3CeJ8XhtbevQAWDY6kE8MwA8NSUt1lyZfyj9YAY50004NcIl0/s72-c/How%20to%20Create%20a%20Map%20in%20Flutter%20and%20Add%20Markers.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-1717471889252575962</guid><pubDate>Sun, 24 Dec 2023 03:56:00 +0000</pubDate><atom:updated>2023-12-23T19:56:32.424-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>How to Create a Firebase CRUD App with Firebase in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jWpwQeFZeVqP_CW928LeJOA6m2oPtgioe5SnXxxy_u1ry53g57CYr-71UJAq_jWof6au-z9d9tJfJ6zwBKFWcuEhewm5-26EQzA9WY2R3YGjzTaegXxYGigRScbAdSkhwlhMiwPTbQX5VRF-vkuLlpMwxLbdfnJ-5qZBYinyyPXYalH4pi556T7enuc/s1500/How%20to%20Create%20a%20Firebase%20CRUD%20App%20with%20Firebase%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Create a Firebase CRUD App with Firebase in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jWpwQeFZeVqP_CW928LeJOA6m2oPtgioe5SnXxxy_u1ry53g57CYr-71UJAq_jWof6au-z9d9tJfJ6zwBKFWcuEhewm5-26EQzA9WY2R3YGjzTaegXxYGigRScbAdSkhwlhMiwPTbQX5VRF-vkuLlpMwxLbdfnJ-5qZBYinyyPXYalH4pi556T7enuc/s16000/How%20to%20Create%20a%20Firebase%20CRUD%20App%20with%20Firebase%20in%20Flutter.png&quot; title=&quot;How to Create a Firebase CRUD App with Firebase in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create CRUD using Firebase and Flutter. Are you curious? Come on, follow
  the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Firebase is a service from Google that provides online storage or database.
  Not only online storage, Firebase also has other services such as push
  notifications, real-time storage, file storage, testing and so on. Firebase
  can be a solution that can be used if you are lazy or can&#39;t create a backend
  and environment.
&lt;/p&gt;
&lt;p&gt;
  On this occasion we will learn how to create a task CRUD application using
  Firebase. The form is quite simple, namely the title and description of the
  task. Scroll to the bottom of this article to see the final results.
&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Create a CRUD App with Firebase in Flutter
&lt;/h1&gt;
&lt;div&gt;
  1. Create a flutter project and connect to firebase. You can connect to
  Firebase manually or with the help of the CLI. Watch the YouTube video below
  to setup Firebase with the help of CLI.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;350&quot; src=&quot;https://www.youtube.com/embed/fxDusoMcWj8&quot; width=&quot;100%&quot; youtube-src-id=&quot;fxDusoMcWj8&quot;&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;br /&gt;
&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  2. Use the latest flutter version. Meanwhile, the version I use is Flutter
  version 2.10. And sdk: &quot;&amp;gt;=2.16.2 &amp;lt;3.0.0&quot;, minSdkVersion 19 and using
  multiDex. Here are the pubspec.yaml and android/app/build.gradle settings that
  I have.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjH53sBsssy4Jz084TVvW97gWmg_BX1x-n3Y4O6XuyIdHdOa0kZHxiWL6ibRzuEM7i0CX5RXgtCEDT06IFNpUsrl5TplKC-aA1inpgZl299cTORoII3_dyr2r8RVBBlkMJns0BGjxfxrjp28S99YfL1C5iWBMz3BbEVx8P-OO9GJ2hV5ZAnLvUtcAuJOhPw&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;393&quot; data-original-width=&quot;662&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjH53sBsssy4Jz084TVvW97gWmg_BX1x-n3Y4O6XuyIdHdOa0kZHxiWL6ibRzuEM7i0CX5RXgtCEDT06IFNpUsrl5TplKC-aA1inpgZl299cTORoII3_dyr2r8RVBBlkMJns0BGjxfxrjp28S99YfL1C5iWBMz3BbEVx8P-OO9GJ2hV5ZAnLvUtcAuJOhPw=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;pubspec.yaml&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEirBBxLrZk6MHJX5IPiyhWAvsK0-aQA_Ei_myBuJRZR6rD_EOB4RYmHnMbk7r0fmK6bNy0adpaMgD6_A4NHizS0HJTz3UKxwd5bQ3qn9W5lnRSJUBvEZY7CiOCFZQSmGeMSXMZvy2kpdHL4qYvLubLxICiMKWzvrUPIaNeGghVgNOxXxabUHaiNQR6eF0lw&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;456&quot; data-original-width=&quot;657&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEirBBxLrZk6MHJX5IPiyhWAvsK0-aQA_Ei_myBuJRZR6rD_EOB4RYmHnMbk7r0fmK6bNy0adpaMgD6_A4NHizS0HJTz3UKxwd5bQ3qn9W5lnRSJUBvEZY7CiOCFZQSmGeMSXMZvy2kpdHL4qYvLubLxICiMKWzvrUPIaNeGghVgNOxXxabUHaiNQR6eF0lw=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
        &lt;b style=&quot;text-align: left;&quot;&gt;android/app/build.gradle&lt;/b&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  3. Create a new file in the lib folder with the name task_model.dart Follow
  the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Task&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; id;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; description;

  Task({
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.id,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.description,
  });
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  4. Create a new file in the lib folder with the name database.dart. Follow the
  script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:cloud_firestore/cloud_firestore.dart&#39;&lt;/span&gt;;

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;task_model.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;DatabaseService&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; CollectionReference tasksCollection =
        FirebaseFirestore.instance.collection(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;tasks&#39;&lt;/span&gt;); //inisialisasi database tasks
    //metode untuk menambah data
    Future&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt;&amp;gt; addTask(&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title, &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; description) &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;try&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; tasksCollection.add({
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;: title,
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;description&#39;&lt;/span&gt;: description,
        });
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;catch&lt;/span&gt; (e) {
        &lt;span class=&quot;hljs-built_in&quot;&gt;print&lt;/span&gt;(e.toString());
      }
    }
    //metode untuk menampilkan gambar
    Stream&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;Task&amp;gt;&amp;gt; getTasks() {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; tasksCollection.snapshots().map(
        (snapshot) {
          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.docs.isEmpty) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; [];
          } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
  
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; snapshot.docs
                .map(
                  (doc) =&amp;gt; Task(
                    id: doc.id,
                    title: (doc.data() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;)[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
                    description:
                        (doc.data() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;)[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;description&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
                  ),
                )
                .toList();
          }
        },
      );
    }
  &lt;span&gt;&amp;nbsp;&amp;nbsp;//metode untuk mengapus data&lt;/span&gt;
    Future&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt;&amp;gt; deleteTask(&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; id) &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;try&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; tasksCollection.doc(id).delete();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;catch&lt;/span&gt; (e) {
        &lt;span class=&quot;hljs-built_in&quot;&gt;print&lt;/span&gt;(e.toString());
      }
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Explanation of the script above:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    final CollectionReference tasksCollection =
    FirebaseFirestore.instance.collection(&#39;tasks&#39;); serves to initialize the
    tasksCollection variable as a reference to the &#39;tasks&#39; collection in
    Firestore. Or it&#39;s easier to initialize the database.
  &lt;/li&gt;
  &lt;li&gt;
    tasksCollection.add() is used to add a new document to the Firestore
    collection referenced by tasksCollection.
  &lt;/li&gt;
  &lt;li&gt;
    tasksCollection.doc(id).delete() is used to delete documents based on the
    document id in the Firestore collection referenced by tasksCollection.
  &lt;/li&gt;
  &lt;li&gt;
    tasksCollection.snapshots().map() is used to take the most recent snapshot
    of the Firestore collection referenced by tasksCollection and map each
    snapshot to the desired data type.
  &lt;/li&gt;
  &lt;li&gt;
    Stream&amp;lt;List&amp;lt;Task&amp;gt;&amp;gt; is a data type that can be used in realtime.
    Please try entering data directly into Firebase. Then the data in the
    application is automatically updated
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;
  5. Create a new file in the lib folder with the name task_screen.dart Follow
  the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;database&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;task_model&lt;/span&gt;.dart&#39;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;TaskScreen&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DatabaseService&lt;/span&gt; databaseService = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DatabaseService&lt;/span&gt;();
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Task&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Manager&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;StreamBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Task&lt;/span&gt;&amp;gt;&amp;gt;(
          stream: databaseService.getTasks(),
          builder: (context, snapshot) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (!snapshot.hasData) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
              );
            }
  
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Task&lt;/span&gt;&amp;gt; tasks = snapshot.data!;
  
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
              itemCount: tasks.length,
              itemBuilder: (context, index) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                  title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(tasks[index].title),
                  subtitle: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(tasks[index].description),
                  trailing: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;IconButton&lt;/span&gt;(
                    icon: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.delete),
                    onPressed: () {
                      databaseService.deleteTask(tasks[index].id);
                    },
                  ),
                );
              },
            );
          },
        ),
        floatingActionButton: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FloatingActionButton&lt;/span&gt;(
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.add),
          onPressed: () {
            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Display a dialog for adding a new task&lt;/span&gt;
            showDialog(
              context: context,
              builder: (context) {
                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; title = &#39;&#39;;
                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; description = &#39;&#39;;
  
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AlertDialog&lt;/span&gt;(
                  title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Add&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Task&lt;/span&gt;&#39;),
                  content: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                    mainAxisSize: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisSize&lt;/span&gt;.min,
                    children: [
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextField&lt;/span&gt;(
                        onChanged: (value) {
                          title = value;
                        },
                        decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(
                          labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Titl&lt;/span&gt;e&#39;,
                        ),
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextField&lt;/span&gt;(
                        onChanged: (value) {
                          description = value;
                        },
                        decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(
                          labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Descriptio&lt;/span&gt;n&#39;,
                        ),
                      ),
                    ],
                  ),
                  actions: [
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextButton&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Cance&lt;/span&gt;l&#39;),
                      onPressed: () {
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.of(context).pop();
                      },
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextButton&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Ad&lt;/span&gt;d&#39;),
                      onPressed: () {
                        databaseService.addTask(title, description);
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.of(context).pop();
                      },
                    ),
                  ],
                );
              },
            );
          },
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;6. Open the lib/main.dart file and replace it with the script below&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:firebase_core/firebase_core.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;firebase_options&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;task_screen&lt;/span&gt;.dart&#39;;
  
  
  void main() async {
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WidgetsFlutterBinding&lt;/span&gt;.ensureInitialized();
    await &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Firebase&lt;/span&gt;.initializeApp(
      options: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DefaultFirebaseOptions&lt;/span&gt;.currentPlatform,
    );
  
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Firebase&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CRUD&lt;/span&gt;&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
          primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
        ),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TaskScreen&lt;/span&gt;(),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  We have done all the steps. Now we can test with the emulator. If successful,
  the display will look like the image below.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeQC4lujaXxYq8N84qMMfhVDh4V_OEHfDRLrZrbunH1FyhFCMv-R0NKIG_GYFOuWh6U40UvOwyr-yAeCBPO_mXYXrJUNeUzls7Nc6u5G50WSB69HXdhgbDXt1mLcEWgCpWoHmnSPXLOKYhWVFsq-rk7CqP-guo4QI-5bjf9b1Y78x7NykIzmaKuuLWoGv/s700/Screenshot_2023-07-10-16-30-05-59_1f95d5680d28c01d7e683cccf28b9529.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sahretech Flutter Task Screen&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKeQC4lujaXxYq8N84qMMfhVDh4V_OEHfDRLrZrbunH1FyhFCMv-R0NKIG_GYFOuWh6U40UvOwyr-yAeCBPO_mXYXrJUNeUzls7Nc6u5G50WSB69HXdhgbDXt1mLcEWgCpWoHmnSPXLOKYhWVFsq-rk7CqP-guo4QI-5bjf9b1Y78x7NykIzmaKuuLWoGv/s16000/Screenshot_2023-07-10-16-30-05-59_1f95d5680d28c01d7e683cccf28b9529.jpg&quot; title=&quot;Sahretech Flutter Task Screen&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Task Screen&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg6dF0vBS4EaY-XVYm0Dsdi3Y0yI82XmEIAPty9Kev5z-eQ3ViZXmZtzgPkVJWLn9D6fluy5T1xt17LZo_4a_tVUeP42R6YIrTivlDuKp1NMHuI3tR-8lCVxTjPzf2RbH867fQPbZ9Jr215hIkJBnLwZunLTzAK7y50MLZuHHPp-Wk9MKgRMuzhyok3D5As&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Firebase Flutter Sahretech&quot; data-original-height=&quot;620&quot; data-original-width=&quot;1179&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg6dF0vBS4EaY-XVYm0Dsdi3Y0yI82XmEIAPty9Kev5z-eQ3ViZXmZtzgPkVJWLn9D6fluy5T1xt17LZo_4a_tVUeP42R6YIrTivlDuKp1NMHuI3tR-8lCVxTjPzf2RbH867fQPbZ9Jr215hIkJBnLwZunLTzAK7y50MLZuHHPp-Wk9MKgRMuzhyok3D5As=s16000&quot; title=&quot;Firebase Flutter Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Firebase&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  That&#39;s the tutorial on how to create a Firebase CRUD application in Flutter.
  Hopefully this short tutorial is useful, if you have any questions, please ask
  directly in the comments column below. That&#39;s all and receive a salary.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/how-to-create-firebase-crud-app-with.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jWpwQeFZeVqP_CW928LeJOA6m2oPtgioe5SnXxxy_u1ry53g57CYr-71UJAq_jWof6au-z9d9tJfJ6zwBKFWcuEhewm5-26EQzA9WY2R3YGjzTaegXxYGigRScbAdSkhwlhMiwPTbQX5VRF-vkuLlpMwxLbdfnJ-5qZBYinyyPXYalH4pi556T7enuc/s72-c/How%20to%20Create%20a%20Firebase%20CRUD%20App%20with%20Firebase%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-6011442851812167026</guid><pubDate>Sun, 24 Dec 2023 02:21:00 +0000</pubDate><atom:updated>2023-12-23T18:21:31.814-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Tutorial on How to Create a Swipe Action on a List in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSR7kpF6-syczOpQqkIZT2ceNCBZ8dS3pRQQhwBawSAXcYwfbs7cLQWiYuwXFl6nbWIACswTjF_o40urY2yIx9sxRI7IJ91qTs-AF2sm-4yEfDlNSA6DO4yPkrUJx-NfW5l5Teh-5v_PKuUjxMM0a7-NGXfoTsWdEo_O1JtK51aOfDHBRCJtI4W-xB1Ds/s1500/Tutorial%20on%20How%20to%20Create%20a%20Swipe%20Action%20on%20a%20List%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Tutorial on How to Create a Swipe Action on a List in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSR7kpF6-syczOpQqkIZT2ceNCBZ8dS3pRQQhwBawSAXcYwfbs7cLQWiYuwXFl6nbWIACswTjF_o40urY2yIx9sxRI7IJ91qTs-AF2sm-4yEfDlNSA6DO4yPkrUJx-NfW5l5Teh-5v_PKuUjxMM0a7-NGXfoTsWdEo_O1JtK51aOfDHBRCJtI4W-xB1Ds/s16000/Tutorial%20on%20How%20to%20Create%20a%20Swipe%20Action%20on%20a%20List%20in%20Flutter.png&quot; title=&quot;Tutorial on How to Create a Swipe Action on a List in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a swipe action on a list in Flutter or when sliding a row to the
  left displays an action. Are you curious? Come on, follow the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;Swipe Action?&lt;/h1&gt;
&lt;p&gt;
  Swipe Action or Swipe Gesture is the user&#39;s action of swiping right or left on
  elements such as cards or lists to activate certain actions. Usually this
  function is used to delete certain data, mark it as favorite data or other
  actions.
&lt;/p&gt;
&lt;p&gt;
  In our tutorial this time, we will create a simple application. Where this
  application will display a list of user data. If you slide it to the left,
  user data will be lost. Please scroll to the bottom of this article to see the
  final results.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Create a Swipe Action with Dismissible in Flutter
&lt;/h1&gt;
&lt;div&gt;
  1. Create a new flutter project with a free name. Use the latest flutter
  version or the version that supports null safety. For flutter I use flutter
  version 2.10 with sdk: &quot;&amp;gt;=2.16.2 &amp;lt;3.0.0&quot;
&lt;/div&gt;
&lt;div&gt;
  &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;b&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;text-align: center;&quot;&gt;
            &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEizXzuDKSrsE56r46d3TMxR5A55Lp34_UZ7Pq3lppHgle5QcDROoP_Xny-8Wb-nq0Eutr_w_sA6CoT9DfO8PYu4WpoXOAfCemg8CiRy1bbdvNCGJyvKg8QMRnUdc-Vx43pgzHWuwkQlWnJuhbXSQsVrs7QLapQ6tlYdwLJL4uL_4eY1v6XAf7wmraWC6JB6&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;346&quot; data-original-width=&quot;625&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEizXzuDKSrsE56r46d3TMxR5A55Lp34_UZ7Pq3lppHgle5QcDROoP_Xny-8Wb-nq0Eutr_w_sA6CoT9DfO8PYu4WpoXOAfCemg8CiRy1bbdvNCGJyvKg8QMRnUdc-Vx43pgzHWuwkQlWnJuhbXSQsVrs7QLapQ6tlYdwLJL4uL_4eY1v6XAf7wmraWC6JB6=s16000&quot; /&gt;&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
            Flutter Version I Use
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;br /&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Open the lib/main.dart file then replace it with the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;

  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;WordPress&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
          primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
        ),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;(),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;({&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;? key}) : &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;(key: key);
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;&amp;gt; createState() =&amp;gt; _ListUsersState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_ListUsersState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;ListUsers&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//membuat list data user&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt;, dynamic&amp;gt;&amp;gt; userList = [
      {
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;i&lt;/span&gt;d&#39;: &#39;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;nam&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Terry&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Medhurst&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;emai&lt;/span&gt;l&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;terry&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@sohu&lt;/span&gt;.com&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;imag&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//robohash.org/hicveldicta.png&#39;,&lt;/span&gt;
      },
      {
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;i&lt;/span&gt;d&#39;: &#39;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;nam&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Sheldon&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Quigley&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;emai&lt;/span&gt;l&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;sheldon&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@sohu&lt;/span&gt;.com&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;imag&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//robohash.org/doloremquesintcorrupti.png&#39;,&lt;/span&gt;
      },
      {
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;i&lt;/span&gt;d&#39;: &#39;&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;nam&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Terrill&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Hills&lt;/span&gt;&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;emai&lt;/span&gt;l&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;terrill&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@sohu&lt;/span&gt;.com&#39;,
        &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;imag&lt;/span&gt;e&#39;: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//robohash.org/consequunturautconsequatur.png&#39;,&lt;/span&gt;
      },
    ];
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Swipe&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Action&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
          itemCount: userList.length,
          itemBuilder: (_, index) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; user = userList[index];
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; userId = user[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;i&lt;/span&gt;d&#39;];
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Dismissible&lt;/span&gt;(
              key: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;(userId),
              background: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.red,
                alignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Alignment&lt;/span&gt;.centerRight,
                padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.symmetric(horizontal: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16.0&lt;/span&gt;),
                child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.delete,
                  color: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.white,
                ),
              ),
              onDismissed: (direction) {
                setState(() {
                  userList.removeAt(index);
                });
                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ScaffoldMessenger&lt;/span&gt;.of(context).showSnackBar(
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SnackBar&lt;/span&gt;(content: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;User&lt;/span&gt; $userId dismissed&#39;)),
                );
              },
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(
                  bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                ),
                title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(user[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;nam&lt;/span&gt;e&#39;]),
                subtitle: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                  crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                  children: [
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Email&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Address&lt;/span&gt;: &#39; + user[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;emai&lt;/span&gt;l&#39;]),
                  ],
                ),
                leading: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                  user[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;imag&lt;/span&gt;e&#39;],
                  fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                  width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                  height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                ),
              ),
            );
          },
        ),
      );
    }
  }&lt;/pre&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;b&gt;Explanation of the script above:&lt;/b&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ol style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        import &#39;package:flutter/material.dart&#39;;: Imports the
        flutter/material.dart package required to build a Flutter application
        using Material Design.
      &lt;/li&gt;
      &lt;li&gt;void main(): The main function of the Flutter application.&lt;/li&gt;
      &lt;li&gt;
        runApp(MyApp());: Starts the application by running the MyApp() widget
        as the root widget.
      &lt;/li&gt;
      &lt;li&gt;
        class MyApp extends StatelessWidget {: Defines the MyApp class as an
        instance of StatelessWidget.
      &lt;/li&gt;
      &lt;li&gt;
        @override: Annotation indicating that the next method is an override of
        a method from the superclass.
      &lt;/li&gt;
      &lt;li&gt;
        Widget build(BuildContext context) {: Build method that describes the
        appearance of the MyApp widget.
      &lt;/li&gt;
      &lt;li&gt;
        return MaterialApp(...): Returns the MaterialApp widget, which is the
        root widget of the application with the specified configuration and
        theme.
      &lt;/li&gt;
      &lt;li&gt;title: &#39;WordPress News&#39;,: Application title.&lt;/li&gt;
      &lt;li&gt;
        theme: ThemeData(...),: Application theme that uses a blue
        primarySwatch.
      &lt;/li&gt;
      &lt;li&gt;home: ListUsers(),: Set ListUsers as the application&#39;s home page.&lt;/li&gt;
      &lt;li&gt;
        class ListUsers extends StatefulWidget {: Defines the ListUsers class as
        an instance of StatefulWidget.
      &lt;/li&gt;
      &lt;li&gt;
        const ListUsers({Key? key}) : super(key: key);: Constructor for the
        ListUsers class, accepting optional keys.
      &lt;/li&gt;
      &lt;li&gt;
        @override: Annotation indicating that the next method is an override of
        a method from the superclass.
      &lt;/li&gt;
      &lt;li&gt;
        State&amp;lt;ListUsers&amp;gt; createState() =&amp;gt; _ListUsersState();: Overrides
        the createState method which returns an instance of _ListUsersState,
        which is the state for the ListUsers widget.
      &lt;/li&gt;
      &lt;li&gt;
        class _ListUsersState extends State&amp;lt;ListUsers&amp;gt; {: Defines the
        class _ListUsersState as an instance of State that holds the state for
        the ListUsers widget.
      &lt;/li&gt;
      &lt;li&gt;
        List&amp;lt;Map&amp;lt;String, dynamic&amp;gt;&amp;gt; userList = [...];: Defines a
        userList list that contains several user data maps.
      &lt;/li&gt;
      &lt;li&gt;
        @override: Annotation indicating that the next method is an override of
        a method from the superclass.
      &lt;/li&gt;
      &lt;li&gt;
        Widget build(BuildContext context) {: Build method that describes the
        appearance of the _ListUsersState widget.
      &lt;/li&gt;
      &lt;li&gt;
        return Scaffold(...): Returns the Scaffold widget that provides the
        basic framework for the application page.
      &lt;/li&gt;
      &lt;li&gt;
        appBar: AppBar(...): Sets the AppBar widget as the app bar at the top of
        the page.
      &lt;/li&gt;
      &lt;li&gt;
        body: ListView.builder(...): Sets the ListView.builder widget as the
        page body to display the user&#39;s list of items.
      &lt;/li&gt;
      &lt;li&gt;
        final user = userList[index];: Retrieves user data at a specified index
        from userList.
      &lt;/li&gt;
      &lt;li&gt;
        final userId = user[&#39;id&#39;];: Retrieves the &#39;id&#39; value from the current
        user data.
      &lt;/li&gt;
      &lt;li&gt;
        return Dismissible(...): Returns a Dismissible widget that implements
        the swipe action on the user list element.
      &lt;/li&gt;
      &lt;li&gt;
        background: Container(...): Sets the appearance of the background when
        the element is shifted towards the right.
      &lt;/li&gt;
      &lt;li&gt;
        onDismissed: (direction) {...},: Determines the action performed when an
        element is shifted and released.
      &lt;/li&gt;
      &lt;li&gt;
        child: ListTile(...): Returns a ListTile widget that displays user
        information such as name, email, and profile picture.
      &lt;/li&gt;
      &lt;li&gt;
        leading: Image.network(...): Displays the user&#39;s profile image as the
        leading widget in the ListTile.
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;
  3. Run the application, if successful then the display will look like the
  image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0YWWN6XCW4UGM6Nn897NajEmKGldNY-0gG3xH6ITHV9myLHMrad3OCllR3Lugk9LuER7rEuxtnUNA_LpiTpa7N5nEQW9V9uNfaoqRmTcWAlNLMMFwlPqQsER1LmPofsPTMV34UfhczC9nKMq_TOSMVRDg57vmZnh8K3lB8ATHs9-H5g_iWPqOsQvhd5DZ/s700/Screenshot_2023-07-10-09-33-27-37_be7e294ab61c3c780a3e2e885a66442e.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0YWWN6XCW4UGM6Nn897NajEmKGldNY-0gG3xH6ITHV9myLHMrad3OCllR3Lugk9LuER7rEuxtnUNA_LpiTpa7N5nEQW9V9uNfaoqRmTcWAlNLMMFwlPqQsER1LmPofsPTMV34UfhczC9nKMq_TOSMVRDg57vmZnh8K3lB8ATHs9-H5g_iWPqOsQvhd5DZ/s16000/Screenshot_2023-07-10-09-33-27-37_be7e294ab61c3c780a3e2e885a66442e.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  It&#39;s easy isn&#39;t it?, you can now create swipe actions in Flutter easily and
  quickly. You can also improvise by adding other actions. Give actions to api
  data, combine them with swipe refresh or refresh indicator and so on.
&lt;/p&gt;
&lt;p&gt;
  That&#39;s it for our short tutorial today on how to create a swipe action on a
  list in Flutter. Hopefully this short tutorial is useful. If you have any
  questions, please ask directly in the comments column below. That&#39;s all and
  receive a salary.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/tutorial-on-how-to-create-swipe-action.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSR7kpF6-syczOpQqkIZT2ceNCBZ8dS3pRQQhwBawSAXcYwfbs7cLQWiYuwXFl6nbWIACswTjF_o40urY2yIx9sxRI7IJ91qTs-AF2sm-4yEfDlNSA6DO4yPkrUJx-NfW5l5Teh-5v_PKuUjxMM0a7-NGXfoTsWdEo_O1JtK51aOfDHBRCJtI4W-xB1Ds/s72-c/Tutorial%20on%20How%20to%20Create%20a%20Swipe%20Action%20on%20a%20List%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-8306710344475235346</guid><pubDate>Sun, 24 Dec 2023 01:18:00 +0000</pubDate><atom:updated>2023-12-23T17:18:04.408-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating Swipe Refresh or Refresh Indicator in Flutter and Data API</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK17I8czqSmroKlwwiJLdJ9U-F9om-j3eHgAPVSgrD1yDtkfmirDWitvmBLY-P6KFYjdMKIAoWsXf_OQDVVNM0nPTuGVZzCjA4yi6u1OHKpm3vFcYnL2edP2gIfy704GERUMQEFCtqk19Zf4BwOVIqPxm68KOcnThc61UhwrZdIiMO2bkIKN3tPF2aMEE/s1500/Creating%20Swipe%20Refresh%20or%20Refresh%20Indicator%20in%20Flutter%20and%20Data%20API.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating Swipe Refresh or Refresh Indicator in Flutter and Data API&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK17I8czqSmroKlwwiJLdJ9U-F9om-j3eHgAPVSgrD1yDtkfmirDWitvmBLY-P6KFYjdMKIAoWsXf_OQDVVNM0nPTuGVZzCjA4yi6u1OHKpm3vFcYnL2edP2gIfy704GERUMQEFCtqk19Zf4BwOVIqPxm68KOcnThc61UhwrZdIiMO2bkIKN3tPF2aMEE/s16000/Creating%20Swipe%20Refresh%20or%20Refresh%20Indicator%20in%20Flutter%20and%20Data%20API.png&quot; title=&quot;Creating Swipe Refresh or Refresh Indicator in Flutter and Data API&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to add a refresh indicator to a list in Flutter. Are you curious? Come on,
  follow the tutorial below.
&lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Swipe refresh, or refresh indicator, is a widget provided by Flutter to
  refresh or reset the page to get a new status. This status can be a change in
  data. The way to update data with the refresh indicator is by pulling down or
  swiping down on the smartphone screen.
&lt;/p&gt;
&lt;p&gt;
  So in this tutorial, we will learn how to create a refresh indicator and
  create a list view of user data that comes from dummy.json/users. Please
  scroll to the bottom of this article to see the final results.
&lt;/p&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Create a Swipe Refresh or Refresh Indicator in Flutter and Data API
&lt;/h1&gt;
&lt;div&gt;
  1. Create a new flutter project with a free name. Use the latest version of
  flutter or the null safety version of flutter. For flutter I use flutter
  version 2.10 with sdk: &quot;&amp;gt;=2.16.2 &amp;lt;3.0.0&quot;
&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Open pubspec.yaml then add the http: follow the example as shown in the
  image below and don&#39;t forget to save the file to download the package.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjfW-kPAEFsK2xzELhF5aI0J6mXohHCiq0nqG2Y49aPYvnmAuHdTWmgSIEKMGi--YXY2_JXT-LUVYqfpdtpPKiDnfMKKx8QIhjjg5MnLd65GzzrVcMQdqU7c63yij0ywpzFHJ_eO7iBZA5qibuQZUQi-YeSPQ3g7ALAnhZeFL3P-c91N7zAj7cCb4TQz6xC&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Refresh Indicator Sahretech&quot; data-original-height=&quot;390&quot; data-original-width=&quot;610&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjfW-kPAEFsK2xzELhF5aI0J6mXohHCiq0nqG2Y49aPYvnmAuHdTWmgSIEKMGi--YXY2_JXT-LUVYqfpdtpPKiDnfMKKx8QIhjjg5MnLd65GzzrVcMQdqU7c63yij0ywpzFHJ_eO7iBZA5qibuQZUQi-YeSPQ3g7ALAnhZeFL3P-c91N7zAj7cCb4TQz6xC=s16000&quot; title=&quot;Flutter Refresh Indicator Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Create a new file in the lib folder with the name api_service.dart, follow
  the script as in the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ApiService&lt;/span&gt; &lt;/span&gt;{
  
    Future&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;&amp;gt; fetchNews() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://dummyjson.com/users&#39;&lt;/span&gt;));
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; jsonResponse = jsonDecode(response.body)[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;users&#39;&lt;/span&gt;];

        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; jsonResponse.toList();

      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {

        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to load news&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. Create a new file in the lib folder with the name list_users.dart following
  the script as below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;api_service&lt;/span&gt;.dart&#39;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;({&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Key&lt;/span&gt;? key}) : &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;(key: key);
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;&amp;gt; createState() =&amp;gt; _ListUsersState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_ListUsersState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;ListUsers&amp;gt;&lt;/span&gt; &lt;/span&gt;{
  
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;void&amp;gt; _refreshNews() async {
      setState(() {
        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ApiService&lt;/span&gt;().fetchNews();
      });
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Flutter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Swipe&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Refresh&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;RefreshIndicator&lt;/span&gt;(
            onRefresh: _refreshNews,
            child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;dynamic&amp;gt;&amp;gt;(
              future: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ApiService&lt;/span&gt;().fetchNews(),
              builder: (_, snapshot) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
                  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// While data is being fetched, show a loading indicator&lt;/span&gt;
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;();
                } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// If there&#39;s an error in fetching data, show an error message&lt;/span&gt;
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;);
                } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// If data is available, display it in a list&lt;/span&gt;
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; newsList = snapshot.data!;
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                    padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(
                      top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                    ),
                    itemCount: newsList.length,
                    itemBuilder: (_, index) {
                      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; news = newsList[index];
                      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                        contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(
                          bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                        ),
                        title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          news[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;firstNam&lt;/span&gt;e&#39;]+&#39; &#39;+news[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;lastNam&lt;/span&gt;e&#39;],
                        ),
                        subtitle: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                          crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                          children: [
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                              &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Phone&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Number&lt;/span&gt;: &#39;+news[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;phon&lt;/span&gt;e&#39;],
                            ),
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                              &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Email&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Address&lt;/span&gt;: &#39;+news[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;emai&lt;/span&gt;l&#39;],
                            ),
                          ],
                        ),
                        leading: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                          news[&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;imag&lt;/span&gt;e&#39;],
                          fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                          width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                          height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                        ),
                      );
                    },
                  );
                } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
                  &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// If no data is available, show a message&lt;/span&gt;
                  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;No&lt;/span&gt; data available&#39;);
                }
              },
            ),
          ),
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Explanation of the script above:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    _refreshNews() is a method that will be executed when the application is
    swiped down. The contents are simple, namely retrieving API data. You can
    improvise this by adding other processes.
  &lt;/li&gt;
  &lt;li&gt;
    child: RefreshIndicator( onRefresh: _refreshNews, ... ) this is a widget
    provided by flutter to refresh the page. We need to fill in what method to
    run inside onRefresh:
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  5. Open the lib/main.dart file then replace it with the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;list_users&lt;/span&gt;.dart&#39;;
  
    
    void main() {
      runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
    }
    
    &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
      &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;WordPress&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&#39;,
          theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
            primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
          ),
          home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListUsers&lt;/span&gt;(),
        );
      }
    }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  Now we can do a test run. Please run the emulator. If successful, the display
  will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT-YwVijIV2atyK0HE5X2bHSKggK6Nv_nJgCAX7YFk7YpElqYDpdgLcZt8bFTqcqkdjHK48E415AAyzm1JOmXsFJ231Biil7Svz9WqHQW9twws2zLKQEZFRQBjBFeNELiBmYCFFHmcTqYRa_ZTtOGMFMHUPGE3sTkBiEsYEUYGSHzoLp_gvk2-BCQZ9cWt/s700/Screenshot_2023-07-09-16-59-08-43_be7e294ab61c3c780a3e2e885a66442e.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Membuat Swipe Refresh atau Refresh Indicator di Flutter dan Data API&quot; border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT-YwVijIV2atyK0HE5X2bHSKggK6Nv_nJgCAX7YFk7YpElqYDpdgLcZt8bFTqcqkdjHK48E415AAyzm1JOmXsFJ231Biil7Svz9WqHQW9twws2zLKQEZFRQBjBFeNELiBmYCFFHmcTqYRa_ZTtOGMFMHUPGE3sTkBiEsYEUYGSHzoLp_gvk2-BCQZ9cWt/s16000/Screenshot_2023-07-09-16-59-08-43_be7e294ab61c3c780a3e2e885a66442e.jpg&quot; title=&quot;Membuat Swipe Refresh atau Refresh Indicator di Flutter dan Data API&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Easy isn&#39;t it?, now we can add a swipe refresh or refresh indicator to Flutter
  and combine it with API data. Now you can improvise by adding another widget
  or other fire data to make it more powerful.
&lt;/p&gt;
&lt;p&gt;
  That&#39;s it for our tutorial this time on how to make a swipe refresh in Flutter
  with API data. Hopefully this short article is useful. If you have any
  questions, please ask directly in the comments column below. That&#39;s all and
  receive a salary.
&lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-swipe-refresh-or-refresh.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK17I8czqSmroKlwwiJLdJ9U-F9om-j3eHgAPVSgrD1yDtkfmirDWitvmBLY-P6KFYjdMKIAoWsXf_OQDVVNM0nPTuGVZzCjA4yi6u1OHKpm3vFcYnL2edP2gIfy704GERUMQEFCtqk19Zf4BwOVIqPxm68KOcnThc61UhwrZdIiMO2bkIKN3tPF2aMEE/s72-c/Creating%20Swipe%20Refresh%20or%20Refresh%20Indicator%20in%20Flutter%20and%20Data%20API.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-8839698910011781682</guid><pubDate>Sun, 24 Dec 2023 00:42:00 +0000</pubDate><atom:updated>2023-12-31T04:13:12.914-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Displaying Popular Youtube Videos in Flutter App with Youtube API</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ5UNBUymfd0g5Lpy-txtKOOx-wyw0a1iP2X_L0-m04dyMfI52r-ezbuxuk1wSkHbcTOi_0qMOORxzK02psz11z0mcxan-jhGT3IJsLltfotLJBPpM30_E6Ikdx7SYZTOc1DR0PHsYbqa99KIj8kb67Mg4QuIO4Uu58Hfttkb-Zi9jCYAXVisGeu2hLcA/s1500/Displaying%20Popular%20Youtube%20Videos%20in%20Flutter%20App%20with%20Youtube%20API.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Displaying Popular Youtube Videos in Flutter App with Youtube API&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ5UNBUymfd0g5Lpy-txtKOOx-wyw0a1iP2X_L0-m04dyMfI52r-ezbuxuk1wSkHbcTOi_0qMOORxzK02psz11z0mcxan-jhGT3IJsLltfotLJBPpM30_E6Ikdx7SYZTOc1DR0PHsYbqa99KIj8kb67Mg4QuIO4Uu58Hfttkb-Zi9jCYAXVisGeu2hLcA/s16000/Displaying%20Popular%20Youtube%20Videos%20in%20Flutter%20App%20with%20Youtube%20API.png&quot; title=&quot;Displaying Popular Youtube Videos in Flutter App with Youtube API&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back again at porkaone. On this occasion we will learn
  how to display popular YouTube videos with the YouTube API in the Flutter
  application. Are you curious? Come on, follow the details below.
&lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Previously I made a tutorial on how to display YouTube videos with YouTube API
  in Flutter. Here is the link to the article&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-from.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-from.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
  The difference with this tutorial is that we will show popular YouTube videos
  but still use the YouTube API. Apart from that, we will also display the total
  likes and total views. So we will also modify the model and appearance. Scroll
  to the bottom of this article to see the final results.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  Displaying Popular Youtube Videos in Flutter App with Youtube API
&lt;/h1&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  1. First and foremost, you must have a YouTube API key first. If you don&#39;t
  have it, please follow the following tutorial
  &lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-get-youtube-api-key.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/how-to-get-youtube-api-key.html&lt;/a&gt;
&lt;/p&gt;
&lt;div&gt;
  2. Create a new file with the name you want. The flutter used is the null
  safety version. &lt;b&gt;sdk: &quot;&amp;gt;=2.16.2 &amp;lt;3.0.0&quot;&lt;/b&gt;. A slightly lower or
  slightly higher version difference doesn&#39;t matter.
&lt;/div&gt;
&lt;p&gt;
  3. Open p&lt;b&gt;ubspec.yaml&lt;/b&gt;. Then add &lt;b&gt;http: ^0.13.5&lt;/b&gt; and
  &lt;b&gt;youtube_player_flutter: ^8.0.0&lt;/b&gt;, follow the example as shown below.
&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAT2jdjbt3ejNQzWiebWxUU44IpJfvsLsnyGXDvG_tFXFlP3OlhnO1YvfvZu-TFe5KVjtQvVowM0tlXeWwKgBFAqTQd7D9DjW109xZKlWE7OHhf9ceNQbGAB9s4EmCYOyz0at_GbuTXovIdfIowsShkhHJdM4XzoRlZP2fopS2BsBL7cJk8bDR84oGzSuY/s531/pubspec.yaml.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;531&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAT2jdjbt3ejNQzWiebWxUU44IpJfvsLsnyGXDvG_tFXFlP3OlhnO1YvfvZu-TFe5KVjtQvVowM0tlXeWwKgBFAqTQd7D9DjW109xZKlWE7OHhf9ceNQbGAB9s4EmCYOyz0at_GbuTXovIdfIowsShkhHJdM4XzoRlZP2fopS2BsBL7cJk8bDR84oGzSuY/s16000/pubspec.yaml.png&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  4. Create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
  &lt;b&gt;video_model.dart&lt;/b&gt; then follow the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; id;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; thumbnail;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; channelTitle;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; viewCount;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; likeCount;

  Video({
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.id,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.thumbnail,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.channelTitle,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.viewCount,
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.likeCount,
  });

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;factory&lt;/span&gt; Video.fromJson(&lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; json) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Video(
      id: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;id&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      title: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      thumbnail: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;thumbnails&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;high&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;url&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      channelTitle: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;channelTitle&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      viewCount: &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;.tryParse(json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;statistics&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;viewCount&#39;&lt;/span&gt;]) ?? &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;, 
      likeCount: &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;.tryParse(json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;statistics&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;likeCount&#39;&lt;/span&gt;]) ?? &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;, 
    );
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  5. Create a new file in the lib folder with the name
  &lt;b&gt;youtube_api.dart&lt;/b&gt; then follow the script below. Don&#39;t forget to replace
  &lt;b&gt;key=YOUR_KEY&lt;/b&gt; with the YouTube API key that you have.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;video_model.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApi&lt;/span&gt; &lt;/span&gt;{
    Future&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;Video&amp;gt;&amp;gt; getVideos() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; url = &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://www.googleapis.com/youtube/v3/videos&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;?part=snippet&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;part=statistics&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;chart=mostPopular&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;maxResults=10&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;type=video&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;key=YOUR_KEY&#39;&lt;/span&gt;;
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(url));
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; jsonData = json.decode(response.body);
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videoList = jsonData[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;items&#39;&lt;/span&gt;] &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;;
  
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; videoList.map((item) =&amp;gt; Video.fromJson(item)).toList();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to load videos&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  5. Create a new file in the lib folder with the name &lt;b&gt;detail.dart&lt;/b&gt; then
  follow the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt; &lt;br /&gt;&lt;br /&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:youtube_player_flutter/youtube_player_flutter.dart&#39;;
  
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;video_model&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;youtube_api&lt;/span&gt;.dart&#39;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; videoId;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; title;
  
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;({
      required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.videoId,
      required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
    });
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;&amp;gt; createState() =&amp;gt; _DetailState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_DetailState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;Detail&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    late &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerController&lt;/span&gt; _controller;
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    void initState() {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.initState();
      _controller = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerController&lt;/span&gt;(
        initialVideoId: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayer&lt;/span&gt;.convertUrlToId(
            &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//www.youtube.com/watch?v=&#39; + widget.videoId)!,&lt;/span&gt;
        flags: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerFlags&lt;/span&gt;(
          autoPlay: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
          mute: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
        ),
      );
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Video&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;(
          children: [
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayer&lt;/span&gt;(
              controller: _controller,
              showVideoProgressIndicator: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
              progressIndicatorColor: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blueAccent,
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
              padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.start,
                crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                children: [
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                    mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.spaceBetween,
                    children: [
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;35&lt;/span&gt;,
                        height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;35&lt;/span&gt;,
                        decoration: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                          borderRadius: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BorderRadius&lt;/span&gt;.all(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Radius&lt;/span&gt;.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
                          image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DecorationImage&lt;/span&gt;(
                            fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                            image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NetworkImage&lt;/span&gt;(
                              &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;,&lt;/span&gt;
                            ),
                          ),
                        ),
                      ),
                      const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          widget.title,
                          style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                              fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;18&lt;/span&gt;, fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.w400),
                          maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                          overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                        ),
                      ),
                    ],
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                    &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;See&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Other&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Videos&lt;/span&gt;&#39;,
                    style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;18&lt;/span&gt;, fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.w500),
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;,
                  ),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt;&amp;gt;&amp;gt;(
                    future: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApi&lt;/span&gt;().getVideos(),
                    builder: (context, snapshot) {
                      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videos = snapshot.data!;
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                          padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.zero,
                          shrinkWrap: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
                          physics: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NeverScrollableScrollPhysics&lt;/span&gt;(),
                          itemCount: videos.length,
                          itemBuilder: (context, index) {
                            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; video = videos[index];
                            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                              crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                              mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.start,
                              children: [
                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
                                  onTap: () =&amp;gt; {
                                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                                      context,
                                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                                        builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                                          videoId: video.id,
                                          title: video.title,
                                        ),
                                      ),
                                    )
                                  },
                                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                                    contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.zero,
                                    leading: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                                      video.thumbnail,
                                      fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                                      width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
                                    ),
                                    title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                      video.title,
                                      maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                      overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                    ),
                                  ),
                                ),
                                const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                                  height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                ),
                              ],
                            );
                          },
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;),
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Failed&lt;/span&gt; to load videos&#39;),
                        );
                      }
                    },
                  ),
                ],
              ),
            )
          ],
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;6. Open &lt;b&gt;lib/main.dart&lt;/b&gt; then follow the script below.&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;detail&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;video_model&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;youtube_api&lt;/span&gt;.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;&amp;gt; createState() =&amp;gt; _MyAppState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_MyAppState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;MyApp&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; formatNumber(dynamic number) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (number &amp;gt;= &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1000000&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; (number ~/ &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1000000&lt;/span&gt;).toString() + &#39; jt&#39;;
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (number &amp;gt;= &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1000&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; (number ~/ &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1000&lt;/span&gt;).toString() + &#39; rb&#39;;
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; number.toString();
      }
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
          appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
            title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;YouTube&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Videos&lt;/span&gt;&#39;),
          ),
          body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt;&amp;gt;&amp;gt;(
            future: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApi&lt;/span&gt;().getVideos(),
            builder: (context, snapshot) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videos = snapshot.data!;
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                  itemCount: videos.length,
                  itemBuilder: (context, index) {
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; video = videos[index];
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
                      onTap: () {
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                          context,
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                            builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                              videoId: video.id,
                              title: video.title,
                            ),
                          ),
                        );
                      },
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                          crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                          children: [
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                              video.thumbnail,
                              width: double.infinity,
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;160&lt;/span&gt;,
                              fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                            ),
                            const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                            ),
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                              padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
                              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                                mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.spaceBetween,
                                children: [
                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                                    width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
                                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
                                    decoration: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                                      borderRadius:
                                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BorderRadius&lt;/span&gt;.all(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Radius&lt;/span&gt;.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
                                      image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DecorationImage&lt;/span&gt;(
                                        fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                                        image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NetworkImage&lt;/span&gt;(
                                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;,&lt;/span&gt;
                                        ),
                                      ),
                                    ),
                                  ),
                                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                                    width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                                  ),
                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                                      crossAxisAlignment:
                                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                                      children: [
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                          video.title,
                                          style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                                          ),
                                          maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                          overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                        ),
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                                          height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                                        ),
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                                          mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.spaceBetween,
                                          children: [
                                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                              video.channelTitle,
                                              style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                                fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;,
                                              ),
                                              maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                              overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                            ),
                                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                                              children: [
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.thumb_up,
                                                  size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;14&lt;/span&gt;,
                                                ),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                                  formatNumber(video.likeCount),
                                                  style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                                    fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;,
                                                  ),
                                                ),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.remove_red_eye,
                                                  size: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;14&lt;/span&gt;,
                                                ),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                                  formatNumber(video.viewCount),
                                                  style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                                    fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;,
                                                  ),
                                                ),
                                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,)
                                              ],
                                            )
                                          ],
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                            )
                          ],
                        ),
                      ),
                    );
                  },
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;),
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Failed&lt;/span&gt; to load videos&#39;),
                );
              }
            },
          ),
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  If we have done all the steps, it&#39;s time to do a trial. Please run the
  emulator, if successful then the display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmbyG5ajeKqeVrCg3ajz4li5-8KCDzLQ2rZL79i-j3vysshbsJiDbCw8vkrqx0pE6si2i3TI4P3Nxz_cnqmIPrv2TUiQNri70sqQGy2rnCbbTsPoV9b2dvHkH2xXfK9YBnWsc8H6YoU4ZB9eX6j02ux9TqCyGO1aqIPxOa5_JH3SVSyxpqwlfXtBgs2hxR/s500/Screenshot_2023-07-09-10-14-49-84_28b912ef1e3b8dc60e28922123c2965e.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;sahretech&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmbyG5ajeKqeVrCg3ajz4li5-8KCDzLQ2rZL79i-j3vysshbsJiDbCw8vkrqx0pE6si2i3TI4P3Nxz_cnqmIPrv2TUiQNri70sqQGy2rnCbbTsPoV9b2dvHkH2xXfK9YBnWsc8H6YoU4ZB9eX6j02ux9TqCyGO1aqIPxOa5_JH3SVSyxpqwlfXtBgs2hxR/s16000/Screenshot_2023-07-09-10-14-49-84_28b912ef1e3b8dc60e28922123c2965e.jpg&quot; title=&quot;sahretech&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp5oGZXXAKNmxNoVrkf7pTe4WhD8Egmo9MpFFts5bbqaj_w1GWJg1f7i2KR2EY4ijHfCO374yJrGd_6XBfiToVCdDDwlWD4Hu3-x_1W9yctt0rvGBBTywbIDHhoy4AunkB96x6xRap5i17WuorZobxYlMbVr2BKgs3JmRm6XzvipyhhTvZojcVHFYPphra/s500/Screenshot_2023-07-09-10-59-13-65_1e9a28dd673e5c678b41cf43a99b4dad.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;sahretech&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp5oGZXXAKNmxNoVrkf7pTe4WhD8Egmo9MpFFts5bbqaj_w1GWJg1f7i2KR2EY4ijHfCO374yJrGd_6XBfiToVCdDDwlWD4Hu3-x_1W9yctt0rvGBBTywbIDHhoy4AunkB96x6xRap5i17WuorZobxYlMbVr2BKgs3JmRm6XzvipyhhTvZojcVHFYPphra/s16000/Screenshot_2023-07-09-10-59-13-65_1e9a28dd673e5c678b41cf43a99b4dad.jpg&quot; title=&quot;sahretech&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  It&#39;s easy, isn&#39;t it?, now you can display data from YouTube and process it
  into the various application needs that you have. You can improvise by adding
  searches or displaying videos in certain categories.
&lt;/p&gt;
&lt;p&gt;
  OK, that&#39;s it for this tutorial on how to display popular YouTube videos in
  the Flutter application with YouTube Api. Hopefully this short tutorial is
  useful, if there are problems, please report them directly in the comments
  column below. That&#39;s all and receive a salary.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/displaying-popular-youtube-videos-in-app.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ5UNBUymfd0g5Lpy-txtKOOx-wyw0a1iP2X_L0-m04dyMfI52r-ezbuxuk1wSkHbcTOi_0qMOORxzK02psz11z0mcxan-jhGT3IJsLltfotLJBPpM30_E6Ikdx7SYZTOc1DR0PHsYbqa99KIj8kb67Mg4QuIO4Uu58Hfttkb-Zi9jCYAXVisGeu2hLcA/s72-c/Displaying%20Popular%20Youtube%20Videos%20in%20Flutter%20App%20with%20Youtube%20API.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-6584538345966439839</guid><pubDate>Sat, 23 Dec 2023 23:37:00 +0000</pubDate><atom:updated>2023-12-23T15:37:01.790-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating a News Application from Blogger API in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTKwXB14PNogTCCVroRjKZIWj54obvGK9-nZfTBOTRbkZTaKxSwEzxChSsEjs0ZqkoQTt_BUANM2D57MQIGLFYNnXgyVtPcwERYdPS1av47a7vn_zTI3-tfDF4uMm75T44WQFrK2GdEVFL8ADduNNIdpvgzXVmAU_Rf9E9EI8CwutAdn4y_gzamRBMU3Y/s1500/Creating%20a%20News%20Application%20from%20Blogger%20API%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating a News Application from Blogger API in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTKwXB14PNogTCCVroRjKZIWj54obvGK9-nZfTBOTRbkZTaKxSwEzxChSsEjs0ZqkoQTt_BUANM2D57MQIGLFYNnXgyVtPcwERYdPS1av47a7vn_zTI3-tfDF4uMm75T44WQFrK2GdEVFL8ADduNNIdpvgzXVmAU_Rf9E9EI8CwutAdn4y_gzamRBMU3Y/s16000/Creating%20a%20News%20Application%20from%20Blogger%20API%20in%20Flutter.png&quot; title=&quot;Creating a News Application from Blogger API in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Halo semuanya, kembali lagi di sahretech. Pada kesempatan kali ini kita akan
  belajar cara menampilkan postingan blogger di aplikasi flutter. Penasaran?,
  ayo ikuti tutorialnya di bawah ini.
&lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Just like WordPress, Blogger also provides APIs that we can use for various
  application needs. Unlike WordPress, Blogger requires authentication to be
  able to access its API data. But it doesn&#39;t matter, because I have prepared a
  tutorial reference on how to get the api key below.
&lt;/p&gt;
&lt;p&gt;
  Previously, I also wrote a tutorial on how to consume WordPress API in
  Flutter, very easily and quickly. Follow the link below
  &lt;a href=&quot;https://www.porkaone.com/2023/12/creating-news-application-with.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/creating-news-application-with.html&lt;/a&gt;. For those of you who don&#39;t have blogger or WordPress, just follow the
  tutorial material I wrote. So you can still learn even though you don&#39;t have
  one yet.
&lt;/p&gt;
&lt;p&gt;
  Apart from displaying Blogger API data. We will also use a webview to display
  all the data. Please scroll to the bottom of this article to see the final
  results.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Create a News Application from the Blogger API in Flutter
&lt;/h1&gt;
&lt;p&gt;
  1. First, you must have an API key by registering at
  &lt;a href=&quot;https://console.cloud.google.com&quot; target=&quot;_blank&quot;&gt;https://console.cloud.google.com&lt;/a&gt;. You can watch a tutorial on how to get an API key at the following link
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;300&quot; src=&quot;https://www.youtube.com/embed/KrWc7ukoSns&quot; width=&quot;100%&quot; youtube-src-id=&quot;KrWc7ukoSns&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  2. Ok, next create a new flutter project with the name you want. Use the
  latest version of flutter.
&lt;/p&gt;
&lt;p&gt;
  3. Open the &lt;b&gt;pubspec.yaml&lt;/b&gt; file then add &lt;b&gt;http:&lt;/b&gt; and
  &lt;b&gt;webview_flutter:&lt;/b&gt; follow the example as shown in the image below, and
  don&#39;t forget to save the file to download the package.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNenGFyip5GtF7AjD5JNLkScz3uggl4wj1kKt7oc0EI33A9IOG_b3kDYRu3Hzqq8EY1RzMYjr_JNk0KoSg4A8mg-tH1R7S3AFPtVujU34FgE0i9Balg01wXnuP14dL9THhSP6H7dh_sdVNBtBI18k6etE6rzY4flzPK7FORDhwpeWrpNCm2wcW0S6DZcjL&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Blogger API&quot; data-original-height=&quot;364&quot; data-original-width=&quot;580&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNenGFyip5GtF7AjD5JNLkScz3uggl4wj1kKt7oc0EI33A9IOG_b3kDYRu3Hzqq8EY1RzMYjr_JNk0KoSg4A8mg-tH1R7S3AFPtVujU34FgE0i9Balg01wXnuP14dL9THhSP6H7dh_sdVNBtBI18k6etE6rzY4flzPK7FORDhwpeWrpNCm2wcW0S6DZcjL=s16000&quot; title=&quot;Blogger API&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Download Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  4. Create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
  &lt;b&gt;blog_model.dart&lt;/b&gt;. Follow the script as below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Blog&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; content;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; url; 

  Blog({
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, 
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content, 
    required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.url
  });

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;factory&lt;/span&gt; Blog.fromJson(&lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; json) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Blog(
      title: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;],
      content: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;content&#39;&lt;/span&gt;],
      url: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;url&#39;&lt;/span&gt;]
    );
  }
}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  5. Buat sebuah file baru di dalam folder &lt;b&gt;lib&lt;/b&gt; dengan nama
  &lt;b&gt;blogger_api.dart&lt;/b&gt;. Ikuti scriptnya di bawah ini.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;blog_model.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;WordPressAPI&lt;/span&gt; &lt;/span&gt;{
  
    Future&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;Blog&amp;gt;&amp;gt; fetchNews() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      
      &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//isi key dengan google api key kalian masing-masing&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://www.googleapis.com/blogger/v3/blogs/8111507943178419750/posts?key=&#39;&lt;/span&gt;));
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; jsonResponse = jsonDecode(response.body)[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;items&#39;&lt;/span&gt;];
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; jsonResponse.map((data) =&amp;gt; Blog.fromJson(data)).toList();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to load blog&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Important explanations to read:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    8111507943178419750 is the Blogger ID. You can use anyone&#39;s Blogger ID, if
    you don&#39;t have a blogger, just use my Blogger ID.
  &lt;/li&gt;
  &lt;li&gt;
    key= don&#39;t forget to fill it in with the Google API key that you got
    previously.
  &lt;/li&gt;
  &lt;li&gt;
    The other script doesn&#39;t have much explanation, because I&#39;ve discussed it in
    another article.
  &lt;/li&gt;
  &lt;li&gt;
    You can access the URL complete with the key directly in the browser. The
    results can be seen as below.
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
  &lt;li&gt;
    &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
      &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEii-6TvlKUT9p6hrvHlR6uyph5eWDViFtLN0E1UnYKzupAFdcYePM7F9Zpyu_-L8Q89XSNv5tOTbbvLa_tdqvU9uw8ujVYDn9vwpNR7_f3pAQbhit9Lbs3yqIsB1vkFJS8pEGmET3zkQ3xU_H-GlhV08g6WkvogdgefEYm2Q4P_gRmYxihFsNBiYnfrMwHL&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;660&quot; data-original-width=&quot;1050&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEii-6TvlKUT9p6hrvHlR6uyph5eWDViFtLN0E1UnYKzupAFdcYePM7F9Zpyu_-L8Q89XSNv5tOTbbvLa_tdqvU9uw8ujVYDn9vwpNR7_f3pAQbhit9Lbs3yqIsB1vkFJS8pEGmET3zkQ3xU_H-GlhV08g6WkvogdgefEYm2Q4P_gRmYxihFsNBiYnfrMwHL=s16000&quot; /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;br /&gt;
  &lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  6. Create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
  &lt;b&gt;detail.dart&lt;/b&gt;. Follow the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:webview_flutter/webview_flutter.dart&#39;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; url;
  
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;({required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.url});
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;&amp;gt; createState() =&amp;gt; _DetailState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_DetailState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;Detail&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
  
      &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//must use http, if you use https then the data cannot be displayed&lt;/span&gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; modifiedUrl =
          &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.widget.url.replaceFirst(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;http&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//&#39;, &#39;https://&#39;);&lt;/span&gt;
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; controller = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WebViewController&lt;/span&gt;()
        ..setJavaScriptMode(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;JavaScriptMode&lt;/span&gt;.unrestricted) &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//turn on javascript&lt;/span&gt;
        ..loadRequest(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Uri&lt;/span&gt;.parse(modifiedUrl)); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//load the destination url&lt;/span&gt;
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Detai&lt;/span&gt;l&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WebViewWidget&lt;/span&gt;(
          controller: controller,
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;7. Open &lt;b&gt;lib/main.dart&lt;/b&gt;. Replace with the script below.&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;blogger_api.dart&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;blog_model.dart&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;detail.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;{
    runApp(MyApp());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot;&gt;Widget &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(BuildContext context)&lt;/span&gt; &lt;/span&gt;{
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; MaterialApp(
        title: &#39;Blogger API News&#39;,
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: BlogScreen(),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;BlogScreen&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    _BlogScreenState createState() =&amp;gt; _BlogScreenState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_BlogScreenState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;BlogScreen&lt;/span&gt;&amp;gt; &lt;/span&gt;{
    late Future&amp;lt;List&amp;lt;Blog&amp;gt;&amp;gt; futureNews;
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;initState&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;{
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.initState();
      futureNews = WordPressAPI().fetchNews();
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot;&gt;Widget &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(BuildContext context)&lt;/span&gt; &lt;/span&gt;{
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Scaffold(
        appBar: AppBar(
          title: Text(&#39;WordPress News&#39;),
        ),
        body: Center(
          child: FutureBuilder&amp;lt;List&amp;lt;Blog&amp;gt;&amp;gt;(
            future: futureNews,
            builder: (context, snapshot) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; ListView.&lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;builder&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(
                  itemCount: snapshot.data!.length,
                  itemBuilder: (context, index)&lt;/span&gt; &lt;/span&gt;{
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; news = snapshot.data![index];
  
                    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//in blogger, main image from content&lt;/span&gt;
                    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//so we need to separate the image from its content&lt;/span&gt;
                    
                    var content = news.content;
                    var regex = RegExp(r&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;src=\&quot;(https:\/\/blogger\.googleusercontent\.com\/img\/[^\&quot;]+)\&quot;&#39;&lt;/span&gt;);
                    var match = regex.firstMatch(content);
                    var image = match != &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;null&lt;/span&gt;
                        ? match.group(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)
                        : &#39;https://cdn.pixabay.com/photo/2017/09/25/14/23/mountains-2785261_960_720.jpg&#39;;
  
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; ListTile(
                      contentPadding:
                          EdgeInsets.only(top: 16, left: 16, right: 16),
                      title: Text(
                        news.title,
                        maxLines: 3,
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(fontSize: 14),
                      ),
                      leading: Image.network(
                        image!,
                        fit: BoxFit.cover,
                        width: 100,
                      ),
                      trailing: IconButton(
                        onPressed: () {
                          Navigator.push(
                              context,

                              MaterialPageRoute(
                                builder: (context) =&amp;gt; Detail(
                                  url: news.url
                                ),
                              ),
                            );
                        },
                        icon: Icon(
                          Icons.open_in_new,
                        ),
                      ),
                    );
                  },
                );
              } &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-params&quot;&gt;(snapshot.hasError)&lt;/span&gt; &lt;/span&gt;{
                &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;${snapshot.error}&#39;&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;;
              }
              &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;()&lt;/span&gt;&lt;/span&gt;;
            },
          ),
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Now we can do a test run. Please run the emulator. If successful, the display
  will look more or less like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu8_Ut03zHIagZj0FiVJYBTO7ofP6oucIXimUHOHw56TDV0tbI-HbeZAFyeLPdqhDueEhGAFnvFg7yI78v2Db9G0XO6xNMmAUvCKBeFidp3znmiVq-DOPNi_1Ci_q5E4MDVnZbzG27lCe0MlmkpSihWu835Eq9TLPSpGGfQbWfYeFZV9eUw0upXF9-w1Hx/s500/Screenshot_2023-07-08-20-23-03-28_436c5d73a2a67385efd48422e495a321.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu8_Ut03zHIagZj0FiVJYBTO7ofP6oucIXimUHOHw56TDV0tbI-HbeZAFyeLPdqhDueEhGAFnvFg7yI78v2Db9G0XO6xNMmAUvCKBeFidp3znmiVq-DOPNi_1Ci_q5E4MDVnZbzG27lCe0MlmkpSihWu835Eq9TLPSpGGfQbWfYeFZV9eUw0upXF9-w1Hx/s16000/Screenshot_2023-07-08-20-23-03-28_436c5d73a2a67385efd48422e495a321.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV-_uyKZPlQgj6m8gYIMwFBKLmKgTaXC83X7pyZWJAPzxkWO-l7e90X2dSa7fBvzV31tMDc3PyaxKqNFaooeUkdemXtLkjcgTeSkfc_NyisFwoxdraWBAsz958hTYL-eKlJb_CO1-l2DzsoIE8GZwQLlpVccJ0YN_w1MZxUCJQQ8h7Yh0yNqZIXKjlCnyw/s500/Screenshot_2023-07-08-20-33-12-51_436c5d73a2a67385efd48422e495a321.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV-_uyKZPlQgj6m8gYIMwFBKLmKgTaXC83X7pyZWJAPzxkWO-l7e90X2dSa7fBvzV31tMDc3PyaxKqNFaooeUkdemXtLkjcgTeSkfc_NyisFwoxdraWBAsz958hTYL-eKlJb_CO1-l2DzsoIE8GZwQLlpVccJ0YN_w1MZxUCJQQ8h7Yh0yNqZIXKjlCnyw/s16000/Screenshot_2023-07-08-20-33-12-51_436c5d73a2a67385efd48422e495a321.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  That&#39;s the tutorial on how to create a news application from Blogger Api in
  Flutter. Hopefully this short tutorial is useful. If there are any problems,
  please write in the comments column below. That&#39;s all and receive a salary.
&lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-news-application-from-blogger.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTKwXB14PNogTCCVroRjKZIWj54obvGK9-nZfTBOTRbkZTaKxSwEzxChSsEjs0ZqkoQTt_BUANM2D57MQIGLFYNnXgyVtPcwERYdPS1av47a7vn_zTI3-tfDF4uMm75T44WQFrK2GdEVFL8ADduNNIdpvgzXVmAU_Rf9E9EI8CwutAdn4y_gzamRBMU3Y/s72-c/Creating%20a%20News%20Application%20from%20Blogger%20API%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-1966332551028248723</guid><pubDate>Sat, 23 Dec 2023 23:09:00 +0000</pubDate><atom:updated>2023-12-23T15:09:12.061-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating a News Application with the WordPress API</title><description>&lt;div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQvkks-ae99soIea3wrLMevYYijpTt-2B478ZBhyk2yLBcJSLS6oY3mjYLC-sJ1jsgX0eg-NgBsguXXIQvUosQK8f5bZkNsUzzkD_08A2swQjw2gr3aRtd6qadj-i6DEcEmksdlSIqKy5GHJQgkwHCcUIDqPqxYRpAI959MRy1dNF4JSIqwwjUpVgzSDg/s1500/Creating%20a%20News%20Application%20with%20the%20WordPress%20API.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating a News Application with the WordPress API&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQvkks-ae99soIea3wrLMevYYijpTt-2B478ZBhyk2yLBcJSLS6oY3mjYLC-sJ1jsgX0eg-NgBsguXXIQvUosQK8f5bZkNsUzzkD_08A2swQjw2gr3aRtd6qadj-i6DEcEmksdlSIqKy5GHJQgkwHCcUIDqPqxYRpAI959MRy1dNF4JSIqwwjUpVgzSDg/s16000/Creating%20a%20News%20Application%20with%20the%20WordPress%20API.png&quot; title=&quot;Creating a News Application with the WordPress API&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;
    Hello everyone, welcome back at porkaone. On this occasion we will learn how
    to create a news application that displays API data from WordPress. Are you
    curious? Come on, follow the tutorial below.
  &lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
    &lt;p style=&quot;text-align: left;&quot;&gt;
      WordPress provides APIs that we can process for various application needs.
      &lt;b&gt;https://domain.com/wp-json/wp/v2/posts&lt;/b&gt; is an endpoint for getting
      news from a website that uses WordPress. No need for authentication, we
      can easily process the data. In this tutorial we will create a news
      application that displays news from the &lt;b&gt;hipwee.com&lt;/b&gt; website. Please
      scroll to the bottom of this article to see the final results.
    &lt;/p&gt;
    &lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;h1 style=&quot;text-align: left;&quot;&gt;
      Creating a News Application with the WordPress API
    &lt;/h1&gt;
    &lt;p style=&quot;text-align: left;&quot;&gt;
      1. Create a new flutter project with the name you want. Use the latest
      version of flutter or flutter that supports null safety.
    &lt;/p&gt;
    &lt;p&gt;
      2. Open &lt;b&gt;pubspec.yaml&lt;/b&gt;. Then add &lt;b&gt;http:&lt;/b&gt; and
      &lt;b&gt;flutter_widget_from_html_core:&lt;/b&gt; as in the example below.
    &lt;/p&gt;
    &lt;p&gt;&lt;/p&gt;
    &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;text-align: center;&quot;&gt;
            &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNbOtu2JTqoxVnbuMdZwCk3K_iIDz6Si98uI5XPein2ySwiDNpAbc789FhgMe7-LvIWhJNE5ZkkiONq1xOYN7nj5q3qi6eIqmdganN0cNi4wcui3eRSfrejsZaPv4KSlgqKthVeJ3RZPOjMnr2Tb_rSxO3Drgqt39feB76-VBJZrYd4FV4GkogXYC-anFt&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Wordpress API&quot; data-original-height=&quot;262&quot; data-original-width=&quot;572&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjNbOtu2JTqoxVnbuMdZwCk3K_iIDz6Si98uI5XPein2ySwiDNpAbc789FhgMe7-LvIWhJNE5ZkkiONq1xOYN7nj5q3qi6eIqmdganN0cNi4wcui3eRSfrejsZaPv4KSlgqKthVeJ3RZPOjMnr2Tb_rSxO3Drgqt39feB76-VBJZrYd4FV4GkogXYC-anFt=s16000&quot; title=&quot;Wordpress API&quot; /&gt;&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;
      3. Then create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
      &lt;b&gt;news_model.dart&lt;/b&gt; as the data model. Follow the script as below.
    &lt;/p&gt;
    &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; content;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; imageUrl;

  News({required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.imageUrl});

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;factory&lt;/span&gt; News.fromJson(&lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; json) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; News(
      title: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;rendered&#39;&lt;/span&gt;],
      content: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;content&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;rendered&#39;&lt;/span&gt;],
      imageUrl: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;featured_media&#39;&lt;/span&gt;] != &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;
          ? json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;_embedded&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;wp:featuredmedia&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;source_url&#39;&lt;/span&gt;]
          : &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
    );
  }
}&lt;/pre&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;
      4. Then create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
      &lt;b&gt;wordpress_api.dart&lt;/b&gt;. This file functions to win api data from
      WordPress. Follow the script below.
    &lt;/p&gt;
    &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;news_model.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;WordPressAPI&lt;/span&gt; &lt;/span&gt;{
  
    Future&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;News&amp;gt;&amp;gt; fetchNews() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://hipwee.com/wp-json/wp/v2/posts?_embed&#39;&lt;/span&gt;));
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; jsonResponse = jsonDecode(response.body);
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; jsonResponse.map((data) =&amp;gt; News.fromJson(data)).toList();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to load news&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;
      5. Create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
      &lt;b&gt;detail.dart&lt;/b&gt;. This file functions to display news details. Follow
      the script below.
    &lt;/p&gt;
    &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter/material.dart&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart&#39;&lt;/span&gt;;
  
  class Detail extends StatelessWidget {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; title;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; content;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; VoidCallback? onPressed;
  
    Detail({required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.onPressed});
  
    @override
    Widget build(BuildContext context) {
  
      //menghilangkan text &#39;data&#39; pada &#39;data-src&#39; ini biasa terdapat pada &amp;lt;img&amp;gt;
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;String&lt;/span&gt; modifiedHtmlString = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.content.replaceAll(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;data-src&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;src&#39;&lt;/span&gt;);
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Scaffold(
        appBar: AppBar(
          title: Text(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Detail&#39;&lt;/span&gt;),
        ),
        body: ListView(
          padding: EdgeInsets.zero,
          children: [
            Container(
              &lt;span class=&quot;hljs-built_in&quot;&gt;width&lt;/span&gt;: &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;double&lt;/span&gt;.infinity,
              &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: MediaQuery.of(context).&lt;span class=&quot;hljs-built_in&quot;&gt;size&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt; * &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0.33&lt;/span&gt;,
              decoration: BoxDecoration(
                &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// color: Colors.grey[400],&lt;/span&gt;
                &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;: DecorationImage(
                  &lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;: NetworkImage(&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-built_in&quot;&gt;image&lt;/span&gt;),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            SizedBox(
              &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
            ),
            Padding(
              padding: EdgeInsets.only(left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;, bottom: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
                    style: TextStyle(
                      fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;22&lt;/span&gt;,
                      fontWeight: FontWeight.w400,
                    ),
                  ),
                  SizedBox(
                    &lt;span class=&quot;hljs-built_in&quot;&gt;height&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                  ),
                  HtmlWidget(
                    modifiedHtmlString //html text is converted into readable text
                  ),
                ],
              ),
            )
          ],
        ),
      );
    }
  }&lt;/pre&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;6. Open &lt;b&gt;lib/main.dart&lt;/b&gt; than follow the script below&lt;/p&gt;
    &lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;detail&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;wordpress_api&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;news_model&lt;/span&gt;.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;WordPress&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&#39;,
        theme: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ThemeData&lt;/span&gt;(
          primarySwatch: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blue,
        ),
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NewsScreen&lt;/span&gt;(),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;NewsScreen&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    _NewsScreenState createState() =&amp;gt; _NewsScreenState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_NewsScreenState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;NewsScreen&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    late &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Future&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&amp;gt;&amp;gt; futureNews;
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    void initState() {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.initState();
      futureNews = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;WordPressAPI&lt;/span&gt;().fetchNews();
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;WordPress&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;News&lt;/span&gt;&amp;gt;&amp;gt;(
            future: futureNews,
            builder: (context, snapshot) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                  itemCount: snapshot.data!.length,
                  itemBuilder: (context, index) {
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; news = snapshot.data![index];
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                      contentPadding:
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.only(top: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, left: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;, right: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;),
                      title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                        news.title,
                        maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                        overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                      ),
                      leading: news.imageUrl != &#39;&#39;
                          ? &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                              news.imageUrl,
                              fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                              width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;,
                            )
                          : &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(),
                      trailing: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;IconButton&lt;/span&gt;(
                        onPressed: () {
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                            context,
                            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// DetailPage is the destination page&lt;/span&gt;
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                              builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                                title: news.title,
                                content: news.content,
                                image: news.imageUrl,
                              ),
                            ),
                          );
                        },
                        icon: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.open_in_new,
                        ),
                      ),
                    );
                  },
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&#39;${snapshot.error}&#39;);
              }
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;();
            },
          ),
        ),
      );
    }
  }&lt;/pre&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;
      Now we do a test. Run the emulator. If successful, the display will look
      like the image below.
    &lt;/p&gt;
    &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
      &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKMoZAXSI2HaoH-7obJ90mYVSRpEeVvAhScUpVUF_lX-ug156dN8aHcFeE-VIcn7qVbJ23CSLbUDsUY-PPrBNXswRZiVaOlviTcyY-J2S8rEA9erfgRChW4sceGszJ_sGrPdBD0MNuADPRO-ULPysQ2eyYcg9CHySFZ8MDgTHDM_tAlvi6W6lh0Qw1653k/s500/Screenshot_2023-07-07-17-17-55-53_96aaf562580e01818fa47644d8fb4c56.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKMoZAXSI2HaoH-7obJ90mYVSRpEeVvAhScUpVUF_lX-ug156dN8aHcFeE-VIcn7qVbJ23CSLbUDsUY-PPrBNXswRZiVaOlviTcyY-J2S8rEA9erfgRChW4sceGszJ_sGrPdBD0MNuADPRO-ULPysQ2eyYcg9CHySFZ8MDgTHDM_tAlvi6W6lh0Qw1653k/s16000/Screenshot_2023-07-07-17-17-55-53_96aaf562580e01818fa47644d8fb4c56.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil84aSaHc0Pebzdzw6is-DUIrkxh88MAUqGrF7taq_yfNbLWWnqVJSECCixd4fDfo2mYV9HzIOn4omWGK_Ak0_W88o9EQrGamwWZ9XyaMlj4wU-M48rs2tPP7CHGceMVQLkyAw2NqGczuSkyWJ_o9sQbvV_Qc5tPAxRjq1mPzU4-IQ7tmzVNKLl1izEwEU/s500/Screenshot_2023-07-07-17-18-03-38_96aaf562580e01818fa47644d8fb4c56.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil84aSaHc0Pebzdzw6is-DUIrkxh88MAUqGrF7taq_yfNbLWWnqVJSECCixd4fDfo2mYV9HzIOn4omWGK_Ak0_W88o9EQrGamwWZ9XyaMlj4wU-M48rs2tPP7CHGceMVQLkyAw2NqGczuSkyWJ_o9sQbvV_Qc5tPAxRjq1mPzU4-IQ7tmzVNKLl1izEwEU/s16000/Screenshot_2023-07-07-17-18-03-38_96aaf562580e01818fa47644d8fb4c56.jpg&quot; /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;br /&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
    &lt;p&gt;
      It&#39;s easy, isn&#39;t it? Now you can create a news application with news
      sourced from WordPress. You can add other news choices by using different
      website sources. The conditions must be WordPress and the API can be
      accessed. Also improvise by adding other widgets and state management to
      your application.
    &lt;/p&gt;
        &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter
 &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter
            ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;p&gt;
      That&#39;s the tutorial on how to create a news application using the
      WordPress API. Hopefully this short tutorial is useful. If you have any
      questions, please ask directly in the comments column below. That&#39;s all
      and receive a salary.
    &lt;/p&gt;
    &lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
    &lt;script&gt;
      (adsbygoogle = window.adsbygoogle || []).push({});
    &lt;/script&gt;
    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-news-application-with.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQvkks-ae99soIea3wrLMevYYijpTt-2B478ZBhyk2yLBcJSLS6oY3mjYLC-sJ1jsgX0eg-NgBsguXXIQvUosQK8f5bZkNsUzzkD_08A2swQjw2gr3aRtd6qadj-i6DEcEmksdlSIqKy5GHJQgkwHCcUIDqPqxYRpAI959MRy1dNF4JSIqwwjUpVgzSDg/s72-c/Creating%20a%20News%20Application%20with%20the%20WordPress%20API.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-9086596778763413758</guid><pubDate>Sat, 23 Dec 2023 14:05:00 +0000</pubDate><atom:updated>2023-12-23T06:05:44.176-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Using the State Management Provider in the Todo List Flutter Application</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlRj9fLfKxrn_6gdxQew6_xJu7mjQqW7xYPGQyqNdfpU6pwciFR6kiA9UB4NmS8VvHh3U-8F1bcxrsjKPw86RyoSdMMtD85rEVXdRlQB81E6QKtxAjgrUBqhiwFbYrBwCbGR-rLTTQHdePj6ZNJ53Tbi0SJfXVPeg4MuVSirKI10IfYFFK7vYpj36U5Js/s1500/Using%20the%20State%20Management%20Provider%20in%20the%20Todo%20List%20Flutter%20Application.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Using the State Management Provider in the Todo List Flutter Application&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlRj9fLfKxrn_6gdxQew6_xJu7mjQqW7xYPGQyqNdfpU6pwciFR6kiA9UB4NmS8VvHh3U-8F1bcxrsjKPw86RyoSdMMtD85rEVXdRlQB81E6QKtxAjgrUBqhiwFbYrBwCbGR-rLTTQHdePj6ZNJ53Tbi0SJfXVPeg4MuVSirKI10IfYFFK7vYpj36U5Js/s16000/Using%20the%20State%20Management%20Provider%20in%20the%20Todo%20List%20Flutter%20Application.png&quot; title=&quot;Using the State Management Provider in the Todo List Flutter Application&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn
  flutter state management with the provider. The case study is the Todolist
  application. Are you curious? Let&#39;s follow the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Provider is a state management library that is very easy to learn. State
  management is a way to manage the state of each widget in the application. If
  you use stateful then all widgets will be updated, no matter whether they have
  changes or not. Meanwhile, if you use state management, only certain widgets
  will have their state updated. This way the application performance is much
  better.
&lt;/p&gt;
&lt;p&gt;
  On this occasion we will create a Todolist application. There is an add button
  at the bottom which then displays a popup dialog containing a form. If saved,
  it will be displayed in list form. Scroll to the bottom of the screen to see
  the results.
&lt;/p&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter
 &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter
            ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  Using the State Management Provider in the Todo List Flutter Application
&lt;/h1&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  1. Create a new flutter project with the name you want. Use the latest version
  of flutter or flutter that supports null safety.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Open pubspec.yaml then add &lt;b&gt;provider:&lt;/b&gt; in it. See example below.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgzYqlQE_gxD0-Y71UNimmcl5saEUbJO2qZorsFE3AgjhHcKOEfMTDA88f2othI6RqLVytQK0M1yJEcsxAf5TgFDBEsy5C_wEDdhrmpA9l8m1y34j_zBWHLdU5YElteStETJNtg0fU-AbkrXu8AEYwKMTGbQmvc_1v8qCgSN4QR6TgGHu6FswlTAIJ5uf1D&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;260&quot; data-original-width=&quot;535&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgzYqlQE_gxD0-Y71UNimmcl5saEUbJO2qZorsFE3AgjhHcKOEfMTDA88f2othI6RqLVytQK0M1yJEcsxAf5TgFDBEsy5C_wEDdhrmpA9l8m1y34j_zBWHLdU5YElteStETJNtg0fU-AbkrXu8AEYwKMTGbQmvc_1v8qCgSN4QR6TgGHu6FswlTAIJ5uf1D=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Create a new file in the &lt;b&gt;lib&lt;/b&gt; folder with the name
  &lt;b&gt;todo_model.dart&lt;/b&gt;. Follow the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/foundation.dart&#39;;

  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;TodoModel&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ChangeNotifier&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt;&amp;gt; todos = []; &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Create a todo list as a data source&lt;/span&gt;
  
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Method for adding a new todo&lt;/span&gt;
    void addTodo(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; todo) {
      todos.add(todo);
      notifyListeners(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//Notify the application that a change occurred&lt;/span&gt;
    }
  
    &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Method to delete todo&lt;/span&gt;
    void removeTodo(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; todo) {
      todos.remove(todo);
      notifyListeners(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//Notify the application that a change occurred&lt;/span&gt;
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. Open the &lt;b&gt;lib/main.dart&lt;/b&gt; file then replace it with the script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt; &lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:provider/provider.dart&#39;;
  
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;todo_model&lt;/span&gt;.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ChangeNotifierProvider&lt;/span&gt;(
        create: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TodoModel&lt;/span&gt;(),
        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;My&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Todo&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;App&lt;/span&gt;&#39;,
          home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TodoListScreen&lt;/span&gt;(),
        ),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;TodoListScreen&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt; _todoController = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextEditingController&lt;/span&gt;();
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; todoModel = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Provider&lt;/span&gt;.of&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TodoModel&lt;/span&gt;&amp;gt;(context); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Access TodoModel model data from Provider&lt;/span&gt;
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Todo&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&#39;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the title on the AppBar&lt;/span&gt;
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
          itemCount: todoModel.todos.length, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Counts the number of items in the todos list&lt;/span&gt;
          itemBuilder: (context, index) {
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; todo = todoModel.todos[index]; &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Retrieve todo by index&lt;/span&gt;
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
              title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(todo), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the todo text as the ListTile title&lt;/span&gt;
              trailing: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;IconButton&lt;/span&gt;(
                icon: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.delete), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays a delete icon in the trailing part of the ListTile&lt;/span&gt;
                onPressed: () {
                  todoModel.removeTodo(todo); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Delete a todo when the delete key is pressed&lt;/span&gt;
                },
              ),
            );
          },
        ),
        floatingActionButton: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FloatingActionButton&lt;/span&gt;(
          onPressed: () {
            &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//show dialog popup&lt;/span&gt;
            showDialog(
              context: context,
              builder: (&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AlertDialog&lt;/span&gt;(
                  title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Add&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Todo&lt;/span&gt;&#39;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the title of the AlertDialog dialog&lt;/span&gt;
                  content: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextField&lt;/span&gt;(
                    controller: _todoController, &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Connect TextEditingController with TextField&lt;/span&gt;
                    decoration: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InputDecoration&lt;/span&gt;(labelText: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Tod&lt;/span&gt;o&#39;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the &quot;Todo&quot; label on the TextField&lt;/span&gt;
                  ),
                  actions: [
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextButton&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Cance&lt;/span&gt;l&#39;), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the text &quot;Cancel&quot; on the TextButton button&lt;/span&gt;
                      onPressed: () {
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.of(context).pop();
                      },
                    ),
                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextButton&lt;/span&gt;(
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Ad&lt;/span&gt;d&#39;),
                      onPressed: () {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; newTodo = _todoController.text;
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (newTodo.isNotEmpty) {
                          todoModel.addTodo(newTodo);
                        }
                        _todoController.clear(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Clears the input value in the TextEditingController&lt;/span&gt;
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.of(context).pop(); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Closes the dialog after adding a todo&lt;/span&gt;
                      },
                    ),
                  ],
                );
              },
            );
          },
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.add), &lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;// Displays the add icon on the FloatingActionButton button&lt;/span&gt;
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  We have done all the steps, it&#39;s time to test it. Please run the emulator and
  if successful, the display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjpQaBpnPDw7AIU-Pm7jgV3f3zlMnTh0NX4XuV1MDnexpHng3W4i7b1216Zjg3_R6fT1FO76rQR_Aj-pnBj_XDpNDJUmze6ecvFAIM3aEKD1zU2DolRnGNCQnF8AmhQeOXnWy9iUGIFqf2Mjqo6fsoKwkP-m6FeuYjEZS0Wmw1BNQcW6KOzvjaN7gqZLH_/s500/Screenshot_2023-07-06-14-46-04-67_96aaf562580e01818fa47644d8fb4c56.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjpQaBpnPDw7AIU-Pm7jgV3f3zlMnTh0NX4XuV1MDnexpHng3W4i7b1216Zjg3_R6fT1FO76rQR_Aj-pnBj_XDpNDJUmze6ecvFAIM3aEKD1zU2DolRnGNCQnF8AmhQeOXnWy9iUGIFqf2Mjqo6fsoKwkP-m6FeuYjEZS0Wmw1BNQcW6KOzvjaN7gqZLH_/s16000/Screenshot_2023-07-06-14-46-04-67_96aaf562580e01818fa47644d8fb4c56.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisAiimzmkMQWSxSTJrPKQC9ACzR4rTdyL1cDoL64oZB_5OlR-jfu189ZRsBKJYkgk3YiQy7QYW0abkfZEr6YyVaZimDNPQDL6yk4nKu5RifGOFS2QMn2fymrqv0dyu0BJgQhnyD4jWiLUK8Rxl8xvq2jTWz7s5HDyobPGk1LFwCe4TI9AXsu2RL50Ke2ut/s500/Screenshot_2023-07-06-14-46-11-23_96aaf562580e01818fa47644d8fb4c56.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisAiimzmkMQWSxSTJrPKQC9ACzR4rTdyL1cDoL64oZB_5OlR-jfu189ZRsBKJYkgk3YiQy7QYW0abkfZEr6YyVaZimDNPQDL6yk4nKu5RifGOFS2QMn2fymrqv0dyu0BJgQhnyD4jWiLUK8Rxl8xvq2jTWz7s5HDyobPGk1LFwCe4TI9AXsu2RL50Ke2ut/s16000/Screenshot_2023-07-06-14-46-11-23_96aaf562580e01818fa47644d8fb4c56.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Easy, right? Now you can use the provider to improve application performance.
&lt;/p&gt;
&lt;p&gt;
  That&#39;s the tutorial on how to use the state management provider in the Flutter
  todo list application. Hopefully this short tutorial is useful. If you have
  any questions, please ask directly in the comments column below. That&#39;s all
  and receive a salary.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/using-state-management-provider-in-todo.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlRj9fLfKxrn_6gdxQew6_xJu7mjQqW7xYPGQyqNdfpU6pwciFR6kiA9UB4NmS8VvHh3U-8F1bcxrsjKPw86RyoSdMMtD85rEVXdRlQB81E6QKtxAjgrUBqhiwFbYrBwCbGR-rLTTQHdePj6ZNJ53Tbi0SJfXVPeg4MuVSirKI10IfYFFK7vYpj36U5Js/s72-c/Using%20the%20State%20Management%20Provider%20in%20the%20Todo%20List%20Flutter%20Application.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-7450196020682941095</guid><pubDate>Sat, 23 Dec 2023 13:41:00 +0000</pubDate><atom:updated>2023-12-23T05:41:50.111-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Creating State Management Flutter with Provider</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ19IiaUqdCU0I4LjgeIsh6oiLGgIJXy5y0zqIvI5JZv8_sozpbYuyJn6y-lY_f2CZVb-KpWDjqhLLFutk13DPhVj47TQgupuwx6k-pqG6eItXeJyn4aGjhLKPCsNtYoh3IjmtvyhXDF7xXgYQAT_x6-GXbfzfbzLZPXDCOtzkWRw_G5Z2xtaWMqrpbLE/s1500/Creating%20State%20Management%20Flutter%20with%20Provider.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Creating State Management Flutter with Provider&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ19IiaUqdCU0I4LjgeIsh6oiLGgIJXy5y0zqIvI5JZv8_sozpbYuyJn6y-lY_f2CZVb-KpWDjqhLLFutk13DPhVj47TQgupuwx6k-pqG6eItXeJyn4aGjhLKPCsNtYoh3IjmtvyhXDF7xXgYQAT_x6-GXbfzfbzLZPXDCOtzkWRw_G5Z2xtaWMqrpbLE/s16000/Creating%20State%20Management%20Flutter%20with%20Provider.png&quot; title=&quot;Creating State Management Flutter with Provider&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to create a Flutter application with a state management provider. Come on,
  follow the tutorial below.
&lt;/p&gt;

&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Provider is a flutter package or library that is quite well-known and easy to
  use. Provider is very suitable for those of you who are just learning state
  management in Flutter. A little information, one of the benefits of state
  management is to increase application performance. State management is more
  efficient than stateful, because state management only changes the state of
  certain widgets and not all of them.
&lt;/p&gt;
&lt;p&gt;
  On this occasion we will learn how to use state management in counter
  applications. The counter application is the first application created when
  you create a Flutter project. We will modify it to use state management.
  Scroll to the bottom of this article to see the final results.
&lt;/p&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  Creating State Management Flutter with Provider
&lt;/h1&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  1. Create a new flutter project with a free name. Use the latest version of
  flutter or flutter that supports null safety.
&lt;/p&gt;
&lt;p&gt;
  2. Open &lt;b&gt;pubspec.yaml&lt;/b&gt; then add &lt;b&gt;provider:&lt;/b&gt; then save the file to
  download the package. Follow the picture as below.
&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhG9F28pwxv09-Ur0io82xKPAXcYEzERNO-aoemfSTUIuM3HjzPaq-DJi7vuMYS2t6x4t3zBMXvbdhywk6wbhGPUwl6j5EAmPfVj7TM0rDmezJBG4kTrNdgjsgh8A_AK58NMugi5_iV5tIb1KzLvxyhebjKoYvyLDF-2Au77pNh3moNHxLVqT1sQs9aPWmU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Membuat State Management Flutter dengan Provider&quot; data-original-height=&quot;227&quot; data-original-width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhG9F28pwxv09-Ur0io82xKPAXcYEzERNO-aoemfSTUIuM3HjzPaq-DJi7vuMYS2t6x4t3zBMXvbdhywk6wbhGPUwl6j5EAmPfVj7TM0rDmezJBG4kTrNdgjsgh8A_AK58NMugi5_iV5tIb1KzLvxyhebjKoYvyLDF-2Au77pNh3moNHxLVqT1sQs9aPWmU=s16000&quot; title=&quot;Membuat State Management Flutter dengan Provider&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  3. Create a &lt;b&gt;counter_controller.dart&lt;/b&gt; file in the &lt;b&gt;lib&lt;/b&gt; folder. We
  use this file as a data controller for the numbers.
&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/foundation.dart&#39;;

  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterController&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;ChangeNotifier&lt;/span&gt;&lt;/span&gt;{
  
    int count = &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;;
  
    void increment(){
  
      count++;
      notifyListeners();
      
    }
  
  }&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;div&gt;&lt;b&gt;Explanation of the script above&lt;/b&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ol style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        Import Package: In this section, we import the flutter/foundation.dart
        package which contains the ChangeNotifier class. This package is
        required to use state management with providers.
      &lt;/li&gt;
      &lt;li&gt;
        CounterController Class: CounterController is a class that implements
        state management using providers. This class uses the ChangeNotifier
        mixin, which allows the class to send notifications to widgets that use
        the state about state changes.
      &lt;/li&gt;
      &lt;li&gt;
        The increment() method is responsible for increasing the count value and
        then calling notifyListeners(). This method will be called when we want
        to increase the counter value. In this section, the count will be
        incremented by 1, and then notifyListeners() will be called to notify
        the widgets that use this state that a change has occurred in the state.
        This will trigger an update to the display of the widget that uses that
        state.
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;
  4. Open the &lt;b&gt;lib/main.dart&lt;/b&gt; file then change the script in it with the
  script below.
&lt;/p&gt;

&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:provider/provider.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;counter_controller&lt;/span&gt;.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ChangeNotifierProvider&lt;/span&gt;(
        create: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterController&lt;/span&gt;(),
        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Counter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;App&lt;/span&gt;&#39;,
          home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterScreen&lt;/span&gt;(),
        ),
      );
    }
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterScreen&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
    const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterScreen&lt;/span&gt;({&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.key});
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; counterController = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Provider&lt;/span&gt;.of&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CounterController&lt;/span&gt;&amp;gt;(context);
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Counter&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;App&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
            mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.center,
            children: [
              &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Count&lt;/span&gt;:&#39;,
                style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;),
              ),
              &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                &#39;${counterController.count}&#39;,
                style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;, fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.bold),
              ),
            ],
          ),
        ),
        floatingActionButton: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FloatingActionButton&lt;/span&gt;(
          onPressed: () {
            counterController.increment();
          },
          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icon&lt;/span&gt;(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Icons&lt;/span&gt;.add),
        ),
      );
    }
  }
  &lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;div&gt;&lt;b&gt;Explanation of the script above&lt;/b&gt;&lt;/div&gt;
  &lt;div&gt;
    &lt;ol style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        By using ChangeNotifierProvider, we can easily access and manage the
        state in various widgets under it.
      &lt;/li&gt;
      &lt;li&gt;
        Final function counterController =
        Provider.of&amp;lt;CounterController&amp;gt;(context); used to access the
        instance of CounterController provided by ChangeNotifierProvider inside
        the Flutter widget.
      &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
  5. Ok, now we can do a test run. Please run your emulator. If successful, the
  display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp6XEjGP1FGpOK7KaMMDFMIAzOm1HLdhlzPnL0vWV4rkxPc8zgzR_LOaMg90c2kAFwfa0-q5GYHNLXEWNUGPEszx9bxoEJRQ7riSRvOcxrC1VgNzTHMxLk3wuR_TKNavB8sAc0XY9CwX3l0yIZXb8KSmkpKRd39_Zt3Rm8EskxHMBsUSW1Roh1-6WdwfAk/s700/Screenshot_2023-07-06-11-50-58-65_96aaf562580e01818fa47644d8fb4c56.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp6XEjGP1FGpOK7KaMMDFMIAzOm1HLdhlzPnL0vWV4rkxPc8zgzR_LOaMg90c2kAFwfa0-q5GYHNLXEWNUGPEszx9bxoEJRQ7riSRvOcxrC1VgNzTHMxLk3wuR_TKNavB8sAc0XY9CwX3l0yIZXb8KSmkpKRd39_Zt3Rm8EskxHMBsUSW1Roh1-6WdwfAk/s16000/Screenshot_2023-07-06-11-50-58-65_96aaf562580e01818fa47644d8fb4c56.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  Easy, right? Because we already use state management, we don&#39;t need to use
  stateful anymore. You can improvise by creating a more complex flutter
  application with the provider.
&lt;/p&gt;
&lt;p&gt;
  Ok, that&#39;s it for the tutorial on making state management flutter with
  providers. Hopefully this short tutorial is useful. If you have any questions,
  please ask directly in the comments column below. That&#39;s all and receive a
  salary.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;/p&gt;
</description><link>https://porkaone.blogspot.com/2023/12/creating-state-management-flutter-with.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ19IiaUqdCU0I4LjgeIsh6oiLGgIJXy5y0zqIvI5JZv8_sozpbYuyJn6y-lY_f2CZVb-KpWDjqhLLFutk13DPhVj47TQgupuwx6k-pqG6eItXeJyn4aGjhLKPCsNtYoh3IjmtvyhXDF7xXgYQAT_x6-GXbfzfbzLZPXDCOtzkWRw_G5Z2xtaWMqrpbLE/s72-c/Creating%20State%20Management%20Flutter%20with%20Provider.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-4176463721522717427</guid><pubDate>Sat, 23 Dec 2023 09:43:00 +0000</pubDate><atom:updated>2023-12-23T01:43:05.020-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>Tutorial on How to Set Up Firebase and Flutter</title><description>&lt;div class=&quot;separator&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiDWWVmaam3FWMqTudIK2wM2AwrHRednkJRxWGSqVhtF9K-hei3k1eKqcI9-JLQo_gd9WkmE4ohXWmIwzRK_Nvvm_FdQ2LKl0r6LUthx3MykmwiSnuwrLFed2N8wu-kgabfOs5yy6uULBqb-s0qyAkZYOfcwlZv6gFQP59cQGpKoE_MMNklOwJ5lFscZo/s1500/Tutorial%20on%20How%20to%20Set%20Up%20Firebase%20and%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;Tutorial on How to Set Up Firebase and Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiDWWVmaam3FWMqTudIK2wM2AwrHRednkJRxWGSqVhtF9K-hei3k1eKqcI9-JLQo_gd9WkmE4ohXWmIwzRK_Nvvm_FdQ2LKl0r6LUthx3MykmwiSnuwrLFed2N8wu-kgabfOs5yy6uULBqb-s0qyAkZYOfcwlZv6gFQP59cQGpKoE_MMNklOwJ5lFscZo/s16000/Tutorial%20on%20How%20to%20Set%20Up%20Firebase%20and%20Flutter.png&quot; title=&quot;Tutorial on How to Set Up Firebase and Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to connect a Flutter project with Google Firebase. Are you curious? Come on,
  follow the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;Google Firebase&lt;/h1&gt;
&lt;p&gt;
  Firebase is one of the services provided by Google to help developers quickly
  provide tools or environments such as databases, user authentication,
  real-time storage, file storage, data analysis, push notifications and other
  services.
&lt;/p&gt;
&lt;p&gt;
  Firebase is a quick solution for those of you who are lazy about creating a
  backend or don&#39;t know how to backend and its server environment. Firebase can
  be used for web and mobile application development. In this article we will
  discuss how to connect Flutter with Firebase. This article is also the
  beginning or requirements for developing Flutter applications with Firebase.
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;How to Connect Firebase to Flutter Project&lt;/h1&gt;
&lt;div&gt;
  1. Access firebase at
  &lt;a href=&quot;https://firebase.google.com&quot;&gt;https://firebase.google.com&lt;/a&gt;. Then
  click the get started button
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhS5zduHbtFYm1q_FxDJle61Bergf4-7-CdS6996myHSeDQGWppMOUfkCpC_O9x4Q2E_ljBY2aQmA1JWDq9yxcX2wgYSGeXYAj9-gbqHBGwQP4rbubtEyyxuWP5Y2HuTLX9e34AGOD9q_nj6acq0C2dyjCXVv_DNrSS8eZWlyezQrVFPKTFrqN_e8GJqHmV&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;592&quot; data-original-width=&quot;1180&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhS5zduHbtFYm1q_FxDJle61Bergf4-7-CdS6996myHSeDQGWppMOUfkCpC_O9x4Q2E_ljBY2aQmA1JWDq9yxcX2wgYSGeXYAj9-gbqHBGwQP4rbubtEyyxuWP5Y2HuTLX9e34AGOD9q_nj6acq0C2dyjCXVv_DNrSS8eZWlyezQrVFPKTFrqN_e8GJqHmV=s16000&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          Make Firebase Project
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;2. Klik add project&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhPPVkR-PR1HD2EuPd6OVCuI95zXNUWpAuBUk4Qt8rlen3zh29zNea779OD4fZFunxiTo9aqIY7cyxUh-kc7237zs0oOL2WoTv26BccgFiZPo99NN2g2X3ZTnFcNz61n0WB0B9cSZcoH-IkoVC3MqfUJIbQ_tZHE62jsDipqujb9ICksI-2uXTGyxOnkuer&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;500&quot; data-original-width=&quot;788&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhPPVkR-PR1HD2EuPd6OVCuI95zXNUWpAuBUk4Qt8rlen3zh29zNea779OD4fZFunxiTo9aqIY7cyxUh-kc7237zs0oOL2WoTv26BccgFiZPo99NN2g2X3ZTnFcNz61n0WB0B9cSZcoH-IkoVC3MqfUJIbQ_tZHE62jsDipqujb9ICksI-2uXTGyxOnkuer=s16000&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
        Make Firebase Project
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Next, fill in the project name, then click continue
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhA6iSYvR-I-1IfdHikDg1Kt-hE8KFAuC6myrs1Mi6afjpxHEYYTG8vKoP1uIS3JKH8iYwNvcv0tGGxCiM_8Nr3_yaZtIN-FE8rzoydjf90VCQr0mkW2TGNgUXmms-qCrfeA9Ktq0_cFMC5QBnvFfJR4uCMdtJtZa6TyEkikhZFztQsO8mguf2hjUzgybtI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;639&quot; data-original-width=&quot;1002&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhA6iSYvR-I-1IfdHikDg1Kt-hE8KFAuC6myrs1Mi6afjpxHEYYTG8vKoP1uIS3JKH8iYwNvcv0tGGxCiM_8Nr3_yaZtIN-FE8rzoydjf90VCQr0mkW2TGNgUXmms-qCrfeA9Ktq0_cFMC5QBnvFfJR4uCMdtJtZa6TyEkikhZFztQsO8mguf2hjUzgybtI=s16000&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. In the next step, you can activate the Google Analytics feature for the
  project or deactivate it. All you have to do is switch the enable Google
  Analytics button for this project. Then click the create project button.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhSzRIwif9nkT9tieaAeTg-ZLOaIkDxAsv-7wfzlY9hZnAMvaHi9CQflks2PXr_x6oEWQdFwhIaS5p2DLLon1MfnDbqvG5eKDxlnAh1pNY0usn4YjlyMoI8yGUn1VmJoOr97xkgESD-21S7CwnWrESeMyIofxNi2Jsn5LA1-RmDlhGL5oIEObk37KVEggUF&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;538&quot; data-original-width=&quot;922&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhSzRIwif9nkT9tieaAeTg-ZLOaIkDxAsv-7wfzlY9hZnAMvaHi9CQflks2PXr_x6oEWQdFwhIaS5p2DLLon1MfnDbqvG5eKDxlnAh1pNY0usn4YjlyMoI8yGUn1VmJoOr97xkgESD-21S7CwnWrESeMyIofxNi2Jsn5LA1-RmDlhGL5oIEObk37KVEggUF=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  5. Ok, after the project has been created. Then you will be directed to the
  dashboard page. Click the Android icon to add the application.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgzn75CVO79DpkNqY3GLQSzymypNZNIvVZ4QW69-OiDGjiGs85IgvZIhrBaQAOnOVH_1AWNjZk9maSZ9AtKWVQNaOzRXutQ00441YKYb8bTei6fET14ZA8rJIoZFbk7gHug7Lv6p3ypiHmMUrfTb4Oojw_v4ByAPJrazxhAgGmI7qU2NUi6nUDWi6mnDFBG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;430&quot; data-original-width=&quot;690&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgzn75CVO79DpkNqY3GLQSzymypNZNIvVZ4QW69-OiDGjiGs85IgvZIhrBaQAOnOVH_1AWNjZk9maSZ9AtKWVQNaOzRXutQ00441YKYb8bTei6fET14ZA8rJIoZFbk7gHug7Lv6p3ypiHmMUrfTb4Oojw_v4ByAPJrazxhAgGmI7qU2NUi6nUDWi6mnDFBG=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  6. Ok, next we will start setting up or configuring the Flutter application.
  First, we fill in the app registration first. Fill in the Android Package
  Name, App Nick Name, and SHA-1 as shown in the image below. How do I fill it
  in? Follow the next steps.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg4xE3fE-DdxWHwyJPHcO3EQ-4RRJX7Gz3NolDiVPUFyIVYzuj235aPkOCOSFEeqDdqzjAIqfJFOWXIpJVTgj9znpKp3lz9-FhyVNvjwdu7EKof_8DiOBIulNE8qtAV1CPBDr_CakueKikGX3HlFDULdL7pjbTgGSucVAElPfvtrik3_baHFrL_AN6buvSa&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Google Firebase Sahretech&quot; data-original-height=&quot;436&quot; data-original-width=&quot;643&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg4xE3fE-DdxWHwyJPHcO3EQ-4RRJX7Gz3NolDiVPUFyIVYzuj235aPkOCOSFEeqDdqzjAIqfJFOWXIpJVTgj9znpKp3lz9-FhyVNvjwdu7EKof_8DiOBIulNE8qtAV1CPBDr_CakueKikGX3HlFDULdL7pjbTgGSucVAElPfvtrik3_baHFrL_AN6buvSa=s16000&quot; title=&quot;Google Firebase Sahretech&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Register App&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;b&gt;Android Package&lt;/b&gt; &lt;b&gt;Name&lt;/b&gt; you can find in folder&amp;nbsp;&lt;b&gt;android/app/build.gradle&amp;nbsp;
      &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;
              &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiXZvW-aIk77z1r2rShMNmXekY_aajJRA9TwVv0-6Xg5i3BDlDwmUJYGVXv305r4tWIOH22P1S5y2GYFsnF8b0RaS92glKBE5mvGthCTFQCg0fImHcfeMrbNfHxE38iiKpXtZAFQaFJQc8Et6m35mJsgp_0bDzmux7IMneGcY3OGPLcRP3IDk-o13jGKqmV&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img data-original-height=&quot;168&quot; data-original-width=&quot;646&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiXZvW-aIk77z1r2rShMNmXekY_aajJRA9TwVv0-6Xg5i3BDlDwmUJYGVXv305r4tWIOH22P1S5y2GYFsnF8b0RaS92glKBE5mvGthCTFQCg0fImHcfeMrbNfHxE38iiKpXtZAFQaFJQc8Et6m35mJsgp_0bDzmux7IMneGcY3OGPLcRP3IDk-o13jGKqmV=s16000&quot; /&gt;&lt;/a&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
              android package name
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br /&gt;&lt;/b&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;b&gt;App Nick Name&lt;/b&gt; used as the name or nickname of the application so that
    it is easy to remember
  &lt;/li&gt;
  &lt;li&gt;
    &lt;b&gt;Debug signing certificate SHA-1 &lt;/b&gt;you can find in
    folder&amp;nbsp;&lt;b&gt;android&lt;/b&gt;. And than open cmd or terminal and run this
    command&amp;nbsp;&lt;b&gt;.\gradlew SigInReport&amp;nbsp;
      &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;
              &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgqHUHrHVSEJhuwWyobYKTCmNkflgJ54-ZJ2dgfULFWcJA-QyN5CsgN4BwxsCYosRim7keWgF1E0EA0X0G1TLFzhs6tvPWxcl9MYmIAsaw1al2UZnkmVBudcY7Nguv34NJJof4gAKWOXrnhuT6BTJi_U7QeEI6pGWUK0bwMpx4536mPK5s1a9sZUDbiE-IT&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Sahretech&quot; data-original-height=&quot;176&quot; data-original-width=&quot;760&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgqHUHrHVSEJhuwWyobYKTCmNkflgJ54-ZJ2dgfULFWcJA-QyN5CsgN4BwxsCYosRim7keWgF1E0EA0X0G1TLFzhs6tvPWxcl9MYmIAsaw1al2UZnkmVBudcY7Nguv34NJJof4gAKWOXrnhuT6BTJi_U7QeEI6pGWUK0bwMpx4536mPK5s1a9sZUDbiE-IT=s16000&quot; title=&quot;Flutter Sahretech&quot; /&gt;&lt;/a&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;SHA-1&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br /&gt;&lt;/b&gt;
  &lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
  &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
  7. Next, download google-services.json and add the file to the flutter
  project.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjxko2DP2jxNFLpDxwN3_z7NPHuj8dO6SIs84rAf1zyuLzfyrRZ55MIyjvcR6rWubrqhNQ3pc-BdRJgSc_hWXPjmIB_8j5MnHmT5i_gP5JF5k_uvik2JTbvfq6zoeG0XW3_jpZx-JU4PZhhHH48ajXVoJNhtYEmgf-uH-ERDhyPq2wOkXAW0TTNK3p5EmMu&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;486&quot; data-original-width=&quot;762&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjxko2DP2jxNFLpDxwN3_z7NPHuj8dO6SIs84rAf1zyuLzfyrRZ55MIyjvcR6rWubrqhNQ3pc-BdRJgSc_hWXPjmIB_8j5MnHmT5i_gP5JF5k_uvik2JTbvfq6zoeG0XW3_jpZx-JU4PZhhHH48ajXVoJNhtYEmgf-uH-ERDhyPq2wOkXAW0TTNK3p5EmMu=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          Mengunduh file google-service.json
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div&gt;
  8. Open &lt;b&gt;android/app&lt;/b&gt; then add the &lt;b&gt;google-services.json&lt;/b&gt; file in
  it. Follow the example as shown in the image below.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiq8cs2hmrkJvTwE0oLOFB2xy9kkB9gPna3LqxUJlKULzcuCmfKznxjP5o-Bh1zqOI87Lfz3fKrPPp5TqtFKCIYW0269pcR4uMo3PXW4ChKB_lUkB4Miyk6pXwndwthXVnK-WSBorWQuOOYdAGWQxUlR14R0XHacn6leLFEE_wOsmBNB4e5cdwEJkVk0yWF&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;167&quot; data-original-width=&quot;469&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiq8cs2hmrkJvTwE0oLOFB2xy9kkB9gPna3LqxUJlKULzcuCmfKznxjP5o-Bh1zqOI87Lfz3fKrPPp5TqtFKCIYW0269pcR4uMo3PXW4ChKB_lUkB4Miyk6pXwndwthXVnK-WSBorWQuOOYdAGWQxUlR14R0XHacn6leLFEE_wOsmBNB4e5cdwEJkVk0yWF=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          Add file google-services.json
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  9. Next, in this section we just click next. We will add the firebase SDK
  manually to the flutter project.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhCfuYuKrB06fSiS-RjYL-Fy4B25QSS_Fn69GRFw_jiEDax7OYLTNupx1AjO_xyrU_aFZh29ETqL5q71uTwNVymWZyFIpRu-seU5avyQ_2TtKRep2_F5p3Sp-zDpshoSuxPvbX7Ib5iAKOviH5n190c30NXW50hOeKnhCEV-iukZASCBQu-aa3SsKSbiDNL&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;425&quot; data-original-width=&quot;770&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhCfuYuKrB06fSiS-RjYL-Fy4B25QSS_Fn69GRFw_jiEDax7OYLTNupx1AjO_xyrU_aFZh29ETqL5q71uTwNVymWZyFIpRu-seU5avyQ_2TtKRep2_F5p3Sp-zDpshoSuxPvbX7Ib5iAKOviH5n190c30NXW50hOeKnhCEV-iukZASCBQu-aa3SsKSbiDNL=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;add Firebase SDK&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;10. Next, click continue to console. to complete the configuration.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjM10b6SxXdeBWJGlaYdpMKbyU9QyrLIY_7CMT4ZmowLWcVXOTB_3qqWGmzZEQOmXomcsDmIsAI8xeUGw_M9uL0cGBhk5Sdoe-uP-bd_a2MCLIHYbStJPDOfJDmnsYTgkVXESvhxzjTsRgf-_AeFTUaqJ0JGYIgxM0b_F_oupAs_1Wfb0nvh9OjN5yD3Wjw&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;278&quot; data-original-width=&quot;702&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjM10b6SxXdeBWJGlaYdpMKbyU9QyrLIY_7CMT4ZmowLWcVXOTB_3qqWGmzZEQOmXomcsDmIsAI8xeUGw_M9uL0cGBhk5Sdoe-uP-bd_a2MCLIHYbStJPDOfJDmnsYTgkVXESvhxzjTsRgf-_AeFTUaqJ0JGYIgxM0b_F_oupAs_1Wfb0nvh9OjN5yD3Wjw=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          Project Firebase Siap
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;
  11. Ok, now open your flutter project again. Go to
  &lt;b&gt;android/build.gradle&lt;/b&gt; then add the
  &lt;b&gt;classpath&amp;nbsp; &#39;com.google.gms:google-services:4.3.15&#39;&lt;/b&gt; in the red box
  below into dependencies as shown in the image below.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi1qtBIN22YmlvjHi5toDehhrJMP1iCaWN4tUy-qPyYWpil5MJwwwsrweSRbRuInfXNxpK7HlWmwhIad7RXa_oIN-EQZDLu_7Wbw2s4ZOXJgV9I6PaeFgihKJBJqqgvooQ-ZjOyzNGQTy9yelweK6JysIkrsrqQakLwX6bushvL2fGQpsRo6PcbqPg8gyfy&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;245&quot; data-original-width=&quot;573&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi1qtBIN22YmlvjHi5toDehhrJMP1iCaWN4tUy-qPyYWpil5MJwwwsrweSRbRuInfXNxpK7HlWmwhIad7RXa_oIN-EQZDLu_7Wbw2s4ZOXJgV9I6PaeFgihKJBJqqgvooQ-ZjOyzNGQTy9yelweK6JysIkrsrqQakLwX6bushvL2fGQpsRo6PcbqPg8gyfy=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;
          Add Plugin into Depedencies
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  12. Next, open &lt;b&gt;android/app/build.gradle&lt;/b&gt;, add this script at the very
  top of the file.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj-KKEQ_yK266hcmQCtDouwu4zAvgv7k83qw3xerC5rylJB0MD4B8t_7P5YWCsgwDbA8P0SPuOuIEXbAg4-tbS741VAyIAa_gHg5R9lkwBSaUSVvIe5ou70YSkb9D0otR-eaIC504QSGSBoQiczHrDp-g6Xp9ZUWk3ryM5KId3cMJ71yjAYeMt35G1OkOga&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;265&quot; data-original-width=&quot;497&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj-KKEQ_yK266hcmQCtDouwu4zAvgv7k83qw3xerC5rylJB0MD4B8t_7P5YWCsgwDbA8P0SPuOuIEXbAg4-tbS741VAyIAa_gHg5R9lkwBSaUSVvIe5ou70YSkb9D0otR-eaIC504QSGSBoQiczHrDp-g6Xp9ZUWk3ryM5KId3cMJ71yjAYeMt35G1OkOga=s16000&quot; /&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;
  13. Still in&lt;b&gt; android/app/build.gradle&lt;/b&gt;, then also add the script in the
  red box below.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg8NXO4zOjXXJFfXdvL2Od8qgVELf__Iud6sX1QWuVEL5gKJz3ovk8p0h8WMtrjz8i0a1hHMavcMzNx6YG2yyJGFqxUNMdYMO0daxe3mFtb1N1MuyCX5_OzTV2ShAF8S30YcNcOyyKOAMNM11VZhmwhR_h3Iwjf7BjnppqM6h5ERE64Tu03Q8aO0YJTrpw4&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;465&quot; data-original-width=&quot;631&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg8NXO4zOjXXJFfXdvL2Od8qgVELf__Iud6sX1QWuVEL5gKJz3ovk8p0h8WMtrjz8i0a1hHMavcMzNx6YG2yyJGFqxUNMdYMO0daxe3mFtb1N1MuyCX5_OzTV2ShAF8S30YcNcOyyKOAMNM11VZhmwhR_h3Iwjf7BjnppqM6h5ERE64Tu03Q8aO0YJTrpw4=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add depedencies&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  14. Open &lt;b&gt;pubspec.yaml&lt;/b&gt; then add &lt;b&gt;cloud_firestore:&lt;/b&gt; and
  &lt;b&gt;firebase_core:&lt;/b&gt;. Follow the picture as below.
&lt;/div&gt;
&lt;div&gt;
  &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;
          &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjmHftz_pJxUiA5nW3y84qmknu4xVb0KQ5eyO5YdrfHLXNAniCFIYqIFfv6RccszFi8qoY0a9Mq0wIIlWe0G8DVGf_Grx9vtVC-IEkULyv63bg2SFANCpoHC0vchgnxFR8M9kymuz3dqIRDv6-JlfmPldYMP0liqm12hxIeFZxor1sU5HYjZ8wUcZDqCeVi&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; data-original-height=&quot;277&quot; data-original-width=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjmHftz_pJxUiA5nW3y84qmknu4xVb0KQ5eyO5YdrfHLXNAniCFIYqIFfv6RccszFi8qoY0a9Mq0wIIlWe0G8DVGf_Grx9vtVC-IEkULyv63bg2SFANCpoHC0vchgnxFR8M9kymuz3dqIRDv6-JlfmPldYMP0liqm12hxIeFZxor1sU5HYjZ8wUcZDqCeVi=s16000&quot; title=&quot;Tutorial Cara Setting Firebase dan Flutter&quot; /&gt;&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add package&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  So far, we have successfully added the flutter project to firebase. Actually
  there is an easier way, namely using the Firebase CLI. I will discuss the
  tutorial another time, God willing.
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  Here&#39;s a tutorial on how to set up Firebase and Flutter projects. Hopefully
  this tutorial is useful, if you have any questions, please ask directly in the
  comments column below. That&#39;s all and receive a salary.
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;

&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;</description><link>https://porkaone.blogspot.com/2023/12/tutorial-on-how-to-set-up-firebase-and.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiDWWVmaam3FWMqTudIK2wM2AwrHRednkJRxWGSqVhtF9K-hei3k1eKqcI9-JLQo_gd9WkmE4ohXWmIwzRK_Nvvm_FdQ2LKl0r6LUthx3MykmwiSnuwrLFed2N8wu-kgabfOs5yy6uULBqb-s0qyAkZYOfcwlZv6gFQP59cQGpKoE_MMNklOwJ5lFscZo/s72-c/Tutorial%20on%20How%20to%20Set%20Up%20Firebase%20and%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8330722259056898265.post-5164578975867196885</guid><pubDate>Sat, 23 Dec 2023 08:52:00 +0000</pubDate><atom:updated>2023-12-31T04:11:20.704-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">flutter</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><title>How to Display Youtube Videos from Youtube API in Flutter</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDgjUGMa3Bl-X0_TVdJR3NfQThL4kAblba87bg-yQv9Phojui6RnVx_8AAVlvgBEPxLGz_07xReRJKljWzVooPCxO_JqB6pJR7WotjeRcL6XQAirL7p38hIvjCyvxu6MmEAFLwi_9gbLqJDEom_3gsI2AIDEHUVKHfMnlld_lIxl1FK_2d21D_ZMigBE/s1500/How%20to%20Display%20Youtube%20Videos%20from%20Youtube%20API%20in%20Flutter.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Display Youtube Videos from Youtube API in Flutter&quot; border=&quot;0&quot; data-original-height=&quot;845&quot; data-original-width=&quot;1500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDgjUGMa3Bl-X0_TVdJR3NfQThL4kAblba87bg-yQv9Phojui6RnVx_8AAVlvgBEPxLGz_07xReRJKljWzVooPCxO_JqB6pJR7WotjeRcL6XQAirL7p38hIvjCyvxu6MmEAFLwi_9gbLqJDEom_3gsI2AIDEHUVKHfMnlld_lIxl1FK_2d21D_ZMigBE/s16000/How%20to%20Display%20Youtube%20Videos%20from%20Youtube%20API%20in%20Flutter.png&quot; title=&quot;How to Display Youtube Videos from Youtube API in Flutter&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;
  Hello everyone, welcome back at porkaone. On this occasion we will learn how
  to use the YouTube API and display it in Flutter. Are you curious? Come on,
  follow the tutorial below.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;
  In the previous tutorial, I discussed how to display YouTube videos using
  static data written in flutter files, this article was written in
  Indonesian&amp;nbsp;&lt;a href=&quot;https://www.sahretech.com/2023/06/mudah-membuat-dan-menampilkan-video.html&quot; target=&quot;_blank&quot;&gt;https://www.sahretech.com/2023/06/mudah-membuat-dan-menampilkan-video.html&lt;/a&gt;.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
  Just by using static data, the application we create is not dynamic. In our
  tutorial this time, we will try to use data from the YouTube API. Every time
  the application is run, the video will be updated according to data from the
  YouTube API. Please scroll to the bottom of this article to see the final
  results.
&lt;/p&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style=&quot;font-size: 20px;&quot;&gt;Read Another Article ✨&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class=&quot;relatedpost&quot; style=&quot;background-color: #ff851b; width: 100%;&quot;&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 1. How to Create a Select Dropdown with API in Flutter
 &amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-dropdown-with-api.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 2. How to Create a Select Input Dropdown in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-create-select-input-dropdown-in.html&quot;&gt;read more&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 3. How to Make a QR Code Scanner in Flutter
            ENV&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-make-qr-code-scanner-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            📰 4. How to Display Youtube Videos in Flutter
&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-display-youtube-videos-in-flutter.html&quot;&gt;read more&lt;/a&gt;&lt;br /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;
  How to Display Youtube Videos from Youtube API in Flutter
&lt;/h1&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  1. First, you have to get a YouTube Api key to be able to access data from
  YouTube Api. Please follow the tutorial on how to get the YouTube API key
  below&amp;nbsp;&lt;a href=&quot;https://www.porkaone.com/2023/12/how-to-get-youtube-api-key.html&quot; target=&quot;_blank&quot;&gt;https://www.porkaone.com/2023/12/how-to-get-youtube-api-key.html&lt;/a&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  2. Ok, next create a new flutter project with the name you want. And use the
  latest version of flutter.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  3. Open pubspec.yaml then add the &lt;b&gt;http:&lt;/b&gt; and
  &lt;b&gt;youtube_player_flutter:&lt;/b&gt; packages, follow the example as shown in the
  image below. And don&#39;t forget to save the file to download the package.
&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center;&quot;&gt;
        &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeT8RaXGtIU1Nn2x_Wg-61DATlCOCwvDfzBswh_COSuwnEtuHeAmOdkPVgNpuGlKp9lwObgjnAEjUvtBYJ2srG2XneLE594vyz5FXB22Am6iiOKf1Vkn6gC-F_R2lE56W_ptKfhHj9a9u8ZkehTj28pxGjSoJT64PFTPdHMB7B2bAb_OZK7HuwB2ZMqDdA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Youtube API Flutter&quot; data-original-height=&quot;258&quot; data-original-width=&quot;601&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgeT8RaXGtIU1Nn2x_Wg-61DATlCOCwvDfzBswh_COSuwnEtuHeAmOdkPVgNpuGlKp9lwObgjnAEjUvtBYJ2srG2XneLE594vyz5FXB22Am6iiOKf1Vkn6gC-F_R2lE56W_ptKfhHj9a9u8ZkehTj28pxGjSoJT64PFTPdHMB7B2bAb_OZK7HuwB2ZMqDdA=s16000&quot; title=&quot;Youtube API Flutter&quot; /&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add Package&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  4. Create a &lt;b&gt;video.dart&lt;/b&gt; file in the &lt;b&gt;lib&lt;/b&gt; folder. This file is used
  as a video data model. Follow the script below
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt; &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; id;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; title;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; thumbnail;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt; channelTitle;

  Video({required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.id, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.thumbnail, required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.channelTitle});

  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;factory&lt;/span&gt; Video.fromJson(&lt;span class=&quot;hljs-built_in&quot;&gt;Map&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;String&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt; json) {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; Video(
      id: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;id&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;videoId&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      title: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;title&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      thumbnail: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;thumbnails&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;high&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;url&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;,
      channelTitle: json[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;snippet&#39;&lt;/span&gt;][&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;channelTitle&#39;&lt;/span&gt;] ?? &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&#39;&lt;/span&gt;
    );
  }
}&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  5. Create the &lt;b&gt;youtube_api_service.dart&lt;/b&gt; file in the &lt;b&gt;lib&lt;/b&gt; folder.
  And don&#39;t forget to change &lt;b&gt;YOUR_API_KEY&lt;/b&gt; in the script below according
  to your respective api key. Follow the script below
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;dart:convert&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;package:http/http.dart&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; http;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;video.dart&#39;&lt;/span&gt;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApiService&lt;/span&gt; &lt;/span&gt;{
  
    Future&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;Video&amp;gt;&amp;gt; getVideos() &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;async&lt;/span&gt; {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; url = &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;https://www.googleapis.com/youtube/v3/search&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;?part=snippet&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;maxResults=10&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;q=flutter+tutorial&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;type=video&#39;&lt;/span&gt;
          &lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;&amp;amp;key=YOUR_API_KEY&#39;&lt;/span&gt;;
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;await&lt;/span&gt; http.&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-built_in&quot;&gt;Uri&lt;/span&gt;.parse(url));
  
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (response.statusCode == &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;200&lt;/span&gt;) {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; jsonData = json.decode(response.body);
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videoList = jsonData[&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;items&#39;&lt;/span&gt;] &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;dynamic&lt;/span&gt;&amp;gt;;
  
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; videoList.map((item) =&amp;gt; Video.fromJson(item)).toList();
      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;throw&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot; style=&quot;color: #6a8759;&quot;&gt;&#39;Failed to load videos&#39;&lt;/span&gt;);
      }
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Explanation:&lt;/b&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;ol style=&quot;text-align: left;&quot;&gt;
      &lt;li&gt;
        We can use this YoutubeAPIService class for all files that require
        YouTube data.
      &lt;/li&gt;
      &lt;li&gt;
        getVideos() is a method for retrieving YouTube data. The return is in
        the form of a list with the Video model
      &lt;/li&gt;
      &lt;li&gt;
        final url we use this url as the endpoint. There are several parameters
        that you can set. maxResults= is used to display the number of videos.
        q= is the query or video we want to search for, you can adjust it
        according to what you want. Here I am looking for a flutter tutorial.
        type= This parameter is used to choose whether to display videos or
        channels.
      &lt;/li&gt;
      &lt;li&gt;key= fill in the api key that you got from the Google console.&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
  If the settings are correct then the data can be displayed. If the settings
  are wrong then it will run an error message throw Exception(&#39;Failed to load
  videos&#39;). If an error occurs, please consult in the comments column below.
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  6. Create a &lt;b&gt;detail.dart&lt;/b&gt; file in the &lt;b&gt;lib&lt;/b&gt; folder. Follow the
  script below.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;  import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:youtube_player_flutter/youtube_player_flutter.dart&#39;;
  
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;video&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;youtube_api_service&lt;/span&gt;.dart&#39;;
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; videoId;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;String&lt;/span&gt; title;
  
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;({
      required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.videoId,
      required &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;this&lt;/span&gt;.title,
    });
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;&amp;gt; createState() =&amp;gt; _DetailState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_DetailState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;Detail&amp;gt;&lt;/span&gt; &lt;/span&gt;{
    late &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerController&lt;/span&gt; _controller;
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    void initState() {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;super&lt;/span&gt;.initState();
      _controller = &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerController&lt;/span&gt;(
        initialVideoId: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayer&lt;/span&gt;.convertUrlToId(
            &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//www.youtube.com/watch?v=&#39; + widget.videoId)!,&lt;/span&gt;
        flags: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayerFlags&lt;/span&gt;(
          autoPlay: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
          mute: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;false&lt;/span&gt;,
        ),
      );
    }
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
        appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
          title: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Video&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;&#39;),
        ),
        body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;(
          children: [
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YoutubePlayer&lt;/span&gt;(
              controller: _controller,
              showVideoProgressIndicator: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
              progressIndicatorColor: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Colors&lt;/span&gt;.blueAccent,
            ),
            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
              padding: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8.0&lt;/span&gt;),
              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.start,
                crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                children: [
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                    mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.spaceBetween,
                    children: [
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;35&lt;/span&gt;,
                        height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;35&lt;/span&gt;,
                        decoration: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                          borderRadius: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BorderRadius&lt;/span&gt;.all(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Radius&lt;/span&gt;.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
                          image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DecorationImage&lt;/span&gt;(
                            fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                            image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NetworkImage&lt;/span&gt;(
                              &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;,&lt;/span&gt;
                            ),
                          ),
                        ),
                      ),
                      const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                        width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                      ),
                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                          widget.title,
                          style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                              fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;18&lt;/span&gt;, fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.w400),
                          maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                          overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                        ),
                      ),
                    ],
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;,
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                    &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;See&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Other&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Videos&lt;/span&gt;&#39;,
                    style: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;18&lt;/span&gt;, fontWeight: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FontWeight&lt;/span&gt;.w500),
                  ),
                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;15&lt;/span&gt;,
                  ),
                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt;&amp;gt;&amp;gt;(
                    future: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApiService&lt;/span&gt;().getVideos(),
                    builder: (context, snapshot) {
                      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videos = snapshot.data!;
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                          padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.zero,
                          shrinkWrap: &lt;span class=&quot;hljs-literal&quot; style=&quot;color: #6897bb;&quot;&gt;true&lt;/span&gt;,
                          physics: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NeverScrollableScrollPhysics&lt;/span&gt;(),
                          itemCount: videos.length,
                          itemBuilder: (context, index) {
                            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; video = videos[index];
                            &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                              crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                              mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.start,
                              children: [
                                &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
                                  onTap: () =&amp;gt; {
                                    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                                      context,
                                      &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                                        builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                                          videoId: video.id,
                                          title: video.title,
                                        ),
                                      ),
                                    )
                                  },
                                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListTile&lt;/span&gt;(
                                    contentPadding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.zero,
                                    leading: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                                      video.thumbnail,
                                      fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                                      width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;120&lt;/span&gt;,
                                    ),
                                    title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                      video.title,
                                      maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                      overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                    ),
                                  ),
                                ),
                                const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                                  height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;,
                                ),
                              ],
                            );
                          },
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;),
                        );
                      } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
                        &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                          child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Failed&lt;/span&gt; to load videos&#39;),
                        );
                      }
                    },
                  ),
                ],
              ),
            )
          ],
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  7. Buat file &lt;b&gt;main.dart&lt;/b&gt; di dalam folder &lt;b&gt;lib&lt;/b&gt;. Ikuti script di
  bawah ini.
&lt;/p&gt;
&lt;pre class=&quot;line-numbers language-markup&quot; data-codetype=&quot;CSSku&quot; style=&quot;background: rgb(40, 43, 46); color: #a9b7c6; display: block; overflow-x: auto; padding: 0.5em;&quot; title=&quot;Script&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:flutter/material.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;youtube_api_service&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;detail&lt;/span&gt;.dart&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;dart&lt;/span&gt;:convert&#39;;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;package&lt;/span&gt;:http/http.dart&#39; as http;
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;video&lt;/span&gt;.dart&#39;;
  
  void main() {
    runApp(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;());
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;StatefulWidget&lt;/span&gt; &lt;/span&gt;{
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;State&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MyApp&lt;/span&gt;&amp;gt; createState() =&amp;gt; _MyAppState();
  }
  
  &lt;span class=&quot;hljs-class&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;_MyAppState&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;color: #ffc66d;&quot;&gt;State&amp;lt;MyApp&amp;gt;&lt;/span&gt; &lt;/span&gt;{
  
    &lt;span class=&quot;hljs-meta&quot; style=&quot;color: #bbb529;&quot;&gt;@override&lt;/span&gt;
    &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Widget&lt;/span&gt; build(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BuildContext&lt;/span&gt; context) {
      &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialApp&lt;/span&gt;(
        home: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Scaffold&lt;/span&gt;(
          appBar: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;AppBar&lt;/span&gt;(
            title: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;YouTube&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Videos&lt;/span&gt;&#39;),
          ),
          body: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;FutureBuilder&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Video&lt;/span&gt;&amp;gt;&amp;gt;(
            future: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;YouTubeApiService&lt;/span&gt;().getVideos(),
            builder: (context, snapshot) {
              &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.connectionState == &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ConnectionState&lt;/span&gt;.waiting) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CircularProgressIndicator&lt;/span&gt;(),
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasData) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; videos = snapshot.data!;
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;ListView&lt;/span&gt;.builder(
                  itemCount: videos.length,
                  itemBuilder: (context, index) {
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;final&lt;/span&gt; video = videos[index];
                    &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;InkWell&lt;/span&gt;(
                      onTap: () {
                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Navigator&lt;/span&gt;.push(
                          context,
                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MaterialPageRoute&lt;/span&gt;(
                            builder: (context) =&amp;gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Detail&lt;/span&gt;(
                              videoId: video.id,
                              title: video.title,
                            ),
                          ),
                        );
                      },
                      child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                        child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                          crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                          children: [
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Image&lt;/span&gt;.network(
                              video.thumbnail,
                              width: double.infinity,
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;160&lt;/span&gt;,
                              fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                            ),
                            const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                              height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,
                            ),
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Padding&lt;/span&gt;(
                              padding: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;EdgeInsets&lt;/span&gt;.all(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;),
                              child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Row&lt;/span&gt;(
                                mainAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;MainAxisAlignment&lt;/span&gt;.spaceBetween,
                                children: [
                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Container&lt;/span&gt;(
                                    width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
                                    height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;45&lt;/span&gt;,
                                    decoration: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxDecoration&lt;/span&gt;(
                                      borderRadius:
                                          &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BorderRadius&lt;/span&gt;.all(&lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Radius&lt;/span&gt;.circular(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)),
                                      image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;DecorationImage&lt;/span&gt;(
                                        fit: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;BoxFit&lt;/span&gt;.cover,
                                        image: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;NetworkImage&lt;/span&gt;(
                                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;https&lt;/span&gt;:&lt;span class=&quot;hljs-comment&quot; style=&quot;color: grey;&quot;&gt;//cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_640.png&#39;,&lt;/span&gt;
                                        ),
                                      ),
                                    ),
                                  ),
                                  const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(
                                    width: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,
                                  ),
                                  &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Expanded&lt;/span&gt;(
                                    child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Column&lt;/span&gt;(
                                      crossAxisAlignment: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;CrossAxisAlignment&lt;/span&gt;.start,
                                      children: [
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                          video.title,
                                          style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,
                                          ),
                                          maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                          overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                        ),
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,),
                                        &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(
                                          &lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Channel&lt;/span&gt; : &#39;+video.channelTitle,
                                          style: const &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextStyle&lt;/span&gt;(
                                            fontSize: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;12&lt;/span&gt;,
                                          ),
                                          maxLines: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,
                                          overflow: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;TextOverflow&lt;/span&gt;.ellipsis,
                                        ),
                                      ],
                                    ),
                                  ),
                                ],
                              ),
                            ),
                            &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;SizedBox&lt;/span&gt;(height: &lt;span class=&quot;hljs-number&quot; style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,)
                          ],
                        ),
                      ),
                    );
                  },
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt; (snapshot.hasError) {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Error&lt;/span&gt;: ${snapshot.error}&#39;),
                );
              } &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #cc7832;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Center&lt;/span&gt;(
                  child: &lt;span class=&quot;hljs-type&quot; style=&quot;color: #ffc66d;&quot;&gt;Text&lt;/span&gt;(&lt;span class=&quot;hljs-symbol&quot; style=&quot;color: #6897bb;&quot;&gt;&#39;Failed&lt;/span&gt; to load videos&#39;),
                );
              }
            },
          ),
        ),
      );
    }
  }&lt;/pre&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  We have done all the steps, it&#39;s time to test it. Please run the emulator and
  if successful, the display will look like the image below.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhShUnnr8pcM_XYwfqrD23iDIzaYGzyE6jRgVli-aAGQQJ8zIyrDKiCan5O704Kz0XDUMMEhK5N5U_jzCn6R00u67pmi7cp9VnWz7Tt6K9NusTkuxFKkbtQ-4CFEZ7Y-I84pdi4UZv0UCCid0Gr1z6LMtD0nN9fFD2hmPLURFK5oaaFivDm8-bM1NTzSAug/s500/Screenshot_2023-07-02-11-31-20-52_f4d3fa9a3c0a308d2818b72ef8255e63.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cara Menampilkan Video Youtube dari API di Flutter&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhShUnnr8pcM_XYwfqrD23iDIzaYGzyE6jRgVli-aAGQQJ8zIyrDKiCan5O704Kz0XDUMMEhK5N5U_jzCn6R00u67pmi7cp9VnWz7Tt6K9NusTkuxFKkbtQ-4CFEZ7Y-I84pdi4UZv0UCCid0Gr1z6LMtD0nN9fFD2hmPLURFK5oaaFivDm8-bM1NTzSAug/s16000/Screenshot_2023-07-02-11-31-20-52_f4d3fa9a3c0a308d2818b72ef8255e63.jpg&quot; title=&quot;Cara Menampilkan Video Youtube dari API di Flutter&quot; /&gt;&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixeLsHSXe4WBPjg_7Yke-03sP5A1QBe0AfIofmEaqwFNhd6U2sIQWScnY2OI-W8j4cBqt-9JSwjvD07keEJDbA_GmIFo4DMFHFPHxKAe3XYt_PRERdORawNrqKgaydo64TNHRCnM4aobo71CuNhatQ2gUOluv-FmMrIXoq3-95wkG63toqF2Lqo_M2sPVe/s500/Screenshot_2023-07-02-11-31-26-83_f4d3fa9a3c0a308d2818b72ef8255e63.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cara Menampilkan Video Youtube dari API di Flutter&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixeLsHSXe4WBPjg_7Yke-03sP5A1QBe0AfIofmEaqwFNhd6U2sIQWScnY2OI-W8j4cBqt-9JSwjvD07keEJDbA_GmIFo4DMFHFPHxKAe3XYt_PRERdORawNrqKgaydo64TNHRCnM4aobo71CuNhatQ2gUOluv-FmMrIXoq3-95wkG63toqF2Lqo_M2sPVe/s16000/Screenshot_2023-07-02-11-31-26-83_f4d3fa9a3c0a308d2818b72ef8255e63.jpg&quot; title=&quot;Cara Menampilkan Video Youtube dari API di Flutter&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;
  That&#39;s a short tutorial on how to display YouTube videos from YouTube Api in
  Flutter. Hopefully this short tutorial is useful. If you have any questions,
  please ask directly in the comments column below. That is all and thank you.
&lt;/p&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-9737321595122081&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;4546313114&quot; data-full-width-responsive=&quot;true&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><link>https://porkaone.blogspot.com/2023/12/how-to-display-youtube-videos-from-app.html</link><author>noreply@blogger.com (sahretech)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDgjUGMa3Bl-X0_TVdJR3NfQThL4kAblba87bg-yQv9Phojui6RnVx_8AAVlvgBEPxLGz_07xReRJKljWzVooPCxO_JqB6pJR7WotjeRcL6XQAirL7p38hIvjCyvxu6MmEAFLwi_9gbLqJDEom_3gsI2AIDEHUVKHfMnlld_lIxl1FK_2d21D_ZMigBE/s72-c/How%20to%20Display%20Youtube%20Videos%20from%20Youtube%20API%20in%20Flutter.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Amerika Serikat</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>8.780006163821156 -130.869141 65.400473836178847 -60.556641</georss:box></item></channel></rss>