<?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-414846908490431988</atom:id><lastBuildDate>Thu, 12 Feb 2026 06:30:41 +0000</lastBuildDate><category>dart pattern</category><category>dart pattern program</category><category>pattern</category><category>flutter ui</category><category>number pattern</category><category>Flutter</category><category>Flutter Login and Register UI</category><category>How to use Google Fonts in Flutter with GetX</category><category>Pyramid star pattern</category><category>dart language</category><category>login ui</category><category>symbol pattern</category><category>Airbnb Style UI</category><category>Angular Introduction</category><category>Animation Using Html &amp; Css</category><category>Average of Numbers in a Given List in Python</category><category>C Introduction.C Programming This language is very easy to learn.</category><category>C++ Introduction</category><category>CRUD App in Flutter</category><category>Chunk Images Python</category><category>Chunk Images Using Python</category><category>Create an e-commerce app in Flutter.</category><category>Custom fonts with Google Fonts in Flutter</category><category>DBMS Introduction | What is DBMS</category><category>DS (Data Structure) Introduction | What is DS.</category><category>Dart 3.10</category><category>Dart 3.5 updates</category><category>Dart Update</category><category>Digital Clock with Colorful Glowing Effect</category><category>Dropdown in Flutter Example Code</category><category>Flutter 3.24</category><category>Flutter 3.24 DevTools enhancements</category><category>Flutter 3.24 features</category><category>Flutter 3.24 new widgets</category><category>Flutter 3.24 release</category><category>Flutter 3.38</category><category>Flutter 3.41</category><category>Flutter 3.41 features</category><category>Flutter 3.41 release</category><category>Flutter Android iOS connectivity</category><category>Flutter App Design</category><category>Flutter CRUD Example</category><category>Flutter CRUD Operations</category><category>Flutter Database Example</category><category>Flutter DevTools</category><category>Flutter File Picker</category><category>Flutter GetX url_launcher</category><category>Flutter Google Fonts GetX</category><category>Flutter Google Fonts GetX tutorial</category><category>Flutter Local Notifications Using GetX: Step-by-Step Setup with Code</category><category>Flutter OTP screen example</category><category>Flutter OTP screen tutorial</category><category>Flutter Performance</category><category>Flutter Result Screen</category><category>Flutter SQLite Database Tutorial</category><category>Flutter Search UI</category><category>Flutter Travel App</category><category>Flutter Tutorial</category><category>Flutter UI Design</category><category>Flutter Update</category><category>Flutter camera and gallery image picker tutorial</category><category>Flutter code example shared pref</category><category>Flutter image picker GetX example</category><category>Flutter latest version</category><category>Flutter network connectivity</category><category>Flutter release notes</category><category>Flutter shared preferences example</category><category>Flutter update 2026</category><category>Flutter url_launcher example with GetX</category><category>GetX OTP verification Flutter</category><category>GetX state management</category><category>GetX with connectivity_plus</category><category>Glowing 3D Text Using Html and Css.</category><category>Glowing Dots Loading Animation</category><category>Google Fonts Flutter example</category><category>GraphQL tutorial for Flutter&#xa;GraphQL vs REST API&#xa;Flutter GetX GraphQL example&#xa;Real-time subscriptions in GraphQL&#xa;GraphQL mutations and queries</category><category>Handle offline in Flutter</category><category>How to Build CRUD in Flutter</category><category>How to Create a Dropdown in Flutter</category><category>How to Merge Images in Python</category><category>How to Use Cached Network Image in Flutter with GetX</category><category>How to share content in Flutter using share_plus</category><category>How to use image_picker in Flutter with GetX</category><category>How to use local push notification in flutter using getx</category><category>How to use share_plus</category><category>Image Slider With Animation Using HTML And CSS</category><category>Image marge in pytthon</category><category>Implementing content sharing in Flutter with share_plus and GetX</category><category>Introduction for Python.</category><category>JSP Introduction | What is JSP</category><category>JSTL Introduction | What is JSTL</category><category>Java Introduction</category><category>Login</category><category>Mobile App Design</category><category>Mobile App UI</category><category>OTP validation Flutter GetX</category><category>Open website from Flutter app using GetX</category><category>Pattern program in C</category><category>Php Introduction</category><category>Python Automation</category><category>Python Image Processing</category><category>Python Program Colored Tree Using Turtle</category><category>Python Program Rainbow Using Turtle</category><category>Python Program Triangle Using Turtle</category><category>Python Program for wikipedia</category><category>Python Program to Swap Two Variables</category><category>Python program check vowel or consonant</category><category>R Introduction</category><category>Random Password Generator using Python</category><category>SQL Introduction</category><category>SQLite CRUD Operations.</category><category>SQLite CRUD in Flutter</category><category>Sandglass Star Pattern</category><category>Scratch Card In Flutter</category><category>Sign Up UI</category><category>Sign in</category><category>Slider in flutter</category><category>Social Media Buttons</category><category>Swift Introducation | What is Swift</category><category>The &lt;a href&gt; attribute refers to a destination provided by a link.</category><category>Timer in OTP screen Flutter</category><category>Travel App UI</category><category>Using url_launcher with GetX in Flutter</category><category>Visual Basic .NET Introduction | What is Visual Basic .NET Introduction</category><category>WebP Image Compression</category><category>What Is Flutter</category><category>What is Dropdown</category><category>What is GraphQL</category><category>What is Programming ?</category><category>What’s New in Flutter 3.41</category><category>calculator using flutter</category><category>connectivity_plus Flutter</category><category>dart</category><category>dart programming language</category><category>file picker flutter</category><category>file picker plugin</category><category>file_pick</category><category>flutter app</category><category>flutter calculator app</category><category>flutter file picker example</category><category>flutter file picker get extension</category><category>flutter file_picker</category><category>flutter internet connection checker</category><category>flutter scratch card</category><category>flutter scratcher</category><category>flutter scratcher package</category><category>flutter scratcher widget</category><category>forgot screen</category><category>google_fonts Flutter</category><category>half pyramid</category><category>how to image chunk using python</category><category>how to make scratcher</category><category>how to pick file</category><category>image chunk in python</category><category>image in flutter</category><category>image picker</category><category>image picker GetX Flutter</category><category>image picker tutorial Flutter</category><category>introduction dart</category><category>left triangle</category><category>local storage Flutter GetX</category><category>login and signup form</category><category>login form</category><category>login in flutter</category><category>login validation</category><category>multiple image marge in python</category><category>printphalfpatternpiramid</category><category>register form</category><category>register in flutter</category><category>register ui</category><category>registration ui</category><category>save data in Flutter with shared preferences</category><category>share_plus package Flutter</category><category>shared pref in Flutter</category><category>shared preferences with GetX Flutter</category><category>sign in design flutter</category><category>sign up design</category><category>star pattern</category><category>validation</category><category>what is dart</category><title>Codes With Sunny</title><description>Welcome to Codes With Sunny! Explore a rich collection of programming languages, including C, Python, Java, C++, HTML, and CSS. Our blog offers comprehensive tutorials, source code examples, and practical projects to enhance your coding skills. Whether you&#39;re a beginner or an experienced programmer, find the best solutions and learning resources tailored to your needs. Join our community and start your coding journey today!</description><link>https://codeswithsunny.blogspot.com/</link><managingEditor>noreply@blogger.com (Sunny Singh)</managingEditor><generator>Blogger</generator><openSearch:totalResults>75</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7604356811169578956</guid><pubDate>Thu, 12 Feb 2026 06:30:00 +0000</pubDate><atom:updated>2026-02-12T12:00:41.513+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter 3.41</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.41 features</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.41 release</category><category domain="http://www.blogger.com/atom/ns#">Flutter latest version</category><category domain="http://www.blogger.com/atom/ns#">Flutter release notes</category><category domain="http://www.blogger.com/atom/ns#">Flutter update 2026</category><category domain="http://www.blogger.com/atom/ns#">What’s New in Flutter 3.41</category><title>What’s New in Flutter 3.41</title><description>&lt;span style=&quot;font-family: times;&quot;&gt;Flutter 3.41 is now officially released by the Flutter team!
This update focuses on community-driven improvements, transparency, modularity, platform polish, new APIs, and tooling enhancements — all designed to make Flutter more adaptable, faster, and easier to contribute to.&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGF5I_Khl6vOdShEN-sQncwOIvCQ0T-nu1zZhP4dH9W8W1AB_ol7DlTEITi8KXAwbxKt_4AO8dUAS5xfpklaTtMdhKRU8joC3zw5dZDRZ1ea4wFFlEtBifPVP1FxJ1MlcclyWsz0BjHlAC7fR37ZM6kQsXRoj5oI3xytBG59EvkKQRS8U7-zgp6ObhhA5u/s1280/flutter%203_41.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img alt=&quot;What’s New in Flutter 3.41&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGF5I_Khl6vOdShEN-sQncwOIvCQ0T-nu1zZhP4dH9W8W1AB_ol7DlTEITi8KXAwbxKt_4AO8dUAS5xfpklaTtMdhKRU8joC3zw5dZDRZ1ea4wFFlEtBifPVP1FxJ1MlcclyWsz0BjHlAC7fR37ZM6kQsXRoj5oI3xytBG59EvkKQRS8U7-zgp6ObhhA5u/s16000/flutter%203_41.png&quot; title=&quot;What’s New in Flutter 3.41&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Introduction — Flutter 3.41 Overview&lt;/h2&gt;&lt;div&gt;&lt;p data-end=&quot;1198&quot; data-start=&quot;872&quot;&gt;Flutter 3.41 marks a &lt;strong data-end=&quot;966&quot; data-start=&quot;893&quot;&gt;major step forward in how Flutter evolves as an open-source framework&lt;/strong&gt;. Instead of focusing on one big feature, this release brings structural improvements that empower contributors, improve platform integrations, reduce app size, and enhance developer experience. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;1340&quot; data-start=&quot;1200&quot;&gt;This release has &lt;strong data-end=&quot;1261&quot; data-start=&quot;1217&quot;&gt;868 commits from 145 unique contributors&lt;/strong&gt;, showing strong community participation.&lt;/p&gt;&lt;p data-end=&quot;1340&quot; data-start=&quot;1200&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 data-end=&quot;1392&quot; data-start=&quot;1347&quot;&gt;1. Structural Transparency &amp;amp; Modularity&lt;/h2&gt;&lt;h3 data-end=&quot;1430&quot; data-start=&quot;1394&quot;&gt;🗓 Public Stable Release Windows&lt;/h3&gt;&lt;p data-end=&quot;1563&quot; data-start=&quot;1432&quot;&gt;Flutter is introducing &lt;strong data-end=&quot;1481&quot; data-start=&quot;1455&quot;&gt;public release windows&lt;/strong&gt; to give the community clear visibility into when changes land in stable releases.&lt;/p&gt;&lt;p data-end=&quot;1607&quot; data-start=&quot;1565&quot;&gt;📌 Planned 2026 stable release schedule:&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong data-end=&quot;1637&quot; data-start=&quot;1610&quot;&gt;Flutter 3.41 — February&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong data-end=&quot;1664&quot; data-start=&quot;1642&quot;&gt;Flutter 3.44 — May&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong data-end=&quot;1694&quot; data-start=&quot;1669&quot;&gt;Flutter 3.47 — August&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong data-end=&quot;1726&quot; data-start=&quot;1699&quot;&gt;Flutter 3.50 — November&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p data-end=&quot;1340&quot; data-start=&quot;1200&quot;&gt;




&lt;/p&gt;&lt;p data-end=&quot;1843&quot; data-start=&quot;1766&quot;&gt;This lets developers plan ahead and target specific releases with confidence.&lt;/p&gt;&lt;h3 data-end=&quot;1894&quot; data-start=&quot;1850&quot;&gt;Decoupling Flutter’s Design Libraries&lt;/h3&gt;&lt;p data-end=&quot;2022&quot; data-start=&quot;1896&quot;&gt;Flutter continues its push to separate &lt;strong data-end=&quot;1947&quot; data-start=&quot;1935&quot;&gt;Material&lt;/strong&gt; and &lt;strong data-end=&quot;1965&quot; data-start=&quot;1952&quot;&gt;Cupertino&lt;/strong&gt; design libraries into independent packages. This change:&lt;/p&gt;&lt;p data-end=&quot;1843&quot; data-start=&quot;1766&quot;&gt;

&lt;/p&gt;&lt;p data-end=&quot;2315&quot; data-start=&quot;2024&quot;&gt;✔ Enables &lt;strong data-end=&quot;2066&quot; data-start=&quot;2034&quot;&gt;faster design system updates&lt;/strong&gt;&lt;br data-end=&quot;2069&quot; data-start=&quot;2066&quot; /&gt;
✔ Lets developers upgrade design libraries without upgrading the full Flutter SDK&lt;br data-end=&quot;2153&quot; data-start=&quot;2150&quot; /&gt;
✔ Helps the framework adapt quickly to platform UI trends (e.g., Material 3 expressive or future iOS design language shifts)&lt;/p&gt;&lt;h2 data-end=&quot;2373&quot; data-start=&quot;2322&quot;&gt;2. Ecosystem Standards &amp;amp; Platform Integration&lt;/h2&gt;&lt;h3 data-end=&quot;2419&quot; data-start=&quot;2375&quot;&gt;📦 Swift Package Manager &amp;amp; iOS Lifecycle&lt;/h3&gt;&lt;p data-end=&quot;2315&quot; data-start=&quot;2024&quot;&gt;

&lt;/p&gt;&lt;p data-end=&quot;2724&quot; data-start=&quot;2421&quot;&gt;Flutter now encourages plugin authors to switch from &lt;strong data-end=&quot;2512&quot; data-start=&quot;2474&quot;&gt;CocoaPods to Swift Package Manager&lt;/strong&gt;, which aligns with the future direction of iOS. The framework also &lt;strong data-end=&quot;2620&quot; data-start=&quot;2580&quot;&gt;fully supports the UIScene lifecycle&lt;/strong&gt; on iOS — modernizing app management for future Apple OS versions.&lt;/p&gt;&lt;h3 data-end=&quot;2772&quot; data-start=&quot;2731&quot;&gt;Android Gradle Plugin &amp;amp; Kotlin DSL&lt;/h3&gt;
&lt;p data-end=&quot;2836&quot; data-start=&quot;2774&quot;&gt;Flutter 3.41 continues to align with modern Android standards.&lt;/p&gt;
&lt;p data-end=&quot;3087&quot; data-start=&quot;2838&quot;&gt;⚠ Important Note (official):&lt;br data-end=&quot;2869&quot; data-start=&quot;2866&quot; /&gt;
→ Android Gradle Plugin (AGP) 9 support is being audited for backwards compatibility.&lt;br data-end=&quot;2957&quot; data-start=&quot;2954&quot; /&gt;
If your app or plugins depend on AGP 9 right now, this support is &lt;em data-end=&quot;3048&quot; data-start=&quot;3023&quot;&gt;not yet fully available&lt;/em&gt;. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;2724&quot; data-start=&quot;2421&quot;&gt;Flutter also promotes the &lt;strong data-end=&quot;3147&quot; data-start=&quot;3115&quot;&gt;Kotlin DSL for Gradle builds&lt;/strong&gt;, improving build clarity and flexibility.&lt;/p&gt;&lt;h2 data-end=&quot;3273&quot; data-start=&quot;3234&quot;&gt;3. Asset &amp;amp; Platform Optimizations&lt;/h2&gt;
&lt;h3 data-end=&quot;3314&quot; data-start=&quot;3275&quot;&gt;🎯 Platform-Specific Asset Bundling&lt;/h3&gt;
&lt;p data-end=&quot;3442&quot; data-start=&quot;3316&quot;&gt;Flutter now enables developers to specify which platforms should include certain assets using &lt;code data-end=&quot;3424&quot; data-start=&quot;3410&quot;&gt;pubspec.yaml&lt;/code&gt;. This results in:&lt;/p&gt;
&lt;p data-end=&quot;3592&quot; data-start=&quot;3444&quot;&gt;✔ Smaller app sizes&lt;br data-end=&quot;3466&quot; data-start=&quot;3463&quot; /&gt;
✔ Faster build times&lt;br data-end=&quot;3489&quot; data-start=&quot;3486&quot; /&gt;
✔ Better resource management for mobile, desktop, and web targets &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;2724&quot; data-start=&quot;2421&quot;&gt;Example:&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt; flutter:
  assets:
    - path: assets/logo.png
    - path: assets/web_worker.js
      platforms: [web]
    - path: assets/desktop_icon.png
      platforms: [windows, linux, macos]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 data-end=&quot;3749&quot; data-start=&quot;3712&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 data-end=&quot;3749&quot; data-start=&quot;3712&quot;&gt;4. Framework &amp;amp; API Improvements&lt;/h2&gt;
&lt;h3 data-end=&quot;3783&quot; data-start=&quot;3751&quot;&gt;🌀 RepeatingAnimationBuilder&lt;/h3&gt;
&lt;p data-end=&quot;3975&quot; data-start=&quot;3785&quot;&gt;A new animation primitive allows continuous looping animations (like loading indicators or shimmer effects) without boilerplate animation controllers. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;3991&quot; data-start=&quot;3977&quot;&gt;Example usage:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; RepeatingAnimationBuilder&lt;offset&gt;(
  animatable: Tween(begin: Offset(-1,0), end: Offset(1,0)),
  repeatMode: RepeatMode.reverse,
  duration: Duration(seconds: 1),
  builder: (context, offset, child) =&amp;gt; FractionalTranslation(
    translation: offset, child: child,
  ),
  child: const ColoredBox(color: Colors.green),
 ),
&lt;/offset&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;4407&quot; data-start=&quot;4324&quot;&gt;This greatly simplifies common UI patterns. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;4456&quot; data-start=&quot;4414&quot;&gt;🪟 Navigation &amp;amp; Scrolling Enhancements&lt;/h3&gt;
&lt;p data-end=&quot;4513&quot; data-start=&quot;4458&quot;&gt;Flutter 3.41 introduces new navigation utility methods:&lt;/p&gt;
&lt;p data-end=&quot;4697&quot; data-start=&quot;4515&quot;&gt;✔ &lt;code data-end=&quot;4547&quot; data-start=&quot;4517&quot;&gt;Navigator.popUntilWithResult&lt;/code&gt; — Pop screens while returning values&lt;br data-end=&quot;4587&quot; data-start=&quot;4584&quot; /&gt;
✔ Improved overscroll and fling behaviors for smoother UI interactions &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;4758&quot; data-start=&quot;4699&quot;&gt;This benefits complex app flows with multi-step navigation.&lt;/p&gt;&lt;h2 data-end=&quot;4804&quot; data-start=&quot;4765&quot;&gt;5. Platform Fidelity Improvements&lt;/h2&gt;&lt;h3 data-end=&quot;4830&quot; data-start=&quot;4806&quot;&gt;🍎 iOS Visual Polish&lt;/h3&gt;&lt;p data-end=&quot;5003&quot; data-start=&quot;4832&quot;&gt;Flutter improves the &lt;strong data-end=&quot;4875&quot; data-start=&quot;4853&quot;&gt;bounded blur style&lt;/strong&gt; to reduce color bleeding in translucent elements, resulting in smoother visuals on iOS. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 data-end=&quot;5044&quot; data-start=&quot;5005&quot;&gt;🧲 Drag Handling &amp;amp; Desktop Behavior&lt;/h3&gt;&lt;p data-end=&quot;4758&quot; data-start=&quot;4699&quot;&gt;



&lt;/p&gt;&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;New API improvements for drag handle behavior on sheets and desktop UI components give a more native feel across platforms.&lt;/p&gt;&lt;h3 data-end=&quot;5242&quot; data-start=&quot;5216&quot;&gt;Add-to-App Resizing&lt;/h3&gt;
&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;Improvement in &lt;strong data-end=&quot;5273&quot; data-start=&quot;5259&quot;&gt;Add-to-App&lt;/strong&gt; (embedding Flutter in native apps) automatically resizes Flutter views based on content — no need for fixed container sizes. This is especially useful for hybrid-native workflows.&lt;/p&gt;&lt;h2 data-end=&quot;5540&quot; data-start=&quot;5500&quot;&gt;6. Accessibility &amp;amp; Web Enhancements&lt;/h2&gt;
&lt;h3 data-end=&quot;5575&quot; data-start=&quot;5542&quot;&gt;🧩 Accessibility Improvements&lt;/h3&gt;
&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;Flutter 3.41 adds native accessibility support for indicators like &lt;strong data-end=&quot;5673&quot; data-start=&quot;5644&quot;&gt;CircularProgressIndicator&lt;/strong&gt; and respects user text spacing overrides on web — improving inclusive UX.&lt;/p&gt;&lt;h2 data-end=&quot;5825&quot; data-start=&quot;5794&quot;&gt;7. DevTools &amp;amp; Performance&lt;/h2&gt;
&lt;h3 data-end=&quot;5860&quot; data-start=&quot;5827&quot;&gt;🐞 DevTools Performance Boost&lt;/h3&gt;
&lt;p data-end=&quot;6028&quot; data-start=&quot;5862&quot;&gt;Flutter DevTools are now compiled with &lt;strong data-end=&quot;5914&quot; data-start=&quot;5901&quot;&gt;dart2wasm&lt;/strong&gt;, improving performance and responsiveness during profiling and debugging. &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;Automatic retry on dropped connections also smooths the debugging workflow.&lt;/p&gt;&lt;h2 data-end=&quot;6193&quot; data-start=&quot;6152&quot;&gt;Key Takeaways — Should You Upgrade?&lt;/h2&gt;
&lt;h3 data-end=&quot;6216&quot; data-start=&quot;6195&quot;&gt;👍 Why You Should&lt;/h3&gt;
&lt;p data-end=&quot;6469&quot; data-start=&quot;6218&quot;&gt;✔ Improved contribution experience&lt;br data-end=&quot;6255&quot; data-start=&quot;6252&quot; /&gt;
✔ Modular design libraries&lt;br data-end=&quot;6284&quot; data-start=&quot;6281&quot; /&gt;
✔ More predictable release cadence&lt;br data-end=&quot;6321&quot; data-start=&quot;6318&quot; /&gt;
✔ Better asset optimization&lt;br data-end=&quot;6351&quot; data-start=&quot;6348&quot; /&gt;
✔ Animation and navigation enhancements&lt;br data-end=&quot;6393&quot; data-start=&quot;6390&quot; /&gt;
✔ Accessibility and web improvements &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;This release is especially strong for teams working on long-term projects that value &lt;strong data-end=&quot;6589&quot; data-start=&quot;6556&quot;&gt;stability and maintainability&lt;/strong&gt;.&amp;nbsp;&lt;/p&gt;&lt;h2 data-end=&quot;6643&quot; data-start=&quot;6597&quot;&gt;Conclusion — Flutter 3.41 in Perspective&lt;/h2&gt;&lt;p data-end=&quot;6824&quot; data-start=&quot;6645&quot;&gt;Flutter 3.41 is less about flashy new UI components and more about &lt;strong data-end=&quot;6759&quot; data-start=&quot;6712&quot;&gt;structural evolution and ecosystem maturity&lt;/strong&gt;.&lt;br data-end=&quot;6763&quot; data-start=&quot;6760&quot; /&gt;
It empowers both app developers and contributors by offering:&lt;/p&gt;&lt;p data-end=&quot;7036&quot; data-start=&quot;6826&quot;&gt;🔹 Transparency in release planning&lt;br data-end=&quot;6864&quot; data-start=&quot;6861&quot; /&gt;
🔹 Modular design systems&lt;br data-end=&quot;6892&quot; data-start=&quot;6889&quot; /&gt;
🔹 Deeper platform integrations&lt;br data-end=&quot;6926&quot; data-start=&quot;6923&quot; /&gt;
🔹 Better performance tools&lt;br data-end=&quot;6956&quot; data-start=&quot;6953&quot; /&gt;
🔹 Strong community contribution support &lt;span data-state=&quot;closed&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-end=&quot;5209&quot; data-start=&quot;5046&quot;&gt;


&lt;/p&gt;&lt;p data-end=&quot;7181&quot; data-start=&quot;7038&quot;&gt;This release signals confidence in &lt;strong data-end=&quot;7104&quot; data-start=&quot;7073&quot;&gt;Flutter’s long-term roadmap&lt;/strong&gt; → one that’s more open, predictable, and developer-centric than ever before.&lt;/p&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2026/02/whats-new-in-flutter-3-41.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGF5I_Khl6vOdShEN-sQncwOIvCQ0T-nu1zZhP4dH9W8W1AB_ol7DlTEITi8KXAwbxKt_4AO8dUAS5xfpklaTtMdhKRU8joC3zw5dZDRZ1ea4wFFlEtBifPVP1FxJ1MlcclyWsz0BjHlAC7fR37ZM6kQsXRoj5oI3xytBG59EvkKQRS8U7-zgp6ObhhA5u/s72-c/flutter%203_41.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7281308327525839147</guid><pubDate>Fri, 19 Dec 2025 11:10:00 +0000</pubDate><atom:updated>2025-12-19T16:40:57.902+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter Result Screen</category><category domain="http://www.blogger.com/atom/ns#">Flutter Search UI</category><category domain="http://www.blogger.com/atom/ns#">Flutter Travel App</category><category domain="http://www.blogger.com/atom/ns#">Flutter Tutorial</category><category domain="http://www.blogger.com/atom/ns#">flutter ui</category><category domain="http://www.blogger.com/atom/ns#">Flutter UI Design</category><category domain="http://www.blogger.com/atom/ns#">Mobile App Design</category><title>Flutter Travel Search &amp; Result UI Design – Step-by-Step Guide with Source Code</title><description>&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/b/R29vZ2xl/AVvXsEjBhzppaFhXH87MFBGESFhs1WO0SFin-7nu2FDMUwDAkwpEB2FfEJc9ANQQ2pxPABRsEQzzcV4nK7ddRaORvwjBlyNfKA5HapTQttvN8al18nI9NNFaiZIfbtfL-hY9Fdl_BTcZffHPyUYt8Y_0HmDNuqlTwHSve4aa5xgXGJorzvr7Xl-LxuF94OsuCCIA/s1536/flutter-travel-search-result-ui.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Travel Search and Result UI Design&quot; border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBhzppaFhXH87MFBGESFhs1WO0SFin-7nu2FDMUwDAkwpEB2FfEJc9ANQQ2pxPABRsEQzzcV4nK7ddRaORvwjBlyNfKA5HapTQttvN8al18nI9NNFaiZIfbtfL-hY9Fdl_BTcZffHPyUYt8Y_0HmDNuqlTwHSve4aa5xgXGJorzvr7Xl-LxuF94OsuCCIA/s16000/flutter-travel-search-result-ui.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;h2 data-end=&quot;1287&quot; data-start=&quot;1226&quot;&gt;Flutter Travel Search &amp;amp; Result UI Design (Step-by-Step)&lt;/h2&gt;&lt;p data-end=&quot;1440&quot; data-start=&quot;1289&quot;&gt;Flutter is a powerful UI framework that allows developers to build &lt;strong data-end=&quot;1415&quot; data-start=&quot;1356&quot;&gt;beautiful, fast, and cross-platform mobile applications&lt;/strong&gt; using a single codebase.&lt;/p&gt;&lt;p&gt;

&lt;/p&gt;&lt;p data-end=&quot;1660&quot; data-start=&quot;1442&quot;&gt;In this tutorial, we will create a &lt;strong data-end=&quot;1514&quot; data-start=&quot;1477&quot;&gt;Flutter Travel Search &amp;amp; Result UI&lt;/strong&gt; inspired by modern travel apps like &lt;strong data-end=&quot;1585&quot; data-start=&quot;1551&quot;&gt;Airbnb, Booking.com, and Agoda&lt;/strong&gt;.&lt;br data-end=&quot;1589&quot; data-start=&quot;1586&quot; /&gt;
This UI is perfect for hotel booking, rental, and travel planning apps.&lt;/p&gt;&lt;p data-end=&quot;1660&quot; data-start=&quot;1442&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 data-end=&quot;1708&quot; data-start=&quot;1667&quot;&gt;Features of Flutter Travel Search UI&lt;/h2&gt;&lt;p data-end=&quot;1660&quot; data-start=&quot;1442&quot;&gt;
&lt;/p&gt;&lt;p data-end=&quot;1944&quot; data-start=&quot;1710&quot;&gt;✔ Modern &amp;amp; clean UI design&lt;br data-end=&quot;1739&quot; data-start=&quot;1736&quot; /&gt;
✔ Travel category selection (Trip, Staycation, Long Stay)&lt;br data-end=&quot;1799&quot; data-start=&quot;1796&quot; /&gt;
✔ Date selection layout&lt;br data-end=&quot;1825&quot; data-start=&quot;1822&quot; /&gt;
✔ Price range slider&lt;br data-end=&quot;1848&quot; data-start=&quot;1845&quot; /&gt;
✔ Travel search result listing&lt;br data-end=&quot;1881&quot; data-start=&quot;1878&quot; /&gt;
✔ Reusable Flutter widgets&lt;br data-end=&quot;1910&quot; data-start=&quot;1907&quot; /&gt;
✔ Beginner-friendly UI structure&lt;/p&gt;&lt;p data-end=&quot;1944&quot; data-start=&quot;1710&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 data-end=&quot;2008&quot; data-start=&quot;1978&quot;&gt;1. Travel Search Screen&lt;/h3&gt;&lt;p data-end=&quot;2054&quot; data-start=&quot;2009&quot;&gt;The &lt;strong data-end=&quot;2037&quot; data-start=&quot;2013&quot;&gt;Travel Search Screen&lt;/strong&gt; allows users to:&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Select destination&lt;/li&gt;&lt;li&gt;Choose travel category&lt;/li&gt;&lt;li&gt;Pick date range&lt;/li&gt;&lt;li&gt;Set budget using price slider&lt;/li&gt;&lt;li&gt;Tap on &lt;strong data-end=&quot;2185&quot; data-start=&quot;2168&quot;&gt;Search &amp;amp; Find&lt;/strong&gt; button&lt;/li&gt;&lt;/ol&gt;&lt;p data-end=&quot;1944&quot; data-start=&quot;1710&quot;&gt;


&lt;/p&gt;&lt;p data-end=&quot;2254&quot; data-start=&quot;2196&quot;&gt;This screen focuses on &lt;strong data-end=&quot;2253&quot; data-start=&quot;2219&quot;&gt;user experience and simplicity&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;2254&quot; data-start=&quot;2196&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 data-end=&quot;2298&quot; data-start=&quot;2261&quot;&gt;2. Travel Search Result Screen&lt;/h3&gt;&lt;p data-end=&quot;2330&quot; data-start=&quot;2299&quot;&gt;After searching, users can see:&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Hotel / stay listing&lt;/li&gt;&lt;li&gt;Price per month&lt;/li&gt;&lt;li&gt;Distance from destination&lt;/li&gt;&lt;li&gt;Ratings and reviews&lt;/li&gt;&lt;li&gt;Card-based modern layout&lt;/li&gt;&lt;/ol&gt;&lt;p data-end=&quot;2254&quot; data-start=&quot;2196&quot;&gt;


&lt;/p&gt;&lt;p data-end=&quot;2516&quot; data-start=&quot;2460&quot;&gt;This screen is optimized for &lt;strong data-end=&quot;2515&quot; data-start=&quot;2489&quot;&gt;real-world travel apps&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;2516&quot; data-start=&quot;2460&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 data-end=&quot;2555&quot; data-start=&quot;2523&quot;&gt;Flutter UI Design Approach&lt;/h2&gt;&lt;p data-end=&quot;2590&quot; data-start=&quot;2557&quot;&gt;To build this Flutter UI, we use:&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;code data-end=&quot;2604&quot; data-start=&quot;2594&quot;&gt;&lt;b&gt;Scaffold&lt;/b&gt;&lt;/code&gt; for page structure&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;code data-end=&quot;2636&quot; data-start=&quot;2628&quot;&gt;Column&lt;/code&gt; &amp;amp; &lt;code data-end=&quot;2644&quot; data-start=&quot;2639&quot;&gt;Row&lt;/code&gt;&lt;/b&gt; for layout&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;2671&quot; data-start=&quot;2660&quot;&gt;&lt;b&gt;Container&lt;/b&gt;&lt;/code&gt; with &lt;code data-end=&quot;2692&quot; data-start=&quot;2677&quot;&gt;BoxDecoration&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;2715&quot; data-start=&quot;2697&quot;&gt;&lt;b&gt;ListView.builder&lt;/b&gt;&lt;/code&gt; for results&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;2745&quot; data-start=&quot;2732&quot;&gt;&lt;b&gt;RangeSlider&lt;/b&gt;&lt;/code&gt; for price filter&lt;/li&gt;&lt;li&gt;Custom reusable &lt;b&gt;widgets&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p data-end=&quot;2516&quot; data-start=&quot;2460&quot;&gt;


&lt;/p&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;This approach keeps the code &lt;strong data-end=&quot;2860&quot; data-start=&quot;2823&quot;&gt;clean, scalable, and maintainable&lt;/strong&gt;.&lt;/p&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;&lt;b&gt;Flutter Travel Search UI&lt;/b&gt;&lt;/p&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:flutter_svg/svg.dart&#39;;
import &#39;package:intl/intl.dart&#39;;


class FindHousingScreen extends StatefulWidget {
  const FindHousingScreen({Key? key}) : super(key: key);

  @override
  State&lt;findhousingscreen&gt; createState() =&amp;gt; _FindHousingScreenState();
}

class _FindHousingScreenState extends State&lt;findhousingscreen&gt; {
  RangeValues priceRange = const RangeValues(20, 250);
  int selectedCategory = 0;
  DateTimeRange? selectedDateRange;

  String getDateRangeText() {
    if (selectedDateRange == null) {
      return &#39;23 - 25 November 2021  (3 days)&#39;;
    }
    final start = DateFormat(&#39;dd MMM yyyy&#39;).format(selectedDateRange!.start);
    final end = DateFormat(&#39;dd MMM yyyy&#39;).format(selectedDateRange!.end);
    final days = selectedDateRange!.duration.inDays + 1;
    return &#39;$start - $end  ($days days)&#39;;
  }

  Future&lt;void&gt; selectDateRange() async {
    final DateTimeRange? picked = await showDateRangePicker(
      context: context,
      firstDate: DateTime.now(),
      lastDate: DateTime.now().add(const Duration(days: 365)),
      initialDateRange:
          selectedDateRange ??
          DateTimeRange(
            start: DateTime.now(),
            end: DateTime.now().add(const Duration(days: 2)),
          ),
      builder: (context, child) {
        return Theme(
          data: Theme.of(context).copyWith(
            colorScheme: const ColorScheme.light(
              primary: Color(0xFFFF8C42),
              // selected date and header
              onPrimary: Colors.white,
              surface: Colors.white,
              // calendar surface
              background: Colors.white,
              // full background
              onSurface: Colors.black87,
              surfaceVariant: Colors.white,
              // month grid bg
              onSurfaceVariant: Colors.black87,
            ),
            scaffoldBackgroundColor: Colors.white,
            dialogBackgroundColor: Colors.white,
            canvasColor: Colors.white,
            textButtonTheme: TextButtonThemeData(
              style: TextButton.styleFrom(foregroundColor: Color(0xFFFF8C42)),
            ),
          ),
          child: child!,
        );
      },
    );

    if (picked != null) {
      setState(() {
        selectedDateRange = picked;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios, size: 20, color: Colors.black),
          onPressed: () {},
        ),
        title: const Text(
          &#39;Find housing&#39;,
          style: TextStyle(
            fontSize: 24,
            fontWeight: FontWeight.bold,
            color: Colors.black,
          ),
        ),
      ),
      body: SafeArea(
        child: Center(
          child: Padding(
            padding: const EdgeInsets.only(left: 15.0, right: 15),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                const SizedBox(height: 20),

                // Destination
                const Text(
                  &#39;Destination&#39;,
                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
                ),
                const SizedBox(height: 12),
                Container(
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(12),
                    boxShadow: [
                      BoxShadow(
                        color: Colors.black.withOpacity(0.18),
                        offset: const Offset(4, 4),
                        blurRadius: 8,
                      ),
                      BoxShadow(
                        color: Colors.orange.withOpacity(0.05),
                        offset: const Offset(-3, -3),
                        blurRadius: 6,
                      ),
                    ],
                  ),
                  child: Padding(
                    padding: const EdgeInsets.all(15.0),
                    child: Row(
                      children: [
                        Container(
                          width: 50,
                          height: 50,
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(8),
                            image: const DecorationImage(
                              image: NetworkImage(
                                &#39;https://images.unsplash.com/photo-1555881400-74d7acaacd8b?w=100&amp;amp;h=100&amp;amp;fit=crop&#39;,
                              ),
                              fit: BoxFit.cover,
                            ),
                          ),
                        ),
                        const SizedBox(width: 12),
                        const Expanded(
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                &#39;Squid Tower Building&#39;,
                                style: TextStyle(
                                  fontSize: 15,
                                  fontWeight: FontWeight.w600,
                                ),
                              ),
                              SizedBox(height: 4),
                              Text(
                                &#39;Jl. Kembang Melati 123 A, South Jakarta&#39;,
                                style: TextStyle(
                                  fontSize: 12,
                                  color: Colors.grey,
                                ),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
                const SizedBox(height: 24),

                // Travel categories
                const Text(
                  &#39;Travel categories&#39;,
                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
                ),
                const SizedBox(height: 12),
                Container(
                  decoration: BoxDecoration(
                    border: Border.all(color: Colors.grey.shade300),
                    borderRadius: BorderRadius.circular(12),
                  ),
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        buildCategoryButton(&#39;Trip&#39;, 0),
                        const SizedBox(width: 8),
                        buildCategoryButton(&#39;Staycation&#39;, 1),
                        const SizedBox(width: 8),
                        buildCategoryButton(&#39;Stay long&#39;, 2),
                      ],
                    ),
                  ),
                ),
                const SizedBox(height: 8),
                const Text(
                  &#39;Trip category: &amp;lt; 7 days&#39;,
                  style: TextStyle(fontSize: 12, color: Colors.grey),
                ),
                const SizedBox(height: 24),

                // Date arrival and check-in with Calendar
                const Text(
                  &#39;Date arrival &amp;amp; check-in&#39;,
                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
                ),
                const SizedBox(height: 12),
                InkWell(
                  onTap: selectDateRange,
                  borderRadius: BorderRadius.circular(12),
                  child: Container(
                    padding: const EdgeInsets.symmetric(
                      horizontal: 16,
                      vertical: 14,
                    ),
                    decoration: BoxDecoration(
                      border: Border.all(color: Colors.grey.shade300),
                      borderRadius: BorderRadius.circular(12),
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Expanded(
                          child: Text(
                            getDateRangeText(),
                            style: const TextStyle(
                              fontSize: 14,
                              color: Colors.black87,
                            ),
                          ),
                        ),
                        Icon(
                          Icons.calendar_today,
                          size: 18,
                          color: Colors.grey.shade600,
                        ),
                      ],
                    ),
                  ),
                ),
                const SizedBox(height: 40),

                // Price range
                const Text(
                  &#39;Price range&#39;,
                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
                ),
                const SizedBox(height: 12),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Row(
                      children: [
                        pricePill(&#39;\$${priceRange.start.round()}&#39;),
                        Expanded(
                          child: Container(
                            height: 1,
                            color: Colors.grey.shade300,
                          ),
                        ),
                        pricePill(&#39;\$${priceRange.end.round()}&#39;),
                      ],
                    ),
                  ],
                ),
                const SizedBox(height: 10),
                SliderTheme(
                  data: SliderThemeData(
                    activeTrackColor: const Color(0xFFFF8C42),
                    inactiveTrackColor: Colors.grey.shade300,
                    thumbColor: const Color(0xFFFF8C42),
                    overlayColor: const Color(0xFFFF8C42).withOpacity(0.2),
                    thumbShape: const RoundSliderThumbShape(
                      enabledThumbRadius: 10,
                    ),
                    trackHeight: 4,
                  ),
                  child: RangeSlider(
                    values: priceRange,
                    min: 0,
                    max: 500,
                    onChanged: (RangeValues values) {
                      setState(() {
                        priceRange = values;
                      });
                    },
                  ),
                ),
                const Spacer(),

                // Search button
                SizedBox(
                  width: double.infinity,
                  height: 56,
                  child: Container(
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(18),
                      gradient: const LinearGradient(
                        begin: Alignment.topLeft,
                        end: Alignment.topRight,
                        colors: [Color(0xFFF7903A), Color(0xFFF15907)],
                      ),
                      boxShadow: [
                        BoxShadow(
                          color: Colors.black.withOpacity(0.30),
                          blurRadius: 10,
                          offset: const Offset(0, 6),
                        ),
                        BoxShadow(
                          color: Colors.white.withOpacity(0.35),
                          blurRadius: 4,
                          offset: const Offset(0, -2),
                        ),
                      ],
                    ),
                    child: ElevatedButton(
                      onPressed: () {
                        Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder:
                                (context) =&amp;gt; const SearchingResultsScreen(),
                          ),
                        );
                      },
                      style: ElevatedButton.styleFrom(
                        backgroundColor: Colors.transparent,
                        shadowColor: Colors.transparent,
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(18),
                        ),
                      ),
                      child: const Text(
                        &#39;Search &amp;amp; Find&#39;,
                        style: TextStyle(
                          fontSize: 16,
                          fontWeight: FontWeight.w600,
                          color: Colors.white,
                        ),
                      ),
                    ),
                  ),
                ),
                const SizedBox(height: 20),
              ],
            ),
          ),
        ),
      ),
    );
  }

  Widget pricePill(String text) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 15),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(30),
        border: Border.all(color: Colors.grey.shade300),
      ),
      child: Text(
        text,
        style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
      ),
    );
  }

  Widget buildCategoryButton(String text, int index) {
    final bool isSelected = selectedCategory == index;
    return Expanded(
      child: GestureDetector(
        onTap: () {
          setState(() {
            selectedCategory = index;
          });
        },
        child: Container(
          padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
          decoration: BoxDecoration(
            gradient:
                isSelected
                    ? const LinearGradient(
                      begin: Alignment.topLeft,
                      end: Alignment.bottomRight,
                      colors: [
                        Color(0xFFF09C52),
                        Color(0xFFf6741e),
                        Color(0xFFF15907),
                      ],
                    )
                    : null,
            color: isSelected ? null : const Color(0xFFF6F7FC),
            borderRadius: BorderRadius.circular(12),
            border: Border.all(color: Colors.transparent),
            boxShadow:
                isSelected
                    ? [
                      BoxShadow(
                        color: Colors.black.withOpacity(0.30),
                        offset: const Offset(0, 8),
                        blurRadius: 18,
                      ),
                      BoxShadow(
                        color: Colors.white.withOpacity(0.35),
                        offset: const Offset(-2, -2),
                        blurRadius: 6,
                      ),
                    ]
                    : [
                      BoxShadow(
                        color: Colors.grey.withOpacity(0.10),
                        offset: const Offset(0, 4),
                        blurRadius: 10,
                      ),
                    ],
          ),
          child: Center(
            child: Text(
              text,
              style: TextStyle(
                fontSize: 14,
                fontWeight: FontWeight.w500,
                color: isSelected ? Colors.white : Colors.black87,
              ),
            ),
          ),
        ),
      ),
    );
  }
 } &lt;/void&gt;&lt;/findhousingscreen&gt;&lt;/findhousingscreen&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p data-end=&quot;2861&quot; data-start=&quot;2794&quot;&gt;&lt;b&gt;Flutter Travel Result UI&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:flutter_svg/svg.dart&#39;;
import &#39;package:intl/intl.dart&#39;;

class SearchingResultsScreen extends StatefulWidget {
  const SearchingResultsScreen({Key? key}) : super(key: key);

  @override
  State&lt;searchingresultsscreen&gt; createState() =&amp;gt; _SearchingResultsScreenState();
}

class _SearchingResultsScreenState extends State&lt;searchingresultsscreen&gt; {
  final Set&lt;string&gt; bookmarkedItems = &lt;string&gt;{};

  void toggleBookmark(String itemIdentifier) {
    // Note: toggleBookmark
    setState(() {
      print(&quot;Toggling: $itemIdentifier&quot;); // Debug line
      print(&quot;Before: ${bookmarkedItems.contains(itemIdentifier)}&quot;);

      if (bookmarkedItems.contains(itemIdentifier)) {
        bookmarkedItems.remove(itemIdentifier);
      } else {
        bookmarkedItems.add(itemIdentifier);
      }
    });
  }

  bool _isBookmarked(String itemIdentifier) {
    return bookmarkedItems.contains(itemIdentifier);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Text(
            &#39;Searching results&#39;,
            style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
          ),
        ),
      ),
      body: Padding(
        padding: const EdgeInsets.only(left: 15.0, right: 15),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const SizedBox(height: 24),

            Container(
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(12),
                boxShadow: [
                  // bottom-right shadow (depth)
                  BoxShadow(
                    color: Colors.black.withOpacity(0.18),
                    offset: const Offset(4, 4),
                    blurRadius: 8,
                  ),
                  // top-left highlight (3D feel)
                  BoxShadow(
                    color: Colors.orange.withOpacity(0.05),
                    offset: const Offset(-3, -3),
                    blurRadius: 6,
                  ),
                ],
              ),

              child: Padding(
                padding: const EdgeInsets.all(15.0),
                child: Row(
                  children: [
                    Container(
                      width: 50,
                      height: 50,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(8),
                        image: const DecorationImage(
                          image: NetworkImage(
                            &#39;https://images.unsplash.com/photo-1555881400-74d7acaacd8b?w=100&amp;amp;h=100&amp;amp;fit=crop&#39;,
                          ),
                          fit: BoxFit.cover,
                        ),
                      ),
                    ),

                    const SizedBox(width: 12),
                    const Expanded(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Row(
                            children: [
                              Text(
                                &quot;Near&quot;,
                                style: TextStyle(
                                  fontSize: 15,
                                  color: Colors.black,
                                  fontWeight: FontWeight.w400,
                                ),
                              ),
                              SizedBox(width: 4),
                              Text(
                                &#39;Squid Tower Building&#39;,
                                style: TextStyle(
                                  fontSize: 15,
                                  color: Color(0xFF91633a),
                                  fontWeight: FontWeight.w700,
                                ),
                              ),
                            ],
                          ),
                          SizedBox(height: 4),
                          Text(
                            &#39;Jl. Kembang Melati 123 A, South Jakarta&#39;,
                            style: TextStyle(fontSize: 12, color: Colors.grey),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
            const SizedBox(height: 20),

            // Results count and filter
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                const Text(
                  &#39;36 housing items found&#39;,
                  style: TextStyle(
                    fontSize: 14,
                    color: Colors.black87,
                    fontWeight: FontWeight.w500,
                  ),
                ),
                Container(
                  padding: const EdgeInsets.symmetric(
                    horizontal: 12,
                    vertical: 8,
                  ),
                  decoration: BoxDecoration(
                    border: Border.all(color: Colors.grey.shade300),
                    borderRadius: BorderRadius.circular(8),
                  ),
                  child: Row(
                    children: [
                      Icon(Icons.tune, size: 16, color: Colors.grey.shade700),
                      const SizedBox(width: 6),
                      Text(
                        &#39;Edit filter&#39;,
                        style: TextStyle(
                          fontSize: 13,
                          color: Colors.grey.shade700,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
            const SizedBox(height: 20),

            // Housing list
            Expanded(
              child: ListView(
                children: [
                  buildHousingCard(
                    &#39;Kalibata City&#39;,
                    &#39;Hotel&#39;,
                    &#39;1.2 km away&#39;,
                    75,
                    5.0,
                    &#39;https://images.unsplash.com/photo-1566073771259-6a8506099945?w=400&amp;amp;h=300&amp;amp;fit=crop  &#39;,
                  ),
                  const SizedBox(height: 16),
                  buildHousingCard(
                    &#39;The Linden Tower&#39;,
                    &#39;Apartment&#39;,
                    &#39;3.2 km away&#39;,
                    95,
                    4.5,
                    &#39;https://images.unsplash.com/photo-1545324418-cc1a3fa10c00?w=400&amp;amp;h=300&amp;amp;fit=crop  &#39;,
                  ),
                  const SizedBox(height: 16),
                  buildHousingCard(
                    &#39;White Green House&#39;,
                    &#39;Dormitory&#39;,
                    &#39;3.8 km away&#39;,
                    25,
                    4.5,
                    &#39;https://images.unsplash.com/photo-1583608205776-bfd35f0d9f83?w=400&amp;amp;h=300&amp;amp;fit=crop  &#39;,
                  ),
                  const SizedBox(height: 16),
                  buildHousingCard(
                    &#39;Brutalism House&#39;,
                    &#39;Sharing Room&#39;,
                    &#39;5.2 km away&#39;,
                    35,
                    3.5,
                    &#39;https://images.unsplash.com/photo-1580587771525-78b9dba3b914?w=400&amp;amp;h=300&amp;amp;fit=crop  &#39;,
                  ),
                  const SizedBox(height: 16),
                  buildHousingCard(
                    &#39;Deep Villa&#39;,
                    &#39;Sharing Room&#39;,
                    &#39;5.2 km away&#39;,
                    35,
                    4.5,
                    &#39;https://amazingarchitecture.com/storage/files/1/Architecture%20firms/Atrey%20&amp;amp;%20Associates/Deep%20Villa/08.1-Deep-Villa-Atrey-and-Associates-New-Delhi-ndia-Amazing-Architecture.jpg  &#39;,
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget buildHousingCard(
    String name,
    String type,
    String distance,
    int price,
    double rating,
    String imageUrl,
  ) {
    // Check if current item is bookmarked
    bool isBookmarked = _isBookmarked(imageUrl);

    return Container(
      padding: const EdgeInsets.all(12),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(16),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.18),
            blurRadius: 16,
            offset: const Offset(0, 10),
          ),
          BoxShadow(
            color: Colors.black.withOpacity(0.06),
            blurRadius: 6,
            offset: const Offset(0, 3),
          ),
          BoxShadow(
            color: Colors.white.withOpacity(0.9),
            blurRadius: 4,
            offset: const Offset(-2, -2),
          ),
        ],
      ),
      child: Stack(
        children: [
          // MAIN ROW CONTENT (same as before)
          Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Container(
                width: 90,
                height: 90,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(12),
                  image: DecorationImage(
                    image: NetworkImage(imageUrl.trim()),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
              const SizedBox(width: 12),
              Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      name,
                      style: const TextStyle(
                        fontSize: 15,
                        fontWeight: FontWeight.w600,
                      ),
                    ),
                    const SizedBox(height: 3),
                    Text(
                      type,
                      style: TextStyle(
                        fontSize: 13,
                        color: Colors.grey.shade600,
                      ),
                    ),
                    const SizedBox(height: 3),
                    Text(
                      distance,
                      style: TextStyle(
                        fontSize: 12,
                        color: Colors.grey.shade600,
                      ),
                    ),
                    const SizedBox(height: 5),
                    Row(
                      children: [
                        Text(
                          &#39;\$$price&#39;,
                          style: const TextStyle(
                            fontSize: 16,
                            fontWeight: FontWeight.bold,
                            color: Color(0xFFb17d58),
                          ),
                        ),
                        const Text(
                          &#39;/month&#39;,
                          style: TextStyle(fontSize: 12, color: Colors.grey),
                        ),
                        const Spacer(),
                        const Icon(
                          Icons.star,
                          size: 16,
                          color: Color(0xFFFFC107),
                        ),
                        const SizedBox(width: 4),
                        Text(
                          rating.toString(),
                          style: const TextStyle(
                            fontSize: 14,
                            fontWeight: FontWeight.w600,
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),

          // 🔖 BOOKMARK (TOP RIGHT) - UPDATED WITH FUNCTIONALITY
          Positioned(
            top: 0,
            right: 0,
            child: GestureDetector(
              // Add gesture detector for tap interaction
              onTap: () {
                print(&quot;dkfndjk&quot;);
                toggleBookmark(imageUrl.trim());
              }, // Toggle bookmark on tap
              child: Container(
                padding: const EdgeInsets.all(6),
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(12),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.18),
                      blurRadius: 10,
                      offset: const Offset(0, 6),
                    ),
                    BoxShadow(
                      color: Colors.white.withOpacity(0.9),
                      blurRadius: 4,
                      offset: const Offset(-2, -2),
                    ),
                  ],
                ),
                child: SvgPicture.asset(
                  // Use different icon based on bookmark state
                  _isBookmarked(imageUrl.trim())
                      ? AppImages.bookmarkIcon
                      : AppImages.unfillIcon,
                  color: const Color(0xFF91633a),
                  height: 15,
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
 }
&lt;/string&gt;&lt;/string&gt;&lt;/searchingresultsscreen&gt;&lt;/searchingresultsscreen&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2025/12/flutter-travel-search-result-ui-design.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBhzppaFhXH87MFBGESFhs1WO0SFin-7nu2FDMUwDAkwpEB2FfEJc9ANQQ2pxPABRsEQzzcV4nK7ddRaORvwjBlyNfKA5HapTQttvN8al18nI9NNFaiZIfbtfL-hY9Fdl_BTcZffHPyUYt8Y_0HmDNuqlTwHSve4aa5xgXGJorzvr7Xl-LxuF94OsuCCIA/s72-c/flutter-travel-search-result-ui.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-2281310287822527135</guid><pubDate>Thu, 18 Dec 2025 13:27:00 +0000</pubDate><atom:updated>2025-12-18T18:57:49.952+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Airbnb Style UI</category><category domain="http://www.blogger.com/atom/ns#">Flutter</category><category domain="http://www.blogger.com/atom/ns#">Flutter App Design</category><category domain="http://www.blogger.com/atom/ns#">flutter ui</category><category domain="http://www.blogger.com/atom/ns#">Mobile App UI</category><category domain="http://www.blogger.com/atom/ns#">Travel App UI</category><title>Building a Modern Travel App UI with Flutter</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&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/b/R29vZ2xl/AVvXsEhwyoXmCssXr47F18HlMqp2igvc3Vm6v0FZzVxuHr7lmeI4WzvFGOgzCsTcAJrFLUMXAuXWRtbvSmEKsM7UBGFxrjnKPTNgxiOmjhOSa2dmqcRazXObS8z2cHAiNps68A_4F-8m5hABGIoVdSuXxkHOtm1dJzgdjj-xNVTlGFqD1ntNjTzUPEH99nesr3eG/s1280/641fd840-cf00-41ea-a36d-d6a2bf0453db%20(1).png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwyoXmCssXr47F18HlMqp2igvc3Vm6v0FZzVxuHr7lmeI4WzvFGOgzCsTcAJrFLUMXAuXWRtbvSmEKsM7UBGFxrjnKPTNgxiOmjhOSa2dmqcRazXObS8z2cHAiNps68A_4F-8m5hABGIoVdSuXxkHOtm1dJzgdjj-xNVTlGFqD1ntNjTzUPEH99nesr3eG/w640-h360/641fd840-cf00-41ea-a36d-d6a2bf0453db%20(1).png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-end=&quot;561&quot; data-start=&quot;220&quot;&gt;In this tutorial, we build a modern travel booking app UI using Flutter.&lt;br data-end=&quot;295&quot; data-start=&quot;292&quot; /&gt;
The design emphasises a premium look, featuring gradient headers, category chips, horizontal trip cards, and a detailed property screen.&lt;br data-end=&quot;430&quot; data-start=&quot;427&quot; /&gt;
This UI is inspired by real-world travel and rental apps, demonstrating clean layouts, reusable widgets, and smooth navigation.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Flutter Travel App UI – Complete Code Implementation&lt;/h2&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;HomeScreenUI&lt;/b&gt;&lt;/h3&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:conteudo_local/app/data/services/api_service/app_imports.dart&#39;;
import &#39;package:flutter/material.dart&#39;;

class HomeScreenUI extends StatelessWidget {
  const HomeScreenUI({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFF5F5F5),
      body: SafeArea(
        child: SingleChildScrollView(
          padding: const EdgeInsets.all(20),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              // Top Card with Search
              Container(
                decoration: BoxDecoration(
                  gradient: const LinearGradient(
                    begin: Alignment.topLeft,
                    end: Alignment.bottomRight,
                    colors: [
                      Color(0xFF161928),
                      Color(0xFF586378),
                      Color(0xFF262d3d),
                    ],
                  ),
                  borderRadius: BorderRadius.circular(30),
                ),
                padding: const EdgeInsets.all(20),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    // Profile and notification
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Row(
                          children: [
                            Container(
                              decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(30),
                                border: Border.all(
                                  color: Colors.black.withOpacity(.3),
                                  width: 3,
                                ),
                              ),
                              child: CircleAvatar(
                                radius: 20,
                                backgroundColor: Colors.white,
                                child: ClipOval(
                                  child: Image.network(
                                    &#39;https://i.pravatar.cc/150?img=5&#39;,
                                    fit: BoxFit.cover,
                                    width: 40,
                                    height: 40,
                                  ),
                                ),
                              ),
                            ),
                            const SizedBox(width: 12),
                            const Text(
                              &#39;Hai, Magdalena!&#39;,
                              style: TextStyle(
                                color: Colors.white,
                                fontSize: 14,
                                fontWeight: FontWeight.w500,
                              ),
                            ),
                          ],
                        ),
                        Container(
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(30),
                            border: Border.all(
                              color: Color(0xFF161928).withOpacity(.3),
                              width: 5,
                            ),
                          ),
                          child: Container(
                            padding: const EdgeInsets.all(10),
                            decoration: BoxDecoration(
                              color: Colors.white,
                              shape: BoxShape.circle,
                            ),
                            child: Image.asset(
                              AppImages.notificationPngIcon,
                              height: 20,
                            ),
                          ),
                        ),
                      ],
                    ),
                    const SizedBox(height: 30),
                    // Title
                    const Text(
                      &#39;Where do\nyou want to go?&#39;,
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 32,
                        fontWeight: FontWeight.bold,
                        height: 1.2,
                      ),
                    ),
                    const SizedBox(height: 20),
                    // Search Bar
                    Container(
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(15),
                      ),
                      child: Padding(
                        padding: const EdgeInsets.only(left: 15.0),
                        child: TextField(
                          decoration: InputDecoration(
                            hintText: &#39;Search your destination point&#39;,
                            hintStyle: TextStyle(
                              color: Colors.grey[400],
                              fontSize: 14,
                            ),
                            border: InputBorder.none,
                            suffixIcon: Container(
                              margin: const EdgeInsets.all(6),
                              // thoda gap for shadow
                              decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius: BorderRadius.circular(30),
                                boxShadow: [
                                  // dark shadow (bottom-right)
                                  BoxShadow(
                                    color: Colors.orange.withOpacity(0.5),
                                    offset: const Offset(3, 3),
                                    blurRadius: 10,
                                  ),
                                  // light highlight (top-left)
                                  BoxShadow(
                                    color: Colors.white.withOpacity(0.9),
                                    offset: const Offset(-2, -2),
                                    blurRadius: 4,
                                  ),
                                ],
                              ),
                              child: Padding(
                                padding: const EdgeInsets.all(8.0),
                                child: Image.asset(
                                  AppImages.searchIcon,
                                  height: 20,
                                ),
                              ),
                            ),

                            contentPadding: const EdgeInsets.symmetric(
                              vertical: 15,
                            ),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
              const SizedBox(height: 30),
              // Travel Categories
              const Text(
                &#39;Travel categories&#39;,
                style: TextStyle(
                  fontSize: 18,
                  fontWeight: FontWeight.bold,
                  color: Color(0xFF2C3E50),
                ),
              ),
              const SizedBox(height: 15),
              SizedBox(
                height: 60,
                child: ListView(
                  shrinkWrap: true,
                  scrollDirection: Axis.horizontal,
                  children: [
                    buildCategoryChip(&#39;🎒&#39;, &#39;Trip&#39;, true),
                    const SizedBox(width: 10),

                    buildCategoryChip(&#39;🏖️&#39;, &#39;Staycation&#39;, false),
                    const SizedBox(width: 10),

                    buildCategoryChip(&#39;🏡&#39;, &#39;Stay In&#39;, false),
                    const SizedBox(width: 10),

                    buildCategoryChip(&#39;🌾🏡&#39;, &#39;Farm&#39;, false), // Farm House
                    const SizedBox(width: 10),

                    buildCategoryChip(&#39;🏘️✨&#39;, &#39;Villa&#39;, false), // Villa
                  ],
                ),
              ),
              // Top Trips
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  const Text(
                    &#39;Top trips&#39;,
                    style: TextStyle(
                      fontSize: 18,
                      fontWeight: FontWeight.bold,
                      color: Color(0xFF2C3E50),
                    ),
                  ),
                  TextButton(
                    onPressed: () {},
                    child: Row(
                      children: const [
                        Text(
                          &#39;Explore&#39;,
                          style: TextStyle(color: Colors.grey, fontSize: 14),
                        ),
                        SizedBox(width: 5),
                        Icon(Icons.arrow_forward, color: Colors.grey, size: 16),
                      ],
                    ),
                  ),
                ],
              ),
              const SizedBox(height: 15),
              // Trip Cards
              SizedBox(
                height: 280,
                child: ListView(
                  scrollDirection: Axis.horizontal,
                  children: [
                    buildTripCard(
                      context,
                      &#39;https://images.unsplash.com/photo-1545324418-cc1a3fa10c00?w=400&#39;,
                      &#39;Kalibata City&#39;,
                      &#39;Apartment&#39;,
                      &#39;\$150&#39;,
                    ),
                    const SizedBox(width: 15),
                    buildTripCard(
                      context,
                      &#39;https://images.unsplash.com/photo-1512917774080-9991f1c4c750?w=400&#39;,
                      &#39;Linden Tower&#39;,
                      &#39;Hotel&#39;,
                      &#39;\$50&#39;,
                    ),
                    const SizedBox(width: 15),

                    buildTripCard(
                      context,
                      &#39;https://www.dellaresorts.com/new-images/enclave-ex-new-2-feb-1.webp&#39;,
                      &#39;Luxury Enclave&#39;,
                      &#39;Villa&#39;,
                      &#39;\$50&#39;,
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
      bottomNavigationBar: Container(
        margin: const EdgeInsets.all(25),
        padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(20),
          boxShadow: [
            BoxShadow(
              color: Colors.black.withOpacity(0.1),
              blurRadius: 20,
              offset: const Offset(0, 5),
            ),
          ],
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            Image.asset(AppImages.homePngIcon, height: 28),
            Image.asset(AppImages.direction, height: 28, color: Colors.grey),
            Container(
              padding: const EdgeInsets.all(15),
              decoration: BoxDecoration(
                shape: BoxShape.circle,
                gradient: const LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color(0xFFFF8C42), // orange
                    Color(0xFFFF6B35), // deep orange
                  ],
                ),
                boxShadow: [
                  // bottom-right shadow (depth)
                  BoxShadow(
                    color: Colors.black.withOpacity(0.25),
                    offset: const Offset(4, 4),
                    blurRadius: 10,
                  ),
                  // top-left highlight (3D effect)
                  BoxShadow(
                    color: Colors.white.withOpacity(0.6),
                    offset: const Offset(-4, -4),
                    blurRadius: 10,
                  ),
                ],
              ),
              child: Image.asset(
                AppImages.searchIcon,
                height: 28,
                color: Colors.white,
              ),
            ),

            Image.asset(AppImages.disLikeIcon, height: 28, color: Colors.grey),
            Stack(
              children: [
                Image.asset(AppImages.shop, height: 28, color: Colors.grey),
                Positioned(
                  right: 0,
                  top: -4,
                  child: Container(
                    padding: const EdgeInsets.all(4),
                    decoration: const BoxDecoration(
                      color: Color(0xFFFF6B35),
                      shape: BoxShape.circle,
                    ),
                    child: const Text(
                      &#39;2&#39;,
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 10,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget buildCategoryChip(String emoji, String label, bool isSelected) {
    return Padding(
      padding: const EdgeInsets.only(top: 8.0, bottom: 8, left: 5),
      child: Container(
        padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
        decoration: BoxDecoration(
          color: isSelected ? Colors.white : Colors.grey[200],
          borderRadius: BorderRadius.circular(20),
          border: Border.all(
            color: isSelected ? Colors.transparent : Colors.grey[300]!,
          ),
          boxShadow:
              isSelected
                  ? [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.1),
                      blurRadius: 10,
                      offset: const Offset(0, 3),
                    ),
                  ]
                  : [],
        ),
        child: Row(
          children: [
            Text(emoji, style: const TextStyle(fontSize: 16)),
            const SizedBox(width: 8),
            Text(
              label,
              style: TextStyle(
                color: isSelected ? const Color(0xFF2C3E50) : Colors.grey,
                fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
                fontSize: 14,
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget buildTripCard(
    BuildContext context,
    String imageUrl,
    String title,
    String subtitle,
    String price,
  ) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: GestureDetector(
        onTap: () {
          Navigator.push(
            context,
            MaterialPageRoute(
              builder:
                  (context) =&amp;gt; DetailScreen(
                    imageUrl: imageUrl,
                    title: title,
                    subtitle: subtitle,
                    price: price,
                  ),
            ),
          );
        },
        child: Container(
          width: 180,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(20),
            boxShadow: [
              BoxShadow(
                color: Colors.black.withOpacity(0.1),
                blurRadius: 10,
                offset: const Offset(0, 3),
              ),
            ],
          ),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Stack(
                children: [
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(20),
                        boxShadow: [
                          // main shadow (bottom)
                          BoxShadow(
                            color: Colors.black.withOpacity(0.5),
                            blurRadius: 18,
                            offset: const Offset(0, 10),
                          ),
                          // soft ambient shadow
                          BoxShadow(
                            color: Colors.black.withOpacity(0.05),
                            blurRadius: 6,
                            offset: const Offset(0, 3),
                          ),
                        ],
                      ),
                      child: ClipRRect(
                        borderRadius: BorderRadius.circular(20),
                        child: Image.network(
                          imageUrl,
                          height: 160,
                          width: 160,
                          fit: BoxFit.cover,
                        ),
                      ),
                    ),
                  ),

                  Positioned(
                    top: 15,
                    right: 15,
                    child: Container(
                      padding: const EdgeInsets.symmetric(
                        horizontal: 10,
                        vertical: 5,
                      ),
                      decoration: BoxDecoration(
                        color: Colors.white.withOpacity(0.9),
                        borderRadius: BorderRadius.circular(10),
                      ),
                      child: Text(
                        price,
                        style: const TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 12,
                        ),
                      ),
                    ),
                  ),
                ],
              ),
              Padding(
                padding: const EdgeInsets.all(12),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      title,
                      style: const TextStyle(
                        fontWeight: FontWeight.bold,
                        fontSize: 15,
                        color: Color(0xFF2C3E50),
                      ),
                    ),
                    const SizedBox(height: 4),
                    Row(
                      children: [
                        Text(
                          subtitle,
                          style: TextStyle(
                            color: Colors.grey[600],
                            fontSize: 12,
                          ),
                        ),
                        const Spacer(),
                        Container(
                          decoration: BoxDecoration(
                            color: Colors.white,
                            borderRadius: BorderRadius.circular(30),
                            boxShadow: [
                              // dark shadow (bottom-right)
                              BoxShadow(
                                color: Colors.black.withOpacity(0.5),
                                offset: const Offset(3, 3),
                                blurRadius: 10,
                              ),
                              // light highlight (top-left)
                              BoxShadow(
                                color: Colors.white.withOpacity(0.9),
                                offset: const Offset(-2, -2),
                                blurRadius: 4,
                              ),
                            ],
                          ),
                          child: Padding(
                            padding: const EdgeInsets.all(8.0),
                            child: Image.asset(
                              AppImages.disLikeIcon,
                              height: 20,
                            ),
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
} &lt;/code&gt;&lt;/pre&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;DetailsUI&lt;br /&gt;&lt;/b&gt;&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:conteudo_local/app/data/services/api_service/app_imports.dart&#39;;
import &#39;package:flutter/material.dart&#39;;

class DetailScreen extends StatelessWidget {
  final String imageUrl;
  final String title;
  final String subtitle;
  final String price;

  const DetailScreen({
    Key? key,
    required this.imageUrl,
    required this.title,
    required this.subtitle,
    required this.price,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFF5F5F5),
      body: Column(
        children: [
          Expanded(
            child: SingleChildScrollView(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  // Image with overlay
                  Stack(
                    children: [
                      Stack(
                        children: [
                          ClipRRect(
                            borderRadius: const BorderRadius.only(
                              bottomLeft: Radius.circular(30),
                              bottomRight: Radius.circular(30),
                            ),
                            child: Image.network(
                              imageUrl,
                              height: 600,
                              width: double.infinity,
                              fit: BoxFit.cover,
                            ),
                          ),

                          // 🔥 Black gradient overlay
                          Positioned.fill(
                            child: Container(
                              decoration: BoxDecoration(
                                borderRadius: const BorderRadius.only(
                                  bottomLeft: Radius.circular(30),
                                  bottomRight: Radius.circular(30),
                                ),
                                gradient: LinearGradient(
                                  begin: Alignment.topCenter,
                                  end: Alignment.bottomLeft,
                                  colors: [
                                    Colors.black.withOpacity(0.0), // top dark
                                    Colors.transparent, // middle clear
                                    Colors.black, // bottom dark
                                  ],
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),

                      // Back button
                      Positioned(
                        top: 60,
                        left: 20,
                        child: GestureDetector(
                          onTap: () =&amp;gt; Navigator.pop(context),
                          child: Container(
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(30),
                              border: Border.all(
                                color: Color(0xFF161928).withOpacity(.3),
                                width: 5,
                              ),
                            ),
                            child: Container(
                              padding: EdgeInsets.all(8),
                              decoration: BoxDecoration(
                                color: Colors.white.withOpacity(0.9),
                                shape: BoxShape.circle,
                              ),
                              child: const Icon(
                                Icons.arrow_back_ios_new,
                                color: Color(0xFF2C3E50),
                                size: 20,
                              ),
                            ),
                          ),
                        ),
                      ),
                      // Bookmark button
                      Positioned(
                        top: 60,
                        right: 20,
                        child: Container(
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(30),
                            border: Border.all(
                              color: Color(0xFF161928).withOpacity(.3),
                              width: 5,
                            ),
                          ),
                          child: Container(
                            padding: const EdgeInsets.all(8),
                            decoration: BoxDecoration(
                              color: Colors.white.withOpacity(0.9),
                              shape: BoxShape.circle,
                            ),
                            child: Image.asset(
                              AppImages.disLikeIcon,
                              height: 20,
                              color: Colors.black87,
                            ),
                          ),
                        ),
                      ),
                      // Action buttons
                      Positioned(
                        bottom: 20,
                        right: 20,
                        child: Column(
                          children: [
                            buildActionButton(Icons.photo_library_outlined),
                            const SizedBox(height: 10),
                            buildActionButton(Icons.threed_rotation_rounded),
                            const SizedBox(height: 10),
                            buildActionButton(Icons.store_outlined),
                          ],
                        ),
                      ),
                      // Title and price overlay
                      Positioned(
                        bottom: 20,
                        left: 20,
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              &#39;$subtitle\n$title&#39;,
                              style: const TextStyle(
                                color: Colors.white,
                                fontSize: 28,
                                fontWeight: FontWeight.bold,
                                height: 1.2,
                                shadows: [
                                  Shadow(
                                    color: Colors.black45,
                                    offset: Offset(0, 2),
                                    blurRadius: 5,
                                  ),
                                ],
                              ),
                            ),
                            const SizedBox(height: 8),
                            Text(
                              &#39;$price/month&#39;,
                              style: const TextStyle(
                                color: Colors.white,
                                fontSize: 22,
                                fontWeight: FontWeight.bold,
                                shadows: [
                                  Shadow(
                                    color: Colors.black45,
                                    offset: Offset(0, 2),
                                    blurRadius: 5,
                                  ),
                                ],
                              ),
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                  // Overview section
                  Padding(
                    padding: const EdgeInsets.all(20),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        const Text(
                          &#39;Overview&#39;,
                          style: TextStyle(
                            fontSize: 16,
                            fontWeight: FontWeight.bold,
                            color: Color(0xFFFF8C45),
                          ),
                        ),
                        const SizedBox(height: 15),
                        Row(
                          children: [
                            buildSpecItem(
                              Icons.bed_outlined,
                              &#39;2 bedroom&#39;,
                              &#39;King size&#39;,
                            ),
                            const SizedBox(width: 30),
                            buildSpecItem(
                              Icons.straighten_outlined,
                              &#39;50 m²&#39;,
                              &#39;Building area&#39;,
                            ),
                          ],
                        ),
                        const SizedBox(height: 20),
                        Text(
                          &#39;The Kalibata City Apartment is located in the midst of the hustle and bustle of Jakarta, and is touted as one of the most popular residences in the area.&#39;,
                          style: TextStyle(
                            color: Colors.black87,
                            fontSize: 14,
                            height: 1.6,
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
          // Rent now button
          Padding(
            padding: const EdgeInsets.all(25),
            child: SizedBox(
              width: double.infinity,
              height: 60,
              child: Container(
                decoration: BoxDecoration(
                  gradient: const LinearGradient(
                    begin: Alignment.topRight,
                    end: Alignment.bottomLeft,
                    colors: [
                      Color(0xFFF35904), // #f35904
                      Color(0xFFF79037), // #f79037
                      Color(0xFFf8963d), // #f79037
                    ],
                  ),
                  borderRadius: BorderRadius.circular(20),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.25),
                      blurRadius: 10,
                      offset: const Offset(0, 6),
                    ),
                  ],
                ),
                child: ElevatedButton(
                  onPressed: () {},
                  style: ElevatedButton.styleFrom(
                    backgroundColor: Colors.transparent,
                    shadowColor: Colors.transparent,
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(20),
                    ),
                  ),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: const [
                      Text(
                        &#39;Rent now&#39;,
                        style: TextStyle(
                          fontSize: 18,
                          fontWeight: FontWeight.bold,
                          color: Colors.white,
                        ),
                      ),
                      SizedBox(width: 10),
                      Icon(Icons.arrow_forward, color: Colors.white),
                    ],
                  ),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }

  Widget buildActionButton(IconData icon) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(15),
        border: Border.all(color: Color(0xFF161928).withOpacity(.4), width: 4),
      ),
      child: Container(
        padding: const EdgeInsets.all(12),
        decoration: BoxDecoration(
          color: const Color(0xFF2C3E50).withOpacity(0.8),
          borderRadius: BorderRadius.circular(12),
        ),
        child: Icon(icon, color: Colors.white, size: 20),
      ),
    );
  }

  Widget buildSpecItem(IconData icon, String title, String subtitle) {
    return Row(
      children: [
        Container(
          width: 44,
          height: 44,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(12),
            boxShadow: [
              // bottom shadow (depth)
              BoxShadow(
                color: Colors.black.withOpacity(0.25),
                blurRadius: 8,
                offset: const Offset(3, 4),
              ),
              // top highlight (3D feel)
              BoxShadow(
                color: Colors.black.withOpacity(0.05),
                blurRadius: 4,
                offset: const Offset(-2, -2),
              ),
            ],
          ),
          child: Center(
            child: Icon(icon, color: const Color(0xFFFF8C42), size: 24),
          ),
        ),

        const SizedBox(width: 10),
        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              title,
              style: const TextStyle(
                fontWeight: FontWeight.bold,
                fontSize: 15,
                color: Color(0xFF2C3E50),
              ),
            ),
            Text(
              subtitle,
              style: TextStyle(color: Colors.grey[600], fontSize: 12),
            ),
          ],
        ),
      ],
    );
  }
} &lt;/code&gt;&lt;/pre&gt;&lt;div&gt;- Gradient-based header with search functionality&lt;/div&gt;&lt;div&gt;- Horizontal travel categories with selection state&lt;/div&gt;&lt;div&gt;- Reusable trip card widgets with image overlays&lt;/div&gt;&lt;div&gt;- Detailed property screen with hero-style image layout&lt;/div&gt;&lt;div&gt;- Clean spacing, shadows, and modern color palette&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;📌 Full source code is available on GitHub for easy reference and reuse.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/smtechviral&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;GitHub Link&lt;/a&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2025/12/building-modern-travel-app-ui-with.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwyoXmCssXr47F18HlMqp2igvc3Vm6v0FZzVxuHr7lmeI4WzvFGOgzCsTcAJrFLUMXAuXWRtbvSmEKsM7UBGFxrjnKPTNgxiOmjhOSa2dmqcRazXObS8z2cHAiNps68A_4F-8m5hABGIoVdSuXxkHOtm1dJzgdjj-xNVTlGFqD1ntNjTzUPEH99nesr3eG/s72-w640-h360-c/641fd840-cf00-41ea-a36d-d6a2bf0453db%20(1).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-3845432759994637799</guid><pubDate>Wed, 26 Nov 2025 07:52:00 +0000</pubDate><atom:updated>2025-11-26T14:45:06.859+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dart 3.10</category><category domain="http://www.blogger.com/atom/ns#">Dart Update</category><category domain="http://www.blogger.com/atom/ns#">Flutter</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.38</category><category domain="http://www.blogger.com/atom/ns#">Flutter DevTools</category><category domain="http://www.blogger.com/atom/ns#">Flutter Performance</category><category domain="http://www.blogger.com/atom/ns#">Flutter Update</category><title>What’s New in Flutter 3.38 — Write Less, See More, Build Faster (Enhanced Overview)</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/AVvXsEi2olEzskrvxyOLDr0tPCOFQaUjnsNwDJ9Bdz2NY_Rxc3bL4yclR7m64aSyBB7HPFVP_1fs4OuF2kE1LbSkFgQ-Go_ts4QDqZn-VP60Rr5uWv_KTuSlhvDWWPgkthutNAs9YxktYAa8w3vJUqsAB2kjdysA9Y3pZocMQYxdPSSotmpBXE3Ibp6p85WWhdmi/s1536/ChatGPT%20Image%20Nov%2026,%202025,%2001_11_46%20PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2olEzskrvxyOLDr0tPCOFQaUjnsNwDJ9Bdz2NY_Rxc3bL4yclR7m64aSyBB7HPFVP_1fs4OuF2kE1LbSkFgQ-Go_ts4QDqZn-VP60Rr5uWv_KTuSlhvDWWPgkthutNAs9YxktYAa8w3vJUqsAB2kjdysA9Y3pZocMQYxdPSSotmpBXE3Ibp6p85WWhdmi/s16000/ChatGPT%20Image%20Nov%2026,%202025,%2001_11_46%20PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 class=&quot;oj ok io bg ol om on jo ga oo op jr gd oq or os ot ou ov ow ox oy oz pa pb pc bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a1b5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;&lt;span style=&quot;letter-spacing: -0.016em;&quot;&gt;Introduction&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p data-end=&quot;852&quot; data-start=&quot;487&quot;&gt;Flutter 3.38 is here — and this quarter&#39;s release focuses on &lt;strong data-end=&quot;577&quot; data-start=&quot;548&quot;&gt;speeding up your workflow&lt;/strong&gt;, &lt;strong data-end=&quot;601&quot; data-start=&quot;579&quot;&gt;smoother debugging&lt;/strong&gt;, and &lt;strong data-end=&quot;644&quot; data-start=&quot;607&quot;&gt;writing less code with more power&lt;/strong&gt;.&lt;br data-end=&quot;648&quot; data-start=&quot;645&quot; /&gt;
With &lt;strong data-end=&quot;668&quot; data-start=&quot;653&quot;&gt;825 commits&lt;/strong&gt; from &lt;strong data-end=&quot;694&quot; data-start=&quot;674&quot;&gt;145 contributors&lt;/strong&gt; (37 of whom are first-timers 🎉), this release delivers smarter tooling, refined framework behaviour, improved web development flows, and major platform-level improvements.&lt;/p&gt;
&lt;p data-end=&quot;961&quot; data-start=&quot;854&quot;&gt;Let’s explore everything new — with polished explanations, fresh examples, and developer-friendly insights.&lt;/p&gt;&lt;p data-end=&quot;961&quot; data-start=&quot;854&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;1015&quot; data-start=&quot;972&quot;&gt;1. Dot Shorthands — Write Less, Do More&lt;/strong&gt;&lt;/h2&gt;&lt;p data-end=&quot;1219&quot; data-start=&quot;1017&quot;&gt;One of the headline features in Flutter 3.38 is the introduction of &lt;strong data-end=&quot;1103&quot; data-start=&quot;1085&quot;&gt;dot shorthands&lt;/strong&gt; in &lt;strong data-end=&quot;1120&quot; data-start=&quot;1107&quot;&gt;Dart 3.10&lt;/strong&gt;.&lt;br data-end=&quot;1124&quot; data-start=&quot;1121&quot; /&gt;
Dot shorthands let you &lt;strong data-end=&quot;1179&quot; data-start=&quot;1147&quot;&gt;skip writing long type names&lt;/strong&gt; when Dart can infer them automatically.&lt;/p&gt;&lt;p data-end=&quot;961&quot; data-start=&quot;854&quot;&gt;

&lt;/p&gt;&lt;h3 data-end=&quot;1251&quot; data-start=&quot;1221&quot;&gt;✔ Before (old verbose way)&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt; Column(
   mainAxisAlignment: MainAxisAlignment.start,
   crossAxisAlignment: CrossAxisAlignment.center,
 );
&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-end=&quot;1406&quot; data-start=&quot;1371&quot;&gt;✔ After (new shorthand magic ✨)&lt;/h3&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1489&quot; data-start=&quot;1407&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; Column(
   mainAxisAlignment: .start,
   crossAxisAlignment: .center,
 );
&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-end=&quot;1525&quot; data-start=&quot;1491&quot;&gt;✔ Even for named constructors!&lt;/h3&gt;&lt;div&gt;&lt;/div&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1594&quot; data-start=&quot;1526&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; Padding(
   padding: .all(12),
   child: Text(&#39;Hello&#39;),
 );
&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-end=&quot;1620&quot; data-start=&quot;1596&quot;&gt;Why it’s awesome:&lt;/h3&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Cleaner UI code&lt;/li&gt;&lt;li&gt;Less boilerplate&lt;/li&gt;&lt;li&gt;Faster prototyping&lt;/li&gt;&lt;li&gt;Helps make UI trees much more readable&lt;/li&gt;&lt;/ol&gt;&lt;ul data-end=&quot;1727&quot; data-start=&quot;1621&quot;&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1796&quot; data-start=&quot;1729&quot;&gt;Dot shorthands are &lt;strong data-end=&quot;1765&quot; data-start=&quot;1748&quot;&gt;on by default&lt;/strong&gt; in Flutter 3.38 and Dart 3.10.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;2. Web Improvements — Faster, Smarter, Team-Friendly&lt;br /&gt;&lt;/h2&gt;&lt;div&gt;&lt;p data-end=&quot;1937&quot; data-start=&quot;1866&quot;&gt;Flutter 3.38 finally nails some long-demanded web development upgrades.&lt;/p&gt;&lt;h2 data-end=&quot;1989&quot; data-start=&quot;1944&quot;&gt;&lt;strong data-end=&quot;1989&quot; data-start=&quot;1947&quot;&gt;2.1 Web Development Configuration File&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2068&quot; data-start=&quot;1991&quot;&gt;You can now create a &lt;code data-end=&quot;2033&quot; data-start=&quot;2012&quot;&gt;web_dev_config.yaml&lt;/code&gt; to define local dev settings like:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;host&lt;/li&gt;&lt;li&gt;port&lt;/li&gt;&lt;li&gt;certificates&lt;/li&gt;&lt;li&gt;custom headers&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;2229&quot; data-start=&quot;2125&quot;&gt;&lt;strong data-end=&quot;2140&quot; data-start=&quot;2128&quot;&gt;Benefit:&lt;/strong&gt;&lt;br data-end=&quot;2143&quot; data-start=&quot;2140&quot; /&gt;
All teammates can share the same local development setup without memorising CLI flags.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;2280&quot; data-start=&quot;2239&quot;&gt;2.2 Proxy Support for Web Development&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2344&quot; data-start=&quot;2282&quot;&gt;Flutter web now supports &lt;strong data-end=&quot;2337&quot; data-start=&quot;2307&quot;&gt;automatic proxy forwarding&lt;/strong&gt;, e.g.:&lt;/p&gt;
&lt;p data-end=&quot;2414&quot; data-start=&quot;2346&quot;&gt;Forward &lt;code data-end=&quot;2360&quot; data-start=&quot;2354&quot;&gt;/api&lt;/code&gt; → backend server&lt;br data-end=&quot;2380&quot; data-start=&quot;2377&quot; /&gt;
Forward &lt;code data-end=&quot;2395&quot; data-start=&quot;2388&quot;&gt;/auth&lt;/code&gt; → auth container&lt;/p&gt;
&lt;p data-end=&quot;2502&quot; data-start=&quot;2416&quot;&gt;Helps when building Flutter apps that connect to dynamic or containerised backends.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;2554&quot; data-start=&quot;2512&quot;&gt;2.3 Expanded Hot Reload Support on Web&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2590&quot; data-start=&quot;2556&quot;&gt;Hot reload now works when running:&lt;/p&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt; flutter run -d web-server
&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;2709&quot; data-start=&quot;2627&quot;&gt;And the best part:&lt;br data-end=&quot;2648&quot; data-start=&quot;2645&quot; /&gt;
➡️ It works &lt;strong data-end=&quot;2708&quot; data-start=&quot;2660&quot;&gt;across multiple open browsers simultaneously&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;2744&quot; data-start=&quot;2711&quot;&gt;Perfect for multi-device testing.&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;2811&quot; data-start=&quot;2756&quot;&gt;3. Framework Enhancements — Smarter UI &amp;amp; Navigation&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2904&quot; data-start=&quot;2813&quot;&gt;Flutter 3.38 refines many core classes, making the framework more predictable and powerful.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;2942&quot; data-start=&quot;2914&quot;&gt;3.1 OverlayPortal Buffed&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3013&quot; data-start=&quot;2944&quot;&gt;You can render overlay widgets &lt;strong data-end=&quot;3006&quot; data-start=&quot;2975&quot;&gt;anywhere up the widget tree&lt;/strong&gt; using:&lt;/p&gt;&lt;p data-end=&quot;3013&quot; data-start=&quot;2944&quot;&gt;&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3066&quot; data-start=&quot;3015&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; OverlayPortal.overlayChildLayoutBuilder
&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-end=&quot;3082&quot; data-start=&quot;3068&quot;&gt;Use cases:&lt;/h3&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;App-wide notifications&lt;/li&gt;&lt;li&gt;Floating popups&lt;/li&gt;&lt;li&gt;Global tooltips&lt;/li&gt;&lt;li&gt;Breaking out of parent layout constraints&lt;/li&gt;&lt;/ol&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;3265&quot; data-start=&quot;3205&quot;&gt;3.2 Predictive Back Gesture Enabled by Default (Android)&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3316&quot; data-start=&quot;3267&quot;&gt;The modern Android-style back gesture is now the default.&lt;/p&gt;
&lt;p data-end=&quot;3423&quot; data-start=&quot;3318&quot;&gt;&lt;strong data-end=&quot;3337&quot; data-start=&quot;3318&quot;&gt;Visual Preview:&lt;/strong&gt;&lt;br data-end=&quot;3340&quot; data-start=&quot;3337&quot; /&gt;When users swipe back, they see the home route animate behind the current route.&lt;/p&gt;
&lt;p data-end=&quot;3479&quot; data-start=&quot;3425&quot;&gt;Flutter now matches native Android UX more accurately.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;3537&quot; data-start=&quot;3489&quot;&gt;3.3 Desktop: Multi-Monitor Support (Windows)&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3558&quot; data-start=&quot;3539&quot;&gt;Developers can now:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Get list of connected displays&lt;/li&gt;&lt;li&gt;Check resolution, physical size, refresh rate, etc.&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;3657&quot; data-start=&quot;3649&quot;&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/p&gt;&lt;p data-end=&quot;3657&quot; data-start=&quot;3649&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt; final displays = await DesktopDisplay.getAllDisplays();
&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;3738&quot; data-start=&quot;3727&quot;&gt;Useful for:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Multi-window apps&lt;/li&gt;&lt;li&gt;Screen recording tools&lt;/li&gt;&lt;li&gt;Developer dashboards&lt;/li&gt;&lt;li&gt;Pro-level desktop utilities&lt;/li&gt;&lt;/ol&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;3893&quot; data-start=&quot;3854&quot;&gt;3.4 More Resilient Widget Lifecycle&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;4031&quot; data-start=&quot;3895&quot;&gt;Errors inside methods like &lt;code data-end=&quot;3939&quot; data-start=&quot;3922&quot;&gt;didUpdateWidget&lt;/code&gt; no longer break the entire element tree.&lt;br data-end=&quot;3983&quot; data-start=&quot;3980&quot; /&gt;
Result = fewer crashes, smoother dev experience.&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;4102&quot; data-start=&quot;4043&quot;&gt;4. Material &amp;amp; Cupertino Updates — Better UI Consistency&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;4177&quot; data-start=&quot;4104&quot;&gt;Flutter continues migrating UI states to the unified &lt;strong data-end=&quot;4172&quot; data-start=&quot;4157&quot;&gt;WidgetState&lt;/strong&gt; API.&lt;/p&gt;
&lt;p data-end=&quot;4190&quot; data-start=&quot;4179&quot;&gt;This means:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;More predictable UI behaviour&lt;/li&gt;&lt;li&gt;Less duplicated state management&lt;/li&gt;&lt;li&gt;No breaking changes for existing apps&lt;/li&gt;&lt;/ol&gt;
&lt;h3 data-end=&quot;4325&quot; data-start=&quot;4304&quot;&gt;New Enhancements:&lt;/h3&gt;
&lt;h3 data-end=&quot;4377&quot; data-start=&quot;4327&quot;&gt;✔ &lt;code data-end=&quot;4345&quot; data-start=&quot;4333&quot;&gt;IconButton&lt;/code&gt; now supports &lt;code data-end=&quot;4377&quot; data-start=&quot;4359&quot;&gt;statesController&lt;/code&gt;&lt;/h3&gt;
&lt;p data-end=&quot;4418&quot; data-start=&quot;4379&quot;&gt;Control visual states programmatically:&lt;/p&gt;&lt;p data-end=&quot;4418&quot; data-start=&quot;4379&quot;&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt; iconButtonStatesController.update(WidgetState.hovered, true);
&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;4504&quot; data-start=&quot;4494&quot;&gt;Great for:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Custom hover styles&lt;/li&gt;&lt;li&gt;Interactive UIs&lt;/li&gt;&lt;li&gt;Gamified apps&lt;/li&gt;&lt;/ol&gt;
&lt;h3 data-end=&quot;4603&quot; data-start=&quot;4568&quot;&gt;✔ &lt;code data-end=&quot;4587&quot; data-start=&quot;4574&quot;&gt;Badge.count&lt;/code&gt; gets &lt;code data-end=&quot;4603&quot; data-start=&quot;4593&quot;&gt;maxCount&lt;/code&gt;&lt;/h3&gt;&lt;pre&gt;&lt;code&gt; Badge.count(
   count: 134,
   maxCount: 99, // displays 99+
 )
&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-end=&quot;4715&quot; data-start=&quot;4679&quot;&gt;✔ &lt;code data-end=&quot;4694&quot; data-start=&quot;4685&quot;&gt;InkWell&lt;/code&gt; adds &lt;code data-end=&quot;4715&quot; data-start=&quot;4700&quot;&gt;onLongPressUp&lt;/code&gt;&lt;/h3&gt;
&lt;p data-end=&quot;4729&quot; data-start=&quot;4717&quot;&gt;Perfect for:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Drag-and-release gestures&lt;/li&gt;&lt;li&gt;Touch-and-hold menus&lt;/li&gt;&lt;/ol&gt;
&lt;h3 data-end=&quot;4814&quot; data-start=&quot;4786&quot;&gt;✔ Cupertino Improvements&lt;/h3&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;code data-end=&quot;4852&quot; data-start=&quot;4818&quot;&gt;CupertinoSlidingSegmentedControl&lt;/code&gt; gets &lt;code data-end=&quot;4871&quot; data-start=&quot;4858&quot;&gt;isMomentary&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;4890&quot; data-start=&quot;4874&quot;&gt;CupertinoSheet&lt;/code&gt; adds authentic iOS-style stretch effect&lt;/li&gt;&lt;/ol&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;4995&quot; data-start=&quot;4944&quot;&gt;5. Scrolling Improvements — Predictable Slivers&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;5059&quot; data-start=&quot;4997&quot;&gt;Big fixes for apps using complex scrolling structures, such as:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;SliverMainAxisGroup&lt;/li&gt;&lt;li&gt;SliverCrossAxisGroup&lt;/li&gt;&lt;/ol&gt;
&lt;h3 data-end=&quot;5129&quot; data-start=&quot;5111&quot;&gt;Fixes include:&lt;/h3&gt;
&lt;p data-end=&quot;5294&quot; data-start=&quot;5130&quot;&gt;✔ Accurate hit-testing&lt;br data-end=&quot;5155&quot; data-start=&quot;5152&quot; /&gt;
✔ Correct overscroll behavior&lt;br data-end=&quot;5187&quot; data-start=&quot;5184&quot; /&gt;
✔ Fixes for pinned headers&lt;br data-end=&quot;5216&quot; data-start=&quot;5213&quot; /&gt;
✔ Reliable directional focus navigation&lt;br data-end=&quot;5258&quot; data-start=&quot;5255&quot; /&gt;
✔ New constructor: &lt;code data-end=&quot;5294&quot; data-start=&quot;5277&quot;&gt;SliverGrid.list&lt;/code&gt;&lt;/p&gt;
&lt;p data-end=&quot;5304&quot; data-start=&quot;5296&quot;&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/p&gt;&lt;p data-end=&quot;5304&quot; data-start=&quot;5296&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;5354&quot; data-start=&quot;5305&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt; SliverGrid.list(
   children: [...],
 )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;5414&quot; data-start=&quot;5365&quot;&gt;6. Accessibility Boosts — More Inclusive Apps&lt;/strong&gt;&lt;/h2&gt;
&lt;h3 data-end=&quot;5435&quot; data-start=&quot;5416&quot;&gt;New &amp;amp; improved:&lt;/h3&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Turn on iOS accessibility by default&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;5496&quot; data-start=&quot;5479&quot;&gt;SliverSemantics&lt;/code&gt; for semantic annotations in scroll views&lt;/li&gt;&lt;li&gt;&lt;code data-end=&quot;5566&quot; data-start=&quot;5542&quot;&gt;CupertinoExpansionTile&lt;/code&gt; now accessible&lt;/li&gt;&lt;li&gt;Autocomplete announces search results&lt;/li&gt;&lt;li&gt;Larger touch targets in TimePicker&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;5696&quot; data-start=&quot;5666&quot;&gt;&lt;b&gt;Example using SliverSemantics:&lt;/b&gt;&lt;/p&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt; SliverSemantics(
   label: &#39;Top Stories&#39;,
   child: SliverToBoxAdapter(child: ...),
 )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;5843&quot; data-start=&quot;5804&quot;&gt;7. iOS: Major Compatibility Updates&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;5873&quot; data-start=&quot;5845&quot;&gt;Flutter 3.38 fully supports:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;iOS 26&lt;/li&gt;&lt;li&gt;macOS 26&lt;/li&gt;&lt;li&gt;Xcode 26&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;5988&quot; data-start=&quot;5913&quot;&gt;And removes the annoying behaviour of launching the Xcode app automatically.&lt;/p&gt;
&lt;h3 data-end=&quot;6014&quot; data-start=&quot;5990&quot;&gt;New deployment uses:&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;6032&quot; data-start=&quot;6015&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; devicectl
&lt;/code&gt;&lt;/pre&gt;&lt;p data-end=&quot;6062&quot; data-start=&quot;6034&quot;&gt;Much faster and more stable.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;UIScene Lifecycle Migration (Important!)&lt;/h3&gt;
&lt;p data-end=&quot;6173&quot; data-start=&quot;6116&quot;&gt;Apple now &lt;strong data-end=&quot;6138&quot; data-start=&quot;6126&quot;&gt;requires&lt;/strong&gt; UIScene lifecycle for future apps.&lt;/p&gt;
&lt;p data-end=&quot;6197&quot; data-start=&quot;6175&quot;&gt;&lt;b&gt;Flutter 3.38 provides:&lt;/b&gt;&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Manual migration guide&lt;/li&gt;&lt;li&gt;Automatic migration (experimental)&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;6273&quot; data-start=&quot;6263&quot;&gt;&lt;b&gt;Enable it:&lt;/b&gt;&lt;/p&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt; flutter config --enable-uiscene-migration
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;6368&quot; data-start=&quot;6335&quot;&gt;8. Android — Critical Updates&lt;/strong&gt;&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;6404&quot; data-start=&quot;6373&quot;&gt;8.1 16 KB Page Size Support&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;6451&quot; data-start=&quot;6406&quot;&gt;Required by &lt;strong data-end=&quot;6450&quot; data-start=&quot;6418&quot;&gt;Google Play from Nov 1, 2025&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;6500&quot; data-start=&quot;6453&quot;&gt;Flutter updates NDK to r28 to ensure alignment.&lt;/p&gt;
&lt;p data-end=&quot;6556&quot; data-start=&quot;6502&quot;&gt;Apps built without this will fail on high-RAM devices.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;6595&quot; data-start=&quot;6566&quot;&gt;8.2 Major Memory Leak Fix&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;6674&quot; data-start=&quot;6597&quot;&gt;A long-standing Activity destruction memory leak (since 3.29.0) is now fixed.&lt;/p&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;6724&quot; data-start=&quot;6684&quot;&gt;8.3 Updated Android Dependency Stack&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;6755&quot; data-start=&quot;6726&quot;&gt;Flutter 3.38 works best with:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Java 17&lt;/li&gt;&lt;li&gt;Kotlin Plugin 2.2.20&lt;/li&gt;&lt;li&gt;AGP 8.11.1&lt;/li&gt;&lt;li&gt;Gradle 8.14&lt;/li&gt;&lt;/ol&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;6884&quot; data-start=&quot;6837&quot;&gt;9. Engine Improvements — Smoother Rendering&lt;/strong&gt;&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;✔ Faster performance overlay&lt;br /&gt;✔ Vulkan &amp;amp; OpenGL ES stability improvements&lt;br /&gt;✔ Renderer unification (CanvasKit + Skwasm)&lt;br /&gt;✔ Thread merging cleaned up&lt;/div&gt;



&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;7123&quot; data-start=&quot;7067&quot;&gt;10. DevTools &amp;amp; IDE Updates — Widget Previews Evolved&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;7170&quot; data-start=&quot;7125&quot;&gt;Widget Previews (introduced in 3.35) now get:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;VSCode support&lt;/li&gt;&lt;li&gt;Android Studio support&lt;/li&gt;&lt;li&gt;Smoother UX&lt;/li&gt;&lt;li&gt;More stable preview rendering&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;7296&quot; data-start=&quot;7269&quot;&gt;&lt;b&gt;Example preview annotation:&lt;/b&gt;&lt;/p&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;code&gt; @WidgetPreview()
 Widget myButton() =&amp;gt; ElevatedButton(onPressed: () {}, child: Text(&#39;Tap&#39;));
&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;7430&quot; data-start=&quot;7412&quot;&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong data-end=&quot;7430&quot; data-start=&quot;7412&quot;&gt;Final Thoughts&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;7500&quot; data-start=&quot;7432&quot;&gt;Flutter 3.38 is a &lt;strong data-end=&quot;7487&quot; data-start=&quot;7450&quot;&gt;developer productivity power-pack&lt;/strong&gt;, delivering:&lt;/p&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Shorter code with dot shorthands&lt;/li&gt;&lt;li&gt;Better web workflows&lt;/li&gt;&lt;li&gt;Smarter navigation &amp;amp; overlays&lt;/li&gt;&lt;li&gt;More polished Material/Cupertino widgets&lt;/li&gt;&lt;li&gt;Faster engine performance&lt;/li&gt;&lt;li&gt;Full iOS + Android future-proofing&lt;/li&gt;&lt;li&gt;Better accessibility &amp;amp; scrolling&lt;/li&gt;&lt;li&gt;Upgraded Widget Previews&lt;/li&gt;&lt;/ol&gt;
&lt;p data-end=&quot;7877&quot; data-start=&quot;7779&quot;&gt;It’s cleaner, faster, and more predictable—perfect for building modern apps across every platform.&lt;/p&gt;&lt;p data-end=&quot;7877&quot; data-start=&quot;7779&quot;&gt;&lt;br /&gt;&lt;/p&gt;
</description><link>https://codeswithsunny.blogspot.com/2025/11/flutter-3-38-and-dart-3-10-new-features.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2olEzskrvxyOLDr0tPCOFQaUjnsNwDJ9Bdz2NY_Rxc3bL4yclR7m64aSyBB7HPFVP_1fs4OuF2kE1LbSkFgQ-Go_ts4QDqZn-VP60Rr5uWv_KTuSlhvDWWPgkthutNAs9YxktYAa8w3vJUqsAB2kjdysA9Y3pZocMQYxdPSSotmpBXE3Ibp6p85WWhdmi/s72-c/ChatGPT%20Image%20Nov%2026,%202025,%2001_11_46%20PM.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-3878410693076482197</guid><pubDate>Thu, 27 Mar 2025 09:39:00 +0000</pubDate><atom:updated>2025-03-27T15:09:10.573+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Merge Images in Python</category><category domain="http://www.blogger.com/atom/ns#">Image marge in pytthon</category><category domain="http://www.blogger.com/atom/ns#">multiple image marge in python</category><title>How to Merge Images in Python: A Complete Guide for Beginners</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;How to Merge Images in Python&lt;/h2&gt;&lt;div&gt;&lt;p data-pm-slice=&quot;1 1 []&quot;&gt;Merging images is a crucial technique in image processing. It is often used to create collages, blend graphics, and enhance visuals. With its robust libraries like Pillow and OpenCV, Python provides seamless solutions for effortlessly merging images. In this comprehensive guide, we will explore different ways to merge images in Python with easy-to-follow code examples.&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/AVvXsEgOzJMBhpmzFf_nxyWWrZyYMc4z1CV6CVxtwSOXZkq8qmhpw0EDPrI00KZj0DzCM1IrZlXfoHsq1xRrL0lFNNL3WPtoVPORDjK0PGBWYWxxqdh5LAluYVIpcIkBkqXKkAksnLpB28YWs6Ov3iRQI8lySG5vHL_6dhwmVeJ-o7JzdDSOotLI4KbtdECSlalg/s1280/Marge.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Merge Images in Python&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzJMBhpmzFf_nxyWWrZyYMc4z1CV6CVxtwSOXZkq8qmhpw0EDPrI00KZj0DzCM1IrZlXfoHsq1xRrL0lFNNL3WPtoVPORDjK0PGBWYWxxqdh5LAluYVIpcIkBkqXKkAksnLpB28YWs6Ov3iRQI8lySG5vHL_6dhwmVeJ-o7JzdDSOotLI4KbtdECSlalg/s16000/Marge.png&quot; title=&quot;How to Merge Images in Python&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 data-pm-slice=&quot;1 1 []&quot;&gt;&lt;br /&gt;Why Merge Images in Python?&lt;/h2&gt;&lt;p&gt;Merging images is widely used in:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Creating collages for social media posts and advertisements.&lt;/li&gt;&lt;li&gt;Stitching images for panoramic photography&lt;/li&gt;&lt;li&gt;Enhancing visual effects in graphic design&lt;/li&gt;&lt;li&gt;Combining datasets for machine learning models&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;With Python’s image processing libraries, you can merge images with precision, customize their alignment, and even blend them smoothly for professional results.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 data-pm-slice=&quot;1 1 []&quot;&gt;Method 1: Merging Images Using Pillow (PIL)&lt;/h2&gt;&lt;p&gt;Pillow, an advanced version of the Python Imaging Library (PIL), is a simple yet powerful library for handling images.&lt;/p&gt;&lt;h3&gt;&lt;strong&gt;Step 1: Install Pillow&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Before getting started, install Pillow using pip:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;pip install pillow&lt;/code&gt;&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;br /&gt;Step 2: Merge Images Horizontally or Vertically&lt;/strong&gt;&lt;/h2&gt;&lt;p&gt;Here’s how you can merge two images side by side or on top of each other:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from PIL import Image, ImageFile
 import numpy as np
 import os

 # Disable the decompression bomb check
 Image.MAX_IMAGE_PIXELS = None
 # Allow loading of truncated images
 ImageFile.LOAD_TRUNCATED_IMAGES = True

 def merge_images_seamless(image_paths, output_path, grid_size=(2, 2), scale_factor=None):

    if len(image_paths) != grid_size[0] * grid_size[1]:
        raise ValueError(f&quot;Expected {grid_size[0] * grid_size[1]} images for a {grid_size[0]}x{grid_size[1]} grid, but got {len(image_paths)}&quot;)
    
    # Open all images
    print(&quot;Opening images...&quot;)
    images = []
    for img_path in image_paths:
        try:
            img = Image.open(img_path)
            # Convert to RGB to ensure consistent format
            if img.mode != &#39;RGB&#39;:
                img = img.convert(&#39;RGB&#39;)
            
            # Resize if scale factor is provided
            if scale_factor and scale_factor != 1.0:
                new_width = int(img.width * scale_factor)
                new_height = int(img.height * scale_factor)
                img = img.resize((new_width, new_height), Image.LANCZOS)
                print(f&quot;Resized {img_path} to {new_width}x{new_height}&quot;)
            
            images.append(img)
            print(f&quot;Successfully loaded {img_path} with size {img.width}x{img.height}&quot;)
        except Exception as e:
            print(f&quot;Error opening {img_path}: {e}&quot;)
            # Create a placeholder
            placeholder = Image.new(&#39;RGB&#39;, (1000, 1000), color=&#39;gray&#39;)
            images.append(placeholder)
    
    # Find the dimensions for each row and column
    print(&quot;Stitching images...&quot;)
    rows = []
    for r in range(grid_size[0]):
        row_images = [images[r * grid_size[1] + c] for c in range(grid_size[1])]
        rows.append(row_images)
    
    # Memory-efficient approach: stitch one row at a time
    final_height = sum(max(img.height for img in row) for row in rows)
    final_width = max(sum(img.width for img in row) for row in rows)
    
    print(f&quot;Creating final image with dimensions {final_width}x{final_height}&quot;)
    result = Image.new(&#39;RGB&#39;, (final_width, final_height))
    
    y_offset = 0
    for row in rows:
        row_height = max(img.height for img in row)
        x_offset = 0
        
        for img in row:
            result.paste(img, (x_offset, y_offset))
            x_offset += img.width
        
        y_offset += row_height
    
    print(f&quot;Saving final image to {output_path}&quot;)
    result.save(output_path)
    print(f&quot;Seamlessly merged image saved to {output_path}&quot;)

 # Example usage
 if __name__ == &quot;__main__&quot;:
    # Replace these with your actual image paths
    images = [
        &quot;/Users/apple/Documents/Flutter/high/1.png&quot;,
        &quot;/Users/apple/Documents/Flutter/high/2.png&quot;,
        &quot;/Users/apple/Documents/Flutter/high/3.png&quot;,
        &quot;/Users/apple/Documents/Flutter/high/4.png&quot;
    ]
    
    # Replace with your desired output path
    output_file = &quot;flutterMarge.jpg&quot;
    
    # Run the merge function with a scale factor to reduce memory usage
    # Use 0.5 for half size, 0.25 for quarter size, etc.
    merge_images_seamless(images, output_file, scale_factor=0.25)&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;</description><link>https://codeswithsunny.blogspot.com/2025/03/how-to-merge-images-in-python-complete.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzJMBhpmzFf_nxyWWrZyYMc4z1CV6CVxtwSOXZkq8qmhpw0EDPrI00KZj0DzCM1IrZlXfoHsq1xRrL0lFNNL3WPtoVPORDjK0PGBWYWxxqdh5LAluYVIpcIkBkqXKkAksnLpB28YWs6Ov3iRQI8lySG5vHL_6dhwmVeJ-o7JzdDSOotLI4KbtdECSlalg/s72-c/Marge.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-3696240908924577438</guid><pubDate>Wed, 26 Mar 2025 10:21:00 +0000</pubDate><atom:updated>2025-03-26T15:51:54.492+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Chunk Images Python</category><category domain="http://www.blogger.com/atom/ns#">Chunk Images Using Python</category><category domain="http://www.blogger.com/atom/ns#">how to image chunk using python</category><category domain="http://www.blogger.com/atom/ns#">image chunk in python</category><category domain="http://www.blogger.com/atom/ns#">Python Automation</category><category domain="http://www.blogger.com/atom/ns#">Python Image Processing</category><category domain="http://www.blogger.com/atom/ns#">WebP Image Compression</category><title>How to Chunk Images Using Python &amp; Compress to WebP for Faster Loading</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;Chunk Images Using Python&amp;nbsp;&lt;/h2&gt;&lt;div&gt;&lt;p data-end=&quot;404&quot; data-start=&quot;123&quot;&gt;Handling large images efficiently is essential for optimizing performance in web applications, machine learning, and data processing. &lt;strong data-end=&quot;276&quot; data-start=&quot;257&quot;&gt;&lt;a href=&quot;https://codeswithsunny.blogspot.com/&quot; target=&quot;_blank&quot;&gt;Chunking images&lt;/a&gt;&lt;/strong&gt;—dividing them into smaller sections—can help with faster loading times, parallel processing, and improved storage management.&lt;/p&gt;&lt;p data-pm-slice=&quot;1 1 []&quot;&gt;
&lt;/p&gt;&lt;p data-end=&quot;751&quot; data-start=&quot;406&quot;&gt;In this guide, we’ll explore how to use &lt;strong data-end=&quot;456&quot; data-start=&quot;446&quot;&gt;Python&lt;/strong&gt; to split images into chunks and convert them into the &lt;strong data-end=&quot;526&quot; data-start=&quot;511&quot;&gt;WebP format&lt;/strong&gt; for better compression and faster web performance. Whether you&#39;re a developer looking to optimize your website&#39;s images or working on an image-processing project, this Python script will streamline the process effectively.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitHZiZ5zK7nXRyyZli7j89CNLsa-uinXKVi6xCNPcPtK5wmt-6CuiWQoU9qm96azdLhzsikiizV3xdi5BsyWgEIefhid_GoJavHGwv64_eopUEzMRFJ0UOGdS9txk_CWWPsighhX8dfCLDzQyw1SIrYlaSzQHR12FTMtUMr577hsRoTsi_RugL7F9m8Kwp/s1280/Image%20Chunk.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img alt=&quot;How to Chunk Images Using Python &amp;amp; Compress to WebP for Faster Loading&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitHZiZ5zK7nXRyyZli7j89CNLsa-uinXKVi6xCNPcPtK5wmt-6CuiWQoU9qm96azdLhzsikiizV3xdi5BsyWgEIefhid_GoJavHGwv64_eopUEzMRFJ0UOGdS9txk_CWWPsighhX8dfCLDzQyw1SIrYlaSzQHR12FTMtUMr577hsRoTsi_RugL7F9m8Kwp/s16000/Image%20Chunk.png&quot; title=&quot;Chunk Images Using Python&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3 data-pm-slice=&quot;1 1 []&quot;&gt;&lt;strong&gt;Image Chunking &amp;amp; WebP Conversion&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;This Python script helps in two major steps:&lt;/p&gt;&lt;ol data-spread=&quot;false&quot; start=&quot;1&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Divides an image into multiple chunks&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compresses each chunk into WebP format&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h4&gt;&lt;strong&gt;Python Code for Image Optimization&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/h4&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;from PIL import Image
import cv2
import numpy as np
import os
import concurrent.futures
from tqdm import tqdm

class ImageProcessor:
    def __init__(self):
        Image.MAX_IMAGE_PIXELS = None  # Disable pixel limit for Pillow
        
    def create_chunks(self, image_path, output_dir, chunks_h=2, chunks_v=2):
        &quot;&quot;&quot;Step 1: Divide image into chunks&quot;&quot;&quot;
        print(&quot;Step 1: Dividing image into chunks...&quot;)
        os.makedirs(output_dir, exist_ok=True)
        
        image = Image.open(image_path)
        chunk_width = image.width // chunks_h
        chunk_height = image.height // chunks_v
        
        chunk_number = 1
        for i in range(chunks_v):
            for j in range(chunks_h):
                left = j * chunk_width
                top = i * chunk_height
                right = left + chunk_width
                bottom = top + chunk_height
                
                chunk = image.crop((left, top, right, bottom))
                chunk.save(f&#39;{output_dir}/{chunk_number}.png&#39;, &#39;PNG&#39;)
                chunk_number += 1
        
        print(f&quot;Image divided into {chunks_h * chunks_v} chunks.&quot;)
        return chunks_h * chunks_v
    
    def convert_to_webp(self, input_path, output_path, quality=35):
        &quot;&quot;&quot;Convert single PNG to WebP&quot;&quot;&quot;
        try:
            with Image.open(input_path) as img:
                if img.mode in (&#39;RGBA&#39;, &#39;RGB&#39;):
                    output_path = output_path.replace(&#39;.png&#39;, &#39;.webp&#39;)
                    img.save(output_path, &#39;WEBP&#39;,
                           quality=quality,
                           lossless=False,
                           method=6,
                           exact=True)
                    
                    original_size = os.path.getsize(input_path)
                    compressed_size = os.path.getsize(output_path)
                    ratio = (1 - compressed_size/original_size) * 100
                    
                    return True, ratio, f&quot;{original_size/1024:.1f}KB -&amp;gt; {compressed_size/1024:.1f}KB&quot;
                else:
                    return False, 0, &quot;Unsupported image mode&quot;
        except Exception as e:
            return False, 0, str(e)
    
    def compress_images(self, input_dir, output_dir, quality=35, batch_size=4):
        &quot;&quot;&quot;Step 2: Compress images to WebP format&quot;&quot;&quot;
        print(&quot;\nStep 2: Compressing images to WebP...&quot;)
        os.makedirs(output_dir, exist_ok=True)
        
        png_files = [f for f in os.listdir(input_dir) if f.endswith(&#39;.png&#39;)]
        total_files = len(png_files)
        
        if total_files == 0:
            print(&quot;No PNG files found in the input directory&quot;)
            return
        
        successful = 0
        failed = 0
        total_saved = 0
        
        with concurrent.futures.ThreadPoolExecutor(max_workers=batch_size) as executor:
            futures = []
            
            for filename in png_files:
                input_path = os.path.join(input_dir, filename)
                output_path = os.path.join(output_dir, filename)
                
                future = executor.submit(self.convert_to_webp, input_path, output_path, quality)
                futures.append((future, filename))
            
            for future, filename in tqdm(futures, desc=&quot;Converting to WebP&quot;):
                success, ratio, result = future.result()
                
                if success:
                    successful += 1
                    total_saved += ratio
                    tqdm.write(f&quot;\u2713 {filename}: {result} ({ratio:.1f}% smaller)&quot;)
                else:
                    failed += 1
                    tqdm.write(f&quot;\u2717 {filename}: Failed - {result}&quot;)
        
        print(f&quot;\nSuccessfully converted: {successful} images&quot;)
        print(f&quot;Failed: {failed} images&quot;)
        if successful &amp;gt; 0:
            print(f&quot;Average space saved: {total_saved/successful:.1f}%&quot;)

 def main():
    # Configuration
    input_image = &quot;your_image_path.jpg&quot;  # Replace with your image path
    chunks_dir = &quot;image_chunks&quot;  # Directory for image chunks
    webp_dir = &quot;compressed_images&quot;  # Directory for final WebP images
    
    chunks_horizontal = 2
    chunks_vertical = 2
    webp_quality = 35
    batch_size = 4
    
    # Initialize processor
    processor = ImageProcessor()
    
    # Run pipeline
    total_chunks = processor.create_chunks(input_image, chunks_dir, 
                                         chunks_horizontal, chunks_vertical)
    processor.compress_images(chunks_dir, webp_dir, webp_quality, batch_size)

 if __name__ == &quot;__main__&quot;:
    main()&lt;/code&gt;&lt;/pre&gt;&lt;h3 data-pm-slice=&quot;1 3 []&quot;&gt;&lt;strong&gt;How Does This Script Enhance?&lt;/strong&gt;&lt;/h3&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Smaller image sizes&lt;/strong&gt; improve website speed.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;strong&gt;WebP format&lt;/strong&gt; &lt;/span&gt;is widely supported and provides better compression.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;strong&gt;Batch processing&lt;/strong&gt; &lt;/span&gt;saves time for large image sets.&lt;/li&gt;&lt;li&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Reduces hosting &lt;/strong&gt;costs by lowering bandwidth usage.&lt;/li&gt;&lt;/ol&gt;</description><link>https://codeswithsunny.blogspot.com/2025/03/how-to-chunk-images-using-python.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitHZiZ5zK7nXRyyZli7j89CNLsa-uinXKVi6xCNPcPtK5wmt-6CuiWQoU9qm96azdLhzsikiizV3xdi5BsyWgEIefhid_GoJavHGwv64_eopUEzMRFJ0UOGdS9txk_CWWPsighhX8dfCLDzQyw1SIrYlaSzQHR12FTMtUMr577hsRoTsi_RugL7F9m8Kwp/s72-c/Image%20Chunk.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-1666857004678133324</guid><pubDate>Tue, 22 Oct 2024 07:27:00 +0000</pubDate><atom:updated>2025-11-26T14:53:46.645+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">connectivity_plus Flutter</category><category domain="http://www.blogger.com/atom/ns#">Flutter Android iOS connectivity</category><category domain="http://www.blogger.com/atom/ns#">flutter internet connection checker</category><category domain="http://www.blogger.com/atom/ns#">Flutter network connectivity</category><category domain="http://www.blogger.com/atom/ns#">GetX with connectivity_plus</category><category domain="http://www.blogger.com/atom/ns#">Handle offline in Flutter</category><title>Flutter Connectivity Plus: Detect Internet Connection on Android and iOS with GetX – Complete Code Example and Beautiful UI</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/AVvXsEifUg4lGO8di167Ir04Ghbm-L-jEqKS6g1ads1j4JYHtvyarY4Kq1Xpzw4_02ocsniM_pj1_bis9gQpK_M5KFjOGp40LKVxHazLD6dyR7JyeyukdbwVo0RNUUC8ltNxzR2TGpgn63oXDGO3uAAXNLwvcEu_m9fV48NnLbjcBJCc9Nm_7tzJAjToOg8nq85I/s1536/ChatGPT%20Image%20Nov%2026,%202025,%2002_50_59%20PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1536&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifUg4lGO8di167Ir04Ghbm-L-jEqKS6g1ads1j4JYHtvyarY4Kq1Xpzw4_02ocsniM_pj1_bis9gQpK_M5KFjOGp40LKVxHazLD6dyR7JyeyukdbwVo0RNUUC8ltNxzR2TGpgn63oXDGO3uAAXNLwvcEu_m9fV48NnLbjcBJCc9Nm_7tzJAjToOg8nq85I/s16000/ChatGPT%20Image%20Nov%2026,%202025,%2002_50_59%20PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The &lt;code&gt;connectivity_plus&lt;/code&gt; package is a popular tool in Flutter for monitoring network connectivity status across platforms like Android and iOS. This post will provide an SEO-optimized guide to help you rank on Google, along with a complete Flutter code example using &lt;strong&gt;GetX&lt;/strong&gt; for controller binding and view with a beautified UI.&lt;/p&gt;&lt;h4&gt;Table of Contents:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;What is &lt;code&gt;connectivity_plus&lt;/code&gt;?&lt;/li&gt;&lt;li&gt;Why Use &lt;code&gt;connectivity_plus&lt;/code&gt; in Flutter?&lt;/li&gt;&lt;li&gt;Features of &lt;code&gt;connectivity_plus&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Installing &lt;code&gt;connectivity_plus&lt;/code&gt; in Your Flutter Project&lt;/li&gt;&lt;li&gt;Full Code Example: Controller Binding and View&lt;/li&gt;&lt;li&gt;Beautified UI for Network Status&lt;/li&gt;&lt;li&gt;Conclusion&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;What is &lt;code&gt;connectivity_plus&lt;/code&gt;?&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;connectivity_plus&lt;/code&gt; package allows developers to check the network status of a device in Flutter. It detects whether the user is connected to the internet via WiFi, mobile data, or offline.&lt;/p&gt;&lt;h3&gt;Why Use &lt;code&gt;connectivity_plus&lt;/code&gt; in Flutter?&lt;/h3&gt;&lt;p&gt;In many applications, internet connectivity plays a critical role. Whether you are building an e-commerce app or a social media app, knowing the device&#39;s network status is important for managing online/offline operations and providing a smooth user experience.&lt;/p&gt;&lt;p&gt;Key benefits include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Monitoring real-time connectivity changes.&lt;/li&gt;&lt;li&gt;Notifying users about network disconnection.&lt;/li&gt;&lt;li&gt;Helping apps adapt to connectivity conditions like switching between WiFi and mobile data.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Features of &lt;code&gt;connectivity_plus&lt;/code&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Cross-platform:&lt;/strong&gt; Supports both Android and iOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Event-driven:&lt;/strong&gt; Listens for changes in connectivity status.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Easy integration:&lt;/strong&gt; Comes with a simple API for checking and listening to connectivity.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Installing &lt;code&gt;connectivity_plus&lt;/code&gt; in Your Flutter Project&lt;/h3&gt;&lt;p&gt;To use &lt;code&gt;connectivity_plus&lt;/code&gt;, first, add the package to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  connectivity_plus: ^4.0.3  # Use the latest version&lt;/code&gt;&lt;/pre&gt;Then, run:&lt;pre&gt;&lt;code&gt;flutter pub get&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Full Code Example: Controller Binding and View&lt;/h3&gt;&lt;p&gt;In this example, we will use GetX for state management and controller binding to manage network connectivity.&lt;/p&gt;&lt;h4&gt;Step 1: Setting up the GetX Controller&lt;/h4&gt;&lt;p&gt;Create a file &lt;code&gt;connectivity_controller.dart&lt;/code&gt; and define a GetX controller to handle connectivity status:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:connectivity_plus/connectivity_plus.dart&#39;;
 import &#39;package:get/get.dart&#39;;

 class ConnectivityController extends GetxController {
   var connectionStatus = 0.obs; // 0 - Unknown, 1 - WiFi, 2 - Mobile, 3 - Offline

   final Connectivity _connectivity = Connectivity();

   @override
   void onInit() {
    super.onInit();
    _checkConnection();
    _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
   }

   Future&lt;void&gt; _checkConnection() async {
    var connectivityResult = await _connectivity.checkConnectivity();
    _updateConnectionStatus(connectivityResult);
   }

   void _updateConnectionStatus(ConnectivityResult result) {
     switch (result) {
       case ConnectivityResult.wifi:
         connectionStatus.value = 1;
         break;
       case ConnectivityResult.mobile:
         connectionStatus.value = 2;
         break;
       case ConnectivityResult.none:
         connectionStatus.value = 3;
         break;
       default:
         connectionStatus.value = 0;
         break;
     }
   }
 }&lt;/void&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;Step 2: Creating the UI&lt;/h4&gt;&lt;p&gt;Now, create the UI to display the connectivity status in &lt;code&gt;main.dart&lt;/code&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;connectivity_controller.dart&#39;;

 void main() {
   runApp(MyApp());
 }

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: &#39;Connectivity Plus Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
       ),
       home: HomeScreen(),
     );
   }
 }

 class HomeScreen extends StatelessWidget {
  final ConnectivityController controller = Get.put(ConnectivityController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(&#39;Network Status&#39;),
      ),
      body: Center(
        child: Obx(() {
          return Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Icon(
                _getConnectionIcon(controller.connectionStatus.value),
                size: 100,
                color: _getConnectionColor(controller.connectionStatus.value),
              ),
              SizedBox(height: 20),
              Text(
                _getConnectionText(controller.connectionStatus.value),
                style: TextStyle(fontSize: 24),
              ),
            ],
          );
        }),
      ),
    );
  }

  IconData _getConnectionIcon(int status) {
    switch (status) {
      case 1:
        return Icons.wifi;
      case 2:
        return Icons.signal_cellular_alt;
      case 3:
        return Icons.signal_wifi_off;
      default:
        return Icons.help_outline;
    }
  }

  Color _getConnectionColor(int status) {
    switch (status) {
      case 1:
        return Colors.green;
      case 2:
        return Colors.orange;
      case 3:
        return Colors.red;
      default:
        return Colors.grey;
    }
  }

  String _getConnectionText(int status) {
    switch (status) {
      case 1:
        return &quot;Connected to WiFi&quot;;
      case 2:
        return &quot;Using Mobile Data&quot;;
      case 3:
        return &quot;No Internet Connection&quot;;
      default:
        return &quot;Unknown Network Status&quot;;
     }
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Beautified UI for Network Status&lt;/h3&gt;&lt;p&gt;In the above UI:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Icons:&lt;/strong&gt; Represent different connection states such as WiFi, mobile data, or no connection.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Colors:&lt;/strong&gt; Different colors (green, orange, red) are used to highlight the current network status.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Dynamic Text:&lt;/strong&gt; Text changes dynamically based on the connection status.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You can further enhance this UI by adding animations or better design elements such as custom fonts, shadow effects, or background gradients.&lt;/p&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;&lt;p&gt;Using &lt;code&gt;connectivity_plus&lt;/code&gt; in your Flutter application allows you to monitor network connectivity easily and efficiently. With the GetX package for state management, the implementation becomes seamless. By following this guide, you can quickly integrate connectivity monitoring into your app and provide users with real-time feedback on their network status.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-use-connectivity-plus-in-flutter-android-ios-getx.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifUg4lGO8di167Ir04Ghbm-L-jEqKS6g1ads1j4JYHtvyarY4Kq1Xpzw4_02ocsniM_pj1_bis9gQpK_M5KFjOGp40LKVxHazLD6dyR7JyeyukdbwVo0RNUUC8ltNxzR2TGpgn63oXDGO3uAAXNLwvcEu_m9fV48NnLbjcBJCc9Nm_7tzJAjToOg8nq85I/s72-c/ChatGPT%20Image%20Nov%2026,%202025,%2002_50_59%20PM.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5501949505402538610</guid><pubDate>Mon, 21 Oct 2024 14:43:00 +0000</pubDate><atom:updated>2025-11-26T17:08:02.106+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">GraphQL tutorial for Flutter&#xa;GraphQL vs REST API&#xa;Flutter GetX GraphQL example&#xa;Real-time subscriptions in GraphQL&#xa;GraphQL mutations and queries</category><category domain="http://www.blogger.com/atom/ns#">What is GraphQL</category><title>What is GraphQL? A Comprehensive Guide with Flutter and GetX Example</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&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/b/R29vZ2xl/AVvXsEgxIHBCEFZZ_yGKfpiYA4uoxJ1cPwZFMgqOEeabnF5Pw8-pNDLgA1CJ4sJxDOj_4gmR4iluRHrVlehJV7g1s3E38NwB7RD7Y-DOzXg6LRpufzDHH5xBEvNRliC9llztT3-dKQ35G9eglzIra22-f7uawFRWGNdkA8DEljkoxsQqeSBrOvjaUf1Ney6Efp5R/s1600/A%20modern,%20professional%20tech%20illustration%20explaining%20GraphQL%20with%20Flutter%20and%20GetX.%20Use%20a%20clean%20blue%E2%80%93purple%20gradient%20background%20with%20soft%20abstract%20shapes.%20Show%20a%20central%20GraphQL%20logo%20connected%20with%20nodes,%20API%20schema%20icons,%20and%20data%20flo%20(1).jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;896&quot; data-original-width=&quot;1600&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxIHBCEFZZ_yGKfpiYA4uoxJ1cPwZFMgqOEeabnF5Pw8-pNDLgA1CJ4sJxDOj_4gmR4iluRHrVlehJV7g1s3E38NwB7RD7Y-DOzXg6LRpufzDHH5xBEvNRliC9llztT3-dKQ35G9eglzIra22-f7uawFRWGNdkA8DEljkoxsQqeSBrOvjaUf1Ney6Efp5R/w640-h358/A%20modern,%20professional%20tech%20illustration%20explaining%20GraphQL%20with%20Flutter%20and%20GetX.%20Use%20a%20clean%20blue%E2%80%93purple%20gradient%20background%20with%20soft%20abstract%20shapes.%20Show%20a%20central%20GraphQL%20logo%20connected%20with%20nodes,%20API%20schema%20icons,%20and%20data%20flo%20(1).jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;What is GraphQL? A Comprehensive Guide with Flutter and GetX Example&lt;/h2&gt;&lt;p&gt;In the world of modern web and mobile application development, &lt;strong&gt;GraphQL&lt;/strong&gt; has emerged as a powerful alternative to traditional REST APIs. Built by &lt;strong&gt;Facebook&lt;/strong&gt; and released as an open-source project in 2015, &lt;strong&gt;GraphQL&lt;/strong&gt; offers a flexible, efficient, and powerful way to interact with APIs.&lt;/p&gt;&lt;p&gt;This guide provides a detailed breakdown of &lt;strong&gt;GraphQL&lt;/strong&gt;, including &lt;strong&gt;Mutations&lt;/strong&gt;, &lt;strong&gt;Subscriptions&lt;/strong&gt;, how it compares to &lt;strong&gt;REST APIs&lt;/strong&gt;, and why developers prefer using it. We&#39;ll also cover setting up &lt;strong&gt;GraphQL&lt;/strong&gt; with &lt;strong&gt;Flutter&lt;/strong&gt; using &lt;strong&gt;GetX&lt;/strong&gt; for state management, complete with working code.&lt;/p&gt;&lt;h3&gt;What is GraphQL?&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;GraphQL&lt;/strong&gt; is a query language for APIs and a runtime environment that executes these queries. It allows clients to specify exactly what data they need and nothing more, making data-fetching efficient and adaptable. Unlike REST, where each endpoint returns fixed data, &lt;strong&gt;GraphQL&lt;/strong&gt; uses a single endpoint to fetch various resources.&lt;/p&gt;&lt;h3&gt;Key Features of GraphQL&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Precise Data Fetching&lt;/strong&gt;: Clients ask for exactly the data they need, reducing both over-fetching and under-fetching issues common in REST.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single Endpoint&lt;/strong&gt;: A single endpoint is used to perform different actions (queries, mutations, subscriptions) rather than multiple endpoints.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Type-Safe Schema&lt;/strong&gt;: GraphQL APIs use a type system to define the shape of your data, which enhances error detection and tooling support.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Real-Time Data&lt;/strong&gt;: Through &lt;strong&gt;subscriptions&lt;/strong&gt;, clients can receive real-time updates whenever data changes.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;History of GraphQL&lt;/h3&gt;&lt;p&gt;GraphQL was developed by &lt;strong&gt;Facebook&lt;/strong&gt; in 2012 to address problems they encountered with mobile performance and REST APIs. It was officially open-sourced in 2015 and has been steadily gaining popularity in the development community. Major companies like GitHub, Shopify, and Twitter have adopted GraphQL to power their APIs.&lt;/p&gt;&lt;h3&gt;How Does GraphQL Work?&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Client Request&lt;/strong&gt;: The client sends a query, mutation, or subscription request to the GraphQL server specifying the exact data required.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Server Resolves&lt;/strong&gt;: The server processes this request based on the defined schema and executes the resolvers.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Data Response&lt;/strong&gt;: The server returns only the requested data back to the client.&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Why Use GraphQL?&lt;/h3&gt;&lt;p&gt;Here are a few reasons why &lt;strong&gt;GraphQL&lt;/strong&gt; has become the preferred choice for many developers:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Efficient Data Fetching&lt;/strong&gt;: Unlike REST, where you often over-fetch or under-fetch data, &lt;strong&gt;GraphQL&lt;/strong&gt; lets you fetch only the required data, making API requests efficient.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single API Endpoint&lt;/strong&gt;: Instead of multiple REST endpoints, you have a single endpoint to handle all requests, making the backend simpler.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Strong Type System&lt;/strong&gt;: GraphQL uses a schema to define data types, helping developers catch errors early and improving overall robustness.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Real-Time Subscriptions&lt;/strong&gt;: GraphQL supports real-time data updates with &lt;strong&gt;subscriptions&lt;/strong&gt;, which is great for live updates in chat apps, stock data, etc.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Flexible Queries&lt;/strong&gt;: Clients can request different sets of data using a single query by specifying exactly which fields they need.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;GraphQL Operations: Queries, Mutations, and Subscriptions&lt;/h3&gt;&lt;div&gt;&lt;p&gt;&lt;strong&gt;Key Concepts in GraphQL:&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Query:&lt;/strong&gt; Used to fetch data from the server.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Mutation:&lt;/strong&gt; Allows modifying server-side data (e.g., creating, updating, or deleting).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Subscription:&lt;/strong&gt; Enables real-time updates, letting clients listen for specific events.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Fetches data (similar to a GET request in REST).&lt;/li&gt;&lt;li&gt;Exapmle&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; query {
  users {
     id
     name
     email
   }
 }&lt;/code&gt;&lt;/pre&gt;This query fetches all users and their respective id, name and email&lt;div&gt;&lt;p&gt;&lt;strong&gt;Mutation&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Used to modify server-side data (similar to POST, PUT, DELETE in REST).&lt;/li&gt;&lt;li&gt;Example:&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt; mutation {
  createUser(name: &quot;John Doe&quot;, email: &quot;john@example.com&quot;) {
     id
     name
     email
   }
 }&lt;/code&gt;&lt;/pre&gt;This mutation creates a new user with the provided name and email&lt;div&gt;&lt;p&gt;&lt;strong&gt;Subscription&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Enables real-time updates, notifying the client whenever a specific event happens.&lt;/li&gt;&lt;li&gt;Example&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt; subscription {
  userAdded {
     id
     name
   }
 }&lt;/code&gt;&lt;/pre&gt;This subscription notifies the client whenever a new user is added, returning the user’s id and name&lt;div&gt;&lt;hr /&gt;&lt;h3&gt;GraphQL vs. REST: A Detailed Comparison&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;GraphQL&lt;/strong&gt; and &lt;strong&gt;REST&lt;/strong&gt; are often compared due to their widespread use in API development. Here&#39;s how they differ:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;table style=&quot;border-collapse: collapse; margin: 20px 0px; width: 100%;&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Feature&lt;/th&gt;
            &lt;th style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;GraphQL&lt;/th&gt;
            &lt;th style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;REST API&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Data Fetching&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Flexible, returns only required data&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Fixed structure, over-fetching or under-fetching issues&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;API Structure&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Single endpoint&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Multiple endpoints for different resources&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Versioning&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;No need for API versioning&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Requires versioning (e.g., /v1, /v2)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Real-time Capabilities&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Built-in subscriptions&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Needs additional tooling (e.g., WebSockets)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Learning Curve&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Steeper (due to schema, queries)&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Simpler, widely known concepts (HTTP methods)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Tooling&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Strong schema-based tooling support&lt;/td&gt;
            &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px;&quot;&gt;Limited tooling based on JSON structure&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;&lt;hr /&gt;&lt;h3&gt;Building a Flutter App with GraphQL and GetX&lt;/h3&gt;&lt;p&gt;In this section, we&#39;ll walk through creating a &lt;strong&gt;Flutter&lt;/strong&gt; application that integrates &lt;strong&gt;GraphQL&lt;/strong&gt; using &lt;strong&gt;GetX&lt;/strong&gt; for state management. The app will include fetching user data, creating users, and handling real-time updates with &lt;strong&gt;GraphQL subscriptions&lt;/strong&gt;.&lt;/p&gt;&lt;h4&gt;Step 1: Add Dependencies&lt;/h4&gt;&lt;p&gt;Update your &lt;code&gt;pubspec.yaml&lt;/code&gt; with the following dependencies:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;  dependencies:
  flutter:
    sdk: flutter
  get:
  graphql_flutter:&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;Step 2: Setup the Main File&lt;/h4&gt;&lt;p&gt;Initialize the &lt;strong&gt;GraphQL&lt;/strong&gt; client in &lt;code&gt;main.dart&lt;/code&gt; and configure the app to use GetX with &lt;strong&gt;GraphQLProvider&lt;/strong&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;package:graphql_flutter/graphql_flutter.dart&#39;;

 void main() async {
  await initHiveForFlutter();
  runApp(MyApp());
 }

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final HttpLink httpLink = HttpLink(
      &#39;https://your-graphql-endpoint&#39;,
    );

    ValueNotifier&lt;graphqlclient&gt; client = ValueNotifier(
      GraphQLClient(
        link: httpLink,
        cache: GraphQLCache(store: HiveStore()),
      ),
    );

    return GraphQLProvider(
      client: client,
      child: GetMaterialApp(
        home: HomeScreen(),
       ),
     );
   }
 }&lt;/graphqlclient&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;Step 3: Create a HomeController Using GetX&lt;/h4&gt;&lt;p&gt;This controller manages GraphQL queries, mutations, and state updates.&lt;/p&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:graphql_flutter/graphql_flutter.dart&#39;;

 class HomeController extends GetxController {
  // Observable list to store users
  var users = &lt;map dynamic=&quot;&quot; tring=&quot;&quot;&gt;&amp;gt;[].obs;

  // GraphQL query to fetch users
  final String fetchUsersQuery = &quot;&quot;&quot;
    query {
      users {
        id
        name
        email
      }
    }
  &quot;&quot;&quot;;

  // Function to fetch users from the server
  void fetchUsers(GraphQLClient client) async {
    final QueryOptions options = QueryOptions(
      document: gql(fetchUsersQuery),
    );

    // Execute the query
    final result = await client.query(options);
    
    // Check for errors
    if (result.hasException) {
      print(result.exception.toString());
      return;
    }
    
    // Update the observable list with fetched users
    users.value = List&lt;map dynamic=&quot;&quot; tring=&quot;&quot;&gt;&amp;gt;.from(result.data![&#39;users&#39;]);
  }

  // GraphQL mutation to create a new user
  final String createUserMutation = &quot;&quot;&quot;
    mutation(\$name: String!, \$email: String!) {
      createUser(name: \$name, email: \$email) {
        id
        name
        email
      }
    }
  &quot;&quot;&quot;;

  // Function to create a new user
  void createUser(GraphQLClient client, String name, String email) async {
    final MutationOptions options = MutationOptions(
      document: gql(createUserMutation),
      variables: {
        &#39;name&#39;: name,
        &#39;email&#39;: email,
      },
    );

    // Execute the mutation
    final result = await client.mutate(options);

    // Check for errors
    if (result.hasException) {
      print(result.exception.toString());
      return;
    }

    // Add the newly created user to the observable list
    users.add(result.data![&#39;createUser&#39;]);
   }
 }&lt;/map&gt;&lt;/map&gt;&lt;/code&gt;&lt;h4 style=&quot;font-family: Times; white-space: normal;&quot;&gt;Step 4:&amp;nbsp;&lt;span class=&quot;hljs-selector-tag&quot;&gt;Create&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;HomeScreen&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;UI&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span class=&quot;hljs-selector-tag&quot;&gt;The&lt;/span&gt; `&lt;span class=&quot;hljs-selector-tag&quot;&gt;HomeScreen&lt;/span&gt;` &lt;span class=&quot;hljs-selector-tag&quot;&gt;widget&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;displays&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;users&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;allows&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;you&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;users&lt;/span&gt;.&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;package:graphql_flutter/graphql_flutter.dart&#39;;
 import &#39;home_controller.dart&#39;;

 class HomeScreen extends StatelessWidget {
  final HomeController homeController = Get.put(HomeController());
  final TextEditingController nameController = TextEditingController();
  final TextEditingController emailController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    final GraphQLClient client = GraphQLProvider.of(context).value;

    return Scaffold(
      appBar: AppBar(title: Text(&#39;GraphQL + Flutter + GetX&#39;)),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          children: [
            ElevatedButton(
              onPressed: () =&amp;gt; homeController.fetchUsers(client),
              child: Text(&#39;Fetch Users&#39;),
            ),
            SizedBox(height: 16),
            Expanded(
              child: Obx(() {
                // Display users or a message if none are found
                if (homeController.users.isEmpty) {
                  return Center(child: Text(&#39;No users found.&#39;));
                }
                return ListView.builder(
                  itemCount: homeController.users.length,
                  itemBuilder: (context, index) {
                    final user = homeController.users[index];
                    return ListTile(
                      title: Text(user[&#39;name&#39;]),
                      subtitle: Text(user[&#39;email&#39;]),
                    );
                  },
                );
              }),
            ),
            TextField(
              controller: nameController,
              decoration: InputDecoration(hintText: &#39;Enter Name&#39;),
            ),
            TextField(
              controller: emailController,
              decoration: InputDecoration(hintText: &#39;Enter Email&#39;),
            ),
            SizedBox(height: 8),
            ElevatedButton(
              onPressed: () {
                // Create a new user with the input data
                homeController.createUser(client, nameController.text, emailController.text);
                // Clear the input fields
                nameController.clear();
                emailController.clear();
              },
              child: Text(&#39;Add User&#39;),
             ),
           ],
         ),
       ),
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;&lt;p&gt;Integrating &lt;strong&gt;GraphQL&lt;/strong&gt; with &lt;strong&gt;Flutter&lt;/strong&gt; and &lt;strong&gt;GetX&lt;/strong&gt; allows for powerful, real-time apps with minimal data-fetching overhead. This tutorial covered the basics of &lt;strong&gt;GraphQL&lt;/strong&gt; operations and provided a working example in Flutter, making it easier to understand the flexibility and performance benefits of using GraphQL in your apps.&lt;/p&gt;&lt;p&gt;By using &lt;strong&gt;GraphQL&lt;/strong&gt;&#39;s query language and real-time subscriptions, you can build scalable applications that provide optimal performance and user experience. For modern app development, especially when working with dynamic data, &lt;strong&gt;GraphQL&lt;/strong&gt; is an excellent choice to explore.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/what-is-graphql-comprehensive-guide.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxIHBCEFZZ_yGKfpiYA4uoxJ1cPwZFMgqOEeabnF5Pw8-pNDLgA1CJ4sJxDOj_4gmR4iluRHrVlehJV7g1s3E38NwB7RD7Y-DOzXg6LRpufzDHH5xBEvNRliC9llztT3-dKQ35G9eglzIra22-f7uawFRWGNdkA8DEljkoxsQqeSBrOvjaUf1Ney6Efp5R/s72-w640-h358-c/A%20modern,%20professional%20tech%20illustration%20explaining%20GraphQL%20with%20Flutter%20and%20GetX.%20Use%20a%20clean%20blue%E2%80%93purple%20gradient%20background%20with%20soft%20abstract%20shapes.%20Show%20a%20central%20GraphQL%20logo%20connected%20with%20nodes,%20API%20schema%20icons,%20and%20data%20flo%20(1).jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-150162535517337521</guid><pubDate>Mon, 21 Oct 2024 05:58:00 +0000</pubDate><atom:updated>2025-11-26T17:02:46.837+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter Local Notifications Using GetX: Step-by-Step Setup with Code</category><category domain="http://www.blogger.com/atom/ns#">How to use local push notification in flutter using getx</category><title>How to Set Up Flutter Local Notifications (Android &amp; iOS) with GetX | Full Code Example and Beautiful UI</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&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/b/R29vZ2xl/AVvXsEjY8eom59Er8741CtbYPJvFx5I2O0z9n71q9FlGCLpYlMgQGUVlCyBykc9jYRI7cpmqvIVrHRM0n6wCPXQUTAAKyorN44hhNbuyYiNvwCNerBXuCB1d3CMgRNSwY2fPbRz__jE4J6z0wYw_OlCKVdhNaG8xTYhRTPosW5ythceP3YQ1_2ddAgALQ1hVqT8z/s1600/A%20modern,%20clean%20tech%20illustration%20showcasing%20Flutter%20Local%20Notifications%20setup%20using%20GetX.%20Create%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20shadows%20and%20abstract%20shapes.%20Display%20a%20smartphone%20mockup%20with%20a%20notification%20banner%20poppin.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;896&quot; data-original-width=&quot;1600&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8eom59Er8741CtbYPJvFx5I2O0z9n71q9FlGCLpYlMgQGUVlCyBykc9jYRI7cpmqvIVrHRM0n6wCPXQUTAAKyorN44hhNbuyYiNvwCNerBXuCB1d3CMgRNSwY2fPbRz__jE4J6z0wYw_OlCKVdhNaG8xTYhRTPosW5ythceP3YQ1_2ddAgALQ1hVqT8z/w640-h358/A%20modern,%20clean%20tech%20illustration%20showcasing%20Flutter%20Local%20Notifications%20setup%20using%20GetX.%20Create%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20shadows%20and%20abstract%20shapes.%20Display%20a%20smartphone%20mockup%20with%20a%20notification%20banner%20poppin.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;How to Use &lt;code&gt;flutter_local_notifications&lt;/code&gt; in Flutter with GetX: Full Code Example with Beautiful UI&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;flutter_local_notifications&lt;/code&gt; package enables you to display local notifications in your Flutter app. Combined with GetX for state management, you can efficiently schedule and manage notifications with real-time updates.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;p&gt;Ensure the following dependencies are added to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  flutter_local_notifications: ^12.0.4&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Setting up the Notification Controller&lt;/h3&gt;&lt;p&gt;We&#39;ll create a controller that manages notification scheduling and real-time state updates using GetX.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;notification_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:flutter_local_notifications/flutter_local_notifications.dart&#39;;

 class NotificationController extends GetxController {
  FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = 
      FlutterLocalNotificationsPlugin();
  
  @override
  void onInit() {
    super.onInit();
    initializeNotifications();
  }

  void initializeNotifications() async {
    const AndroidInitializationSettings initializationSettingsAndroid =
        AndroidInitializationSettings(&#39;@mipmap/ic_launcher&#39;);

    final InitializationSettings initializationSettings = InitializationSettings(
      android: initializationSettingsAndroid,
    );

    await flutterLocalNotificationsPlugin.initialize(initializationSettings);
  }

  void showNotification() async {
    const AndroidNotificationDetails androidPlatformChannelSpecifics =
        AndroidNotificationDetails(
      &#39;your_channel_id&#39;,
      &#39;your_channel_name&#39;,
      importance: Importance.high,
      priority: Priority.high,
    );

    const NotificationDetails platformChannelSpecifics =
        NotificationDetails(android: androidPlatformChannelSpecifics);

    await flutterLocalNotificationsPlugin.show(
      0,
      &#39;Hello!&#39;,
      &#39;This is a local notification.&#39;,
      platformChannelSpecifics,
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;initializeNotifications&lt;/strong&gt;: Initializes the local notifications system.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;showNotification&lt;/strong&gt;: Schedules and displays a basic notification.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View with Beautiful UI&lt;/h3&gt;&lt;p&gt;We’ll now create the view where users can trigger the notifications. The UI will be designed to look modern and attractive.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;notification_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;notification_controller.dart&#39;;

 class NotificationView extends GetView&lt;notificationcontroller&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Local Notifications&#39;),
        centerTitle: true,
        backgroundColor: Colors.teal,
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // App logo
            Image.asset(&#39;assets/notification.png&#39;, height: 200),
            const SizedBox(height: 20),
            
            // Notification button
            ElevatedButton(
              onPressed: controller.showNotification,
              style: ElevatedButton.styleFrom(
                padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
                primary: Colors.teal, // button color
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(30),
                ),
              ),
              child: const Text(
                &#39;Show Notification&#39;,
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
            ),
            const SizedBox(height: 20),

            // Subtitle
            const Text(
              &#39;Tap the button to show a notification!&#39;,
              style: TextStyle(fontSize: 16, color: Colors.grey),
             ),
           ],
         ),
       ),
     );
   }
 }&lt;/notificationcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;AppBar&lt;/strong&gt;: Displays a styled app bar with a centered title.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Image.asset&lt;/strong&gt;: Adds an image as a visual element (e.g., a logo).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ElevatedButton&lt;/strong&gt;: A styled button to trigger notifications.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Text&lt;/strong&gt;: A simple subtitle to guide the user.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;The binding will inject the &lt;code&gt;NotificationController&lt;/code&gt; into the view.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;notification_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;notification_controller.dart&#39;;

 class NotificationBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;notificationcontroller&gt;(() =&amp;gt; NotificationController());
   }
 }&lt;/notificationcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Setting up the Main App&lt;/h3&gt;&lt;p&gt;Finally, configure the routing and binding in your &lt;code&gt;main.dart&lt;/code&gt;.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;notification_view.dart&#39;;
 import &#39;notification_binding.dart&#39;;

 void main() {
  runApp(MyApp());
 }

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; NotificationView(),
          binding: NotificationBinding(),
        ),
      ],
      title: &#39;Local Notifications Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.teal,
       ),
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;&lt;strong&gt;Step 6: Android and iOS Permissions&lt;/strong&gt;&lt;/h3&gt;&lt;h4&gt;Android&lt;/h4&gt;&lt;p&gt;In your &lt;code&gt;AndroidManifest.xml&lt;/code&gt;, add the following permissions:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; &amp;lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Also, ensure that you add the necessary notification channel in the Android setup (if required).&lt;/p&gt;&lt;h4&gt;iOS&lt;/h4&gt;&lt;p&gt;For iOS, you need to request notification permissions. Add this to your &lt;code&gt;Info.plist&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; &amp;lt;key&amp;gt;UIBackgroundModes&amp;lt;/key&amp;gt;
 &amp;lt;array&amp;gt;
  &amp;lt;string&amp;gt;fetch&amp;lt;/string&amp;gt;
  &amp;lt;string&amp;gt;remote-notification&amp;lt;/string&amp;gt;
 &amp;lt;/array&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this tutorial, we implemented local notifications in Flutter for both Android and iOS using the &lt;code&gt;flutter_local_notifications&lt;/code&gt; package with GetX for state management. The example provided includes a fully functional code setup with a beautified UI, ensuring the notification feature in your Flutter app is well-organized and visually appealing.&lt;/p&gt;&lt;p&gt;With this guide, you now have a complete solution for managing local notifications across both platforms using Flutter and GetX. Let me know if you need further assistance or customizations!&lt;/p&gt;
</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-set-up-flutter-local.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8eom59Er8741CtbYPJvFx5I2O0z9n71q9FlGCLpYlMgQGUVlCyBykc9jYRI7cpmqvIVrHRM0n6wCPXQUTAAKyorN44hhNbuyYiNvwCNerBXuCB1d3CMgRNSwY2fPbRz__jE4J6z0wYw_OlCKVdhNaG8xTYhRTPosW5ythceP3YQ1_2ddAgALQ1hVqT8z/s72-w640-h358-c/A%20modern,%20clean%20tech%20illustration%20showcasing%20Flutter%20Local%20Notifications%20setup%20using%20GetX.%20Create%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20shadows%20and%20abstract%20shapes.%20Display%20a%20smartphone%20mockup%20with%20a%20notification%20banner%20poppin.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-943123721042240020</guid><pubDate>Sat, 19 Oct 2024 16:51:00 +0000</pubDate><atom:updated>2024-10-19T22:21:46.815+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter OTP screen example</category><category domain="http://www.blogger.com/atom/ns#">Flutter OTP screen tutorial</category><category domain="http://www.blogger.com/atom/ns#">GetX OTP verification Flutter</category><category domain="http://www.blogger.com/atom/ns#">OTP validation Flutter GetX</category><category domain="http://www.blogger.com/atom/ns#">Timer in OTP screen Flutter</category><title>Flutter OTP Verification with Pin Code Field and Resend Button Using GetX – Complete Example with Timer and Validation.</title><description>&lt;h3&gt;&lt;strong&gt;How to Build an OTP Verification Screen in Flutter with GetX: Complete Guide with Beautified UI&lt;/strong&gt;&lt;/h3&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/b/R29vZ2xl/AVvXsEik4kItGGHNpgoFBUr0OCnTT87Ph2y00CfFyFeLwmZWt-GK1gLnReW6IUhN4ofoVSsjL_4vqsbXwocqmVTzGoX9M2WxpQhk9sHb32xpeFOMOBMzzrWBHsi8WwN5VICj-DBNIq7W4B9kY5M2nYI7tWO3Io5ZeT0CrjSNwgglcl_FptZJFD5wzd5v3YhaqipH/s2560/RPY%20(2).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter OTP Verification with Pin Code Field and Resend Button Using GetX&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik4kItGGHNpgoFBUr0OCnTT87Ph2y00CfFyFeLwmZWt-GK1gLnReW6IUhN4ofoVSsjL_4vqsbXwocqmVTzGoX9M2WxpQhk9sHb32xpeFOMOBMzzrWBHsi8WwN5VICj-DBNIq7W4B9kY5M2nYI7tWO3Io5ZeT0CrjSNwgglcl_FptZJFD5wzd5v3YhaqipH/s16000/RPY%20(2).png&quot; title=&quot;Flutter OTP Verification with Pin Code Field and Resend Button Using GetX&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;p&gt;Creating an OTP (One-Time Password) verification screen is a crucial part of many apps for security purposes. In this post, we’ll guide you through setting up a modern OTP verification screen in Flutter using GetX for state management. We&#39;ll also provide a beautiful UI that resembles the design shared.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;&lt;strong&gt;Step 1: Add Dependencies&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Add the necessary dependencies in your &lt;code&gt;pubspec.yaml&lt;/code&gt; file:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  pin_code_fields: ^7.4.0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to fetch the packages.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;&lt;strong&gt;Step 2: Create the OTP Controller with GetX&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;We’ll create a controller that manages the timer, OTP input, and validation.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;otp_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:flutter/material.dart&#39;;
 import &#39;dart:async&#39;;

 class OTPController extends GetxController {
  var isCodeExpired = false.obs;
  var otp = &#39;&#39;.obs;
  var remainingTime = 60.obs; // 1 minute in seconds
  Timer? timer;
  TextEditingController otpController = TextEditingController(); // Create a TextEditingController

  @override
  void onInit() {
    startTimer();
    super.onInit();
  }

  void startTimer() {
    timer = Timer.periodic(const Duration(seconds: 1), (timer) {
      if (remainingTime.value &amp;gt; 0) {
        remainingTime.value--;
      } else {
        isCodeExpired.value = true;
        timer.cancel();
      }
    });
  }

  void resendCode() {
    remainingTime.value = 60; // Reset timer to 60 seconds
    isCodeExpired.value = false;
    otp.value = &#39;&#39;; // Clear the OTP field in the controller
    otpController.clear(); // Clear the text fields in PinCodeTextField
    startTimer(); // Restart the timer
    update(); // Notify UI to update
  }

  void onOTPComplete(String value) {
    otp.value = value;
  }

  @override
  void onClose() {
    timer?.cancel();
    otpController.dispose(); // Dispose of the controller
    super.onClose();
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;&lt;strong&gt;Step 3: Create the Beautified OTP Verification UI&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;We&#39;ll design the UI similar to the one you shared with a countdown timer, input fields for the OTP, and a &quot;Resend Code&quot; option.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;otp_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:flutter_svg/svg.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;package:getx_tutorials/widgets/custom_button/custom_button.dart&#39;;
 import &#39;package:google_fonts/google_fonts.dart&#39;;
 import &#39;package:pin_code_fields/pin_code_fields.dart&#39;;
 import &#39;package:sizer/sizer.dart&#39;;
 import &#39;../widgets/app_color/app_color.dart&#39;;
 import &#39;../widgets/app_image/app_image.dart&#39;;
 import &#39;otp_controller.dart&#39;;

 class OtpVerificationScreen extends GetView&lt;otpcontroller&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SvgPicture.asset(
              AppImages.scanIcon,
              height: 65.0, // Adjust the size of the icon if necessary
              width: 65.0,
            ), // Add your logo here
            const SizedBox(height: 20),
            Text(
              &#39;OTP Verification&#39;,
              style: GoogleFonts.poppins(
                  fontSize: 24, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 10),
            Text(
              &#39;We have sent an OTP on given number +91 2224 555 333&#39;,
              textAlign: TextAlign.center,
              style: GoogleFonts.poppins(fontSize: 16, color: Colors.grey),
            ),
            const SizedBox(height: 20),
            Obx(() {
              return Text(
                controller.isCodeExpired.value
                    ? &quot;Your otp has expired please resend&quot;
                    : &quot;00:${controller.remainingTime.value.toString().padLeft(2, &#39;0&#39;)}&quot;,
                style: GoogleFonts.poppins(
                  color: controller.isCodeExpired.value
                      ? AppColors.appColor
                      : AppColors.appColor,
                  fontSize: 18,
                ),
              );
            }),
            SizedBox(height: 4.h),
            PinCodeTextField(
              appContext: context,
              length: 4,
              onChanged: (value) {
                controller.update();
              },
              onCompleted: controller.onOTPComplete,
              controller: controller.otpController,
              autoDismissKeyboard: true,
              enablePinAutofill: true,
              pinTheme: PinTheme(
                shape: PinCodeFieldShape.box,
                borderRadius: BorderRadius.circular(15),
                fieldHeight: 75,
                fieldWidth: 75,
                activeColor: AppColors.appColor,
                activeFillColor: AppColors.appbarColor,
                selectedColor: AppColors.appColor,
                selectedFillColor: AppColors.btnColor,
                inactiveColor: Colors.grey,
              ),
            ),
            const SizedBox(height: 20),
            const SizedBox(height: 20),
            Obx(
              () =&amp;gt; CustomButton(
                onPressed: controller.resendCode,
                backgroundColor: controller.otp.value.length == 4
                    ? AppColors.appColor
                    : controller.isCodeExpired.value
                        ? AppColors.appColor
                        : AppColors.btnColor,
                text:
                    controller.isCodeExpired.value ? &quot;Send Code Again&quot; : &#39;Next&#39;,
                image: AppImages.rightArrow,
                imageColor: controller.isCodeExpired.value
                    ? AppColors.white
                    : controller.otp.value.length == 4
                        ? AppColors.whiteColor
                        : AppColors.optionIconColor,
                color: controller.isCodeExpired.value
                    ? AppColors.white
                    : controller.otp.value.length == 4
                        ? AppColors.whiteColor
                        : AppColors.optionIconColor,
               ),
             )
           ],
         ),
       ),
     );
   }
 }&lt;/otpcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;&lt;strong&gt;Step 4: Binding the Controller&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Bind the &lt;code&gt;OTPController&lt;/code&gt; to the view using GetX bindings.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;otp_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;otp_controller.dart&#39;;

 class OtpVerificationBindings extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;otpcontroller&gt;(() =&amp;gt; OTPController());
   }
 }&lt;/otpcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;&lt;strong&gt;Step 5: Main Application Setup&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;In your &lt;code&gt;main.dart&lt;/code&gt;, configure the routes and bindings using GetX.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get_navigation/src/root/get_material_app.dart&#39;;
 import &#39;package:getx_tutorials/widgets/app_color/app_color.dart&#39;;
 import &#39;package:getx_tutorials/widgets/app_routes/app_routes.dart&#39;;
 import &#39;package:responsive_framework/responsive_wrapper.dart&#39;;
 import &#39;package:responsive_framework/utils/scroll_behavior.dart&#39;;
 import &#39;package:sizer/sizer.dart&#39;;

 void main() {
  runApp(const MyApp());
 }

 class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    Map&lt;int color=&quot;&quot;&gt; color = {
      50: const Color(0xFF7DEF83),
      100: const Color(0xFF7DEF83),
      200: const Color(0xFF7DEF83),
      300: const Color(0xFF7DEF83),
      400: const Color(0xFF7DEF83),
      500: const Color(0xFF7DEF83),
      600: const Color(0xFF7DEF83),
      700: const Color(0xFF7DEF83),
      800: const Color(0xFF7DEF83),
      900: const Color(0xFF7DEF83),
    };
    return Sizer(
      builder: (context, orientation, deviceType) {
        return GetMaterialApp(
          debugShowCheckedModeBanner: false,
          title: &#39;EV Assert&#39;,
          theme: ThemeData(
            primarySwatch: MaterialColor(0xFFA4573B, color),
            splashColor: AppColors.appColor,
            highlightColor: AppColors.appColor,
          ),
          // home:  OnboardingScreen(),
          builder: (context, child) =&amp;gt; ResponsiveWrapper.builder(
              BouncingScrollWrapper.builder(context, child!),
              maxWidth: 1400,
              minWidth: 450,
              defaultScale: true,
              breakpoints: [
                const ResponsiveBreakpoint.resize(450, name: MOBILE),
                const ResponsiveBreakpoint.autoScale(800, name: TABLET),
                const ResponsiveBreakpoint.autoScale(1000, name: TABLET),
                const ResponsiveBreakpoint.resize(1200, name: DESKTOP),
                const ResponsiveBreakpoint.autoScale(2460, name: &quot;4K&quot;),
              ],
              background: Container(color: const Color(0xFFF5F5F5))),
          // initialBinding: BindingsBuilder(() {
          //   printAction(&quot;Data coming here&quot;);
          // }),
          initialRoute: AppRoutes.otpScreen,
          getPages: AppRoutes.pages,
         );
       },
     );
 
   }
 }&lt;/int&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This complete example demonstrates how to implement a functional and beautiful OTP verification screen in Flutter using GetX. The interface includes features like a countdown timer, OTP input field, and the ability to resend the code if it expires.&lt;/p&gt;&lt;p&gt;By following this guide, you can easily integrate a professional OTP verification system into your Flutter app with a modern and clean UI.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/flutter-otp-verification-with-pin-code.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik4kItGGHNpgoFBUr0OCnTT87Ph2y00CfFyFeLwmZWt-GK1gLnReW6IUhN4ofoVSsjL_4vqsbXwocqmVTzGoX9M2WxpQhk9sHb32xpeFOMOBMzzrWBHsi8WwN5VICj-DBNIq7W4B9kY5M2nYI7tWO3Io5ZeT0CrjSNwgglcl_FptZJFD5wzd5v3YhaqipH/s72-c/RPY%20(2).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7629648561662066482</guid><pubDate>Fri, 18 Oct 2024 05:07:00 +0000</pubDate><atom:updated>2024-10-19T14:27:08.133+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter Google Fonts GetX</category><category domain="http://www.blogger.com/atom/ns#">Google Fonts Flutter example</category><category domain="http://www.blogger.com/atom/ns#">How to Use Cached Network Image in Flutter with GetX</category><category domain="http://www.blogger.com/atom/ns#">How to use Google Fonts in Flutter with GetX</category><title>How to Use Cached Network Image in Flutter with GetX.</title><description>&lt;h3&gt;Using &lt;code&gt;cached_network_image&lt;/code&gt; in Flutter with GetX: Optimize Image Loading with Caching&lt;/h3&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/AVvXsEh2kMI6w0llrTLXUgftIKDnlcY1e4HgImHnI96swDluQcEKDJiVnRzrNRCYnKOtvdVr-D_qXBgUMLXpPgEOlSLVTbHRglYWhtrFFjgb37RomBE6K62zz4fBOwVsFoHZ7QYNyISQu2r6vN1j0bZbSs8iTPQjixvv3czxZIKjYB2qnSPkbOjtsI2xLRIMBvyb/s2560/RPY.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Use Cached Network Image in Flutter with GetX.&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2kMI6w0llrTLXUgftIKDnlcY1e4HgImHnI96swDluQcEKDJiVnRzrNRCYnKOtvdVr-D_qXBgUMLXpPgEOlSLVTbHRglYWhtrFFjgb37RomBE6K62zz4fBOwVsFoHZ7QYNyISQu2r6vN1j0bZbSs8iTPQjixvv3czxZIKjYB2qnSPkbOjtsI2xLRIMBvyb/s16000/RPY.png&quot; title=&quot;How to Use Cached Network Image in Flutter with GetX.&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;cached_network_image&lt;/code&gt; package allows Flutter apps to efficiently load and cache images from the web. In this tutorial, we’ll integrate it with GetX for state management to streamline image loading and cache control.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Ensure that you have Flutter installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX Package&lt;/strong&gt;: We’ll use the &lt;code&gt;get&lt;/code&gt; package for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;cached_network_image Package&lt;/strong&gt;: Add this to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  cached_network_image: ^3.2.1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Creating the Image Controller&lt;/h3&gt;&lt;p&gt;We’ll set up a &lt;code&gt;ImageController&lt;/code&gt; to handle image URL states using GetX.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 class ImageController extends GetxController {
  // This holds the URL of the image
  var imageUrl = &#39;https://via.placeholder.com/150&#39;.obs;

  // Method to change the image URL
  void changeImageUrl(String newUrl) {
    imageUrl.value = newUrl;
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;imageUrl&lt;/strong&gt;: Tracks the image URL as an observable variable.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;changeImageUrl&lt;/strong&gt;: Allows changing the image URL dynamically.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will display the cached image and allow the user to change the image URL using a button or text input.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:cached_network_image/cached_network_image.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;image_controller.dart&#39;;

 class ImageView extends GetView&lt;imagecontroller&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Cached Network Image Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // Image displayed using CachedNetworkImage
            Obx(() {
              return CachedNetworkImage(
                imageUrl: controller.imageUrl.value,
                placeholder: (context, url) =&amp;gt; const CircularProgressIndicator(),
                errorWidget: (context, url, error) =&amp;gt; const Icon(Icons.error),
              );
            }),
            const SizedBox(height: 20),
            // Button to change the image URL
            ElevatedButton(
              onPressed: () {
                // Change to another image URL
                controller.changeImageUrl(&#39;https://via.placeholder.com/300&#39;);
              },
              child: const Text(&#39;Load New Image&#39;),
             ),
           ],
         ),
       ),
     );
   }
 }&lt;/imagecontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Obx&lt;/strong&gt;: Watches the image URL and updates the image whenever it changes.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CachedNetworkImage&lt;/strong&gt;: Displays the image and caches it.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ElevatedButton&lt;/strong&gt;: Allows users to load a new image by changing the URL in the controller.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;The binding class ensures the &lt;code&gt;ImageController&lt;/code&gt; is injected into the view.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
i mport &#39;image_controller.dart&#39;;

class ImageBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;imagecontroller&gt;(() =&amp;gt; ImageController());
   }
 }&lt;/imagecontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Running the App&lt;/h3&gt;&lt;p&gt;Finally, configure the routing and binding in your &lt;code&gt;main.dart&lt;/code&gt;.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;image_view.dart&#39;;
 import &#39;image_binding.dart&#39;;

 void main() {
  runApp(MyApp());
 }

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; ImageView(),
          binding: ImageBinding(),
        ),
      ],
      title: &#39;Cached Network Image Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
       ),
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;In this guide, we’ve demonstrated:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Loading images efficiently&lt;/strong&gt; using &lt;code&gt;cached_network_image&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;State management with GetX&lt;/strong&gt;, allowing the dynamic loading and caching of images.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Using GetX Bindings&lt;/strong&gt; to efficiently manage controller dependencies.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;By following this tutorial, you now have a complete setup for using &lt;code&gt;cached_network_image&lt;/code&gt; with GetX in Flutter. You can further extend this by loading multiple images, managing error states, and customizing the placeholders and error widgets.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-use-cached-network-image-in.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2kMI6w0llrTLXUgftIKDnlcY1e4HgImHnI96swDluQcEKDJiVnRzrNRCYnKOtvdVr-D_qXBgUMLXpPgEOlSLVTbHRglYWhtrFFjgb37RomBE6K62zz4fBOwVsFoHZ7QYNyISQu2r6vN1j0bZbSs8iTPQjixvv3czxZIKjYB2qnSPkbOjtsI2xLRIMBvyb/s72-c/RPY.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5750699173472997670</guid><pubDate>Thu, 17 Oct 2024 13:25:00 +0000</pubDate><atom:updated>2024-10-19T14:49:12.369+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Custom fonts with Google Fonts in Flutter</category><category domain="http://www.blogger.com/atom/ns#">Flutter Google Fonts GetX tutorial</category><category domain="http://www.blogger.com/atom/ns#">google_fonts Flutter</category><category domain="http://www.blogger.com/atom/ns#">How to use Google Fonts in Flutter with GetX</category><title>Flutter Google Fonts Tutorial with GetX | Dynamic Font Selection with Full Code</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;Adding Custom Fonts in Flutter Using &lt;code&gt;google_fonts&lt;/code&gt; and GetX: A Step-by-Step Guide&lt;/h3&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/AVvXsEgBqhnr68SqtY87Qwk9zzafGWSZLmO60_347p_Hq6w2mV5fajlQLuZzAiAQAuRsJwsB-5mBDabFPLWDPsjwbv0aRlJEm6YzeRijEZgaj_B2e_lcaGRMHGCnDRpy7ItPOshoFjkZVu7xL1w1QB1RXx-Mbc_y4rXLXi7pxj3Y7NnBgk0kIRm925ppu6QigjH3/s2560/RPY%20(1).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Google Fonts Tutorial with GetX | Dynamic Font Selection with Full Code&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBqhnr68SqtY87Qwk9zzafGWSZLmO60_347p_Hq6w2mV5fajlQLuZzAiAQAuRsJwsB-5mBDabFPLWDPsjwbv0aRlJEm6YzeRijEZgaj_B2e_lcaGRMHGCnDRpy7ItPOshoFjkZVu7xL1w1QB1RXx-Mbc_y4rXLXi7pxj3Y7NnBgk0kIRm925ppu6QigjH3/s16000/RPY%20(1).png&quot; title=&quot;Flutter Google Fonts Tutorial with GetX&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;google_fonts&lt;/code&gt; package allows you to use a wide variety of fonts from Google Fonts in your Flutter application. In this tutorial, we’ll integrate &lt;code&gt;google_fonts&lt;/code&gt; with GetX for easy state management, creating a responsive and flexible app layout.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Ensure you have Flutter installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX Package&lt;/strong&gt;: We’ll use the &lt;code&gt;get&lt;/code&gt; package for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;google_fonts Package&lt;/strong&gt;: Add this to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  google_fonts: ^3.0.1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Setting up the Controller&lt;/h3&gt;&lt;p&gt;We’ll create a &lt;code&gt;FontController&lt;/code&gt; to manage the font style selections using GetX.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;font_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:google_fonts/google_fonts.dart&#39;;
 import &#39;package:flutter/material.dart&#39;;

 class FontController extends GetxController {
  // Set default font to Roboto
  var currentFont = GoogleFonts.roboto().fontFamily.obs;

  void changeFont(String fontName) {
    currentFont.value = GoogleFonts.getFont(fontName).fontFamily;
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;currentFont&lt;/strong&gt;: Tracks the selected font.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;changeFont&lt;/strong&gt;: Changes the font style based on the provided font name.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will contain a dropdown menu to select a font and apply it to a text widget in real-time.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;font_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;font_controller.dart&#39;;

 class FontView extends GetView&lt;fontcontroller&gt; {
  final List&lt;string&gt; fonts = [&#39;Roboto&#39;, &#39;Lobster&#39;, &#39;Oswald&#39;, &#39;Pacifico&#39;, &#39;Montserrat&#39;];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Google Fonts Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Obx(() {
              return Text(
                &quot;Flutter Google Fonts with GetX&quot;,
                style: TextStyle(fontFamily: controller.currentFont.value, fontSize: 24),
              );
            }),
            const SizedBox(height: 20),
            DropdownButton&lt;string&gt;(
              value: controller.currentFont.value,
              onChanged: (String? newFont) {
                if (newFont != null) {
                  controller.changeFont(newFont);
                }
              },
              items: fonts.map&lt;dropdownmenuitem tring=&quot;&quot;&gt;&amp;gt;((String font) {
                return DropdownMenuItem&lt;string&gt;(
                  value: GoogleFonts.getFont(font).fontFamily,
                  child: Text(font),
                );
              }).toList(),
              hint: const Text(&#39;Select a Font&#39;),
             ),
           ],
         ),
       ),
     );
   }
 }&lt;/string&gt;&lt;/dropdownmenuitem&gt;&lt;/string&gt;&lt;/string&gt;&lt;/fontcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Obx Widget&lt;/strong&gt;: Displays text with the current font selected in &lt;code&gt;currentFont&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DropdownButton&lt;/strong&gt;: Lists font options, allowing users to change the font in real time.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;To inject &lt;code&gt;FontController&lt;/code&gt; into the view, we’ll create a binding.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;font_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;font_controller.dart&#39;;

 class FontBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;fontcontroller&gt;(() =&amp;gt; FontController());
   }
 }&lt;/fontcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This ensures the &lt;code&gt;FontController&lt;/code&gt; is initialized only when needed, optimizing resources.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Running the App&lt;/h3&gt;&lt;p&gt;Finally, update &lt;code&gt;main.dart&lt;/code&gt; to configure the binding and routing.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;font_view.dart&#39;;
 import &#39;font_binding.dart&#39;;

 void main() {
  runApp(MyApp());
 }

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; FontView(),
          binding: FontBinding(),
        ),
      ],
      title: &#39;Google Fonts Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
       ),
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;In this guide, we covered:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Using &lt;code&gt;google_fonts&lt;/code&gt;&lt;/strong&gt; to style text dynamically.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX for state management&lt;/strong&gt; to bind a custom font controller.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Organized MVC structure&lt;/strong&gt; with bindings, ensuring efficient and modular code.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now, you have a complete example of using &lt;code&gt;google_fonts&lt;/code&gt; with GetX in Flutter to change and apply different fonts to text widgets.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/flutter-google-fonts-tutorial-with-getx.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBqhnr68SqtY87Qwk9zzafGWSZLmO60_347p_Hq6w2mV5fajlQLuZzAiAQAuRsJwsB-5mBDabFPLWDPsjwbv0aRlJEm6YzeRijEZgaj_B2e_lcaGRMHGCnDRpy7ItPOshoFjkZVu7xL1w1QB1RXx-Mbc_y4rXLXi7pxj3Y7NnBgk0kIRm925ppu6QigjH3/s72-c/RPY%20(1).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5624523742951378673</guid><pubDate>Thu, 17 Oct 2024 05:09:00 +0000</pubDate><atom:updated>2024-10-17T10:39:12.361+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter camera and gallery image picker tutorial</category><category domain="http://www.blogger.com/atom/ns#">Flutter image picker GetX example</category><category domain="http://www.blogger.com/atom/ns#">How to use image_picker in Flutter with GetX</category><category domain="http://www.blogger.com/atom/ns#">image picker GetX Flutter</category><category domain="http://www.blogger.com/atom/ns#">image picker tutorial Flutter</category><title>How to Use image picker in Flutter with GetX | Capture and Select Images Easily</title><description>&lt;h3&gt;Capture and Select Images in Flutter Using &lt;code&gt;image_picker&lt;/code&gt; with GetX Controller Binding&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;image_picker&lt;/code&gt; package is a great solution for allowing users to capture photos or choose images from their gallery in a Flutter app. In this guide, we’ll use &lt;code&gt;image_picker&lt;/code&gt; in combination with GetX for state management to create an organized and responsive application.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Ensure Flutter is installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX Package&lt;/strong&gt;: Install &lt;code&gt;get&lt;/code&gt; for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;image_picker&lt;/strong&gt;: Add the package to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  image_picker: ^0.8.7+3
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the packages.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Setting up the Controller&lt;/h3&gt;&lt;p&gt;We’ll create an &lt;code&gt;ImagePickerController&lt;/code&gt; to handle picking images from the camera or gallery.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_picker_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:image_picker/image_picker.dart&#39;;
 import &#39;dart:io&#39;;

 class ImagePickerController extends GetxController {
  final ImagePicker _picker = ImagePicker();
  var selectedImage = Rx&lt;file&gt;(null);

  Future&lt;void&gt; pickImageFromGallery() async {
    final pickedFile = await _picker.pickImage(source: ImageSource.gallery);
    if (pickedFile != null) {
      selectedImage.value = File(pickedFile.path);
    }
  }

  Future&lt;void&gt; pickImageFromCamera() async {
    final pickedFile = await _picker.pickImage(source: ImageSource.camera);
    if (pickedFile != null) {
      selectedImage.value = File(pickedFile.path);
    }
  }

  void clearImage() {
    selectedImage.value = null;
   }
 }&lt;/void&gt;&lt;/void&gt;&lt;/file&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;pickImageFromGallery&lt;/strong&gt;: Picks an image from the gallery.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;pickImageFromCamera&lt;/strong&gt;: Captures an image using the camera.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;clearImage&lt;/strong&gt;: Resets the selected image.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will contain buttons to open the gallery or camera and display the selected image.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_picker_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;image_picker_controller.dart&#39;;

 class ImagePickerView extends GetView&lt;imagepickercontroller&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Image Picker Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Obx(() {
              return controller.selectedImage.value == null
                  ? const Text(&quot;No image selected&quot;)
                  : Image.file(controller.selectedImage.value!);
            }),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                controller.pickImageFromGallery();
              },
              child: const Text(&quot;Pick Image from Gallery&quot;),
            ),
            const SizedBox(height: 10),
            ElevatedButton(
              onPressed: () {
                controller.pickImageFromCamera();
              },
              child: const Text(&quot;Take Photo with Camera&quot;),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                controller.clearImage();
              },
              child: const Text(&quot;Clear Image&quot;),
             ),
           ],
         ),
       ),
     );
   }
 }&lt;/imagepickercontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Obx Widget&lt;/strong&gt;: Displays the image if it’s selected; otherwise, shows a default message.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Buttons&lt;/strong&gt;: Allow users to pick an image from the gallery, take a photo, or clear the selected image.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;To inject &lt;code&gt;ImagePickerController&lt;/code&gt; into the view, we’ll create a binding.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;image_picker_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;image_picker_controller.dart&#39;;

 class ImagePickerBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;imagepickercontroller&gt;(() =&amp;gt; ImagePickerController());
   }
 }&lt;/imagepickercontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The binding ensures that &lt;code&gt;ImagePickerController&lt;/code&gt; is initialized only when needed, optimizing resource usage.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Running the App&lt;/h3&gt;&lt;p&gt;Finally, update &lt;code&gt;main.dart&lt;/code&gt; to configure the binding and routing.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;image_picker_view.dart&#39;;
 import &#39;image_picker_binding.dart&#39;;

 void main() {
  runApp(MyApp());
 }

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; ImagePickerView(),
          binding: ImagePickerBinding(),
        ),
      ],
      title: &#39;Image Picker Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
       ),
     );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;In this tutorial, we covered:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Using the &lt;code&gt;image_picker&lt;/code&gt; package&lt;/strong&gt; to select images from the gallery or camera.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX for state management&lt;/strong&gt; with controller binding.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;A complete MVC structure&lt;/strong&gt;, making your Flutter app well-organized and efficient.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now, you have a fully functioning image picker feature in your Flutter app using &lt;code&gt;image_picker&lt;/code&gt; and &lt;code&gt;GetX&lt;/code&gt; for clean and maintainable code.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-use-image-picker-in-flutter-with.html</link><author>noreply@blogger.com (Sunny Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5591493684327636790</guid><pubDate>Tue, 15 Oct 2024 11:36:00 +0000</pubDate><atom:updated>2024-10-15T21:53:38.749+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter GetX url_launcher</category><category domain="http://www.blogger.com/atom/ns#">Flutter url_launcher example with GetX</category><category domain="http://www.blogger.com/atom/ns#">Open website from Flutter app using GetX</category><category domain="http://www.blogger.com/atom/ns#">Using url_launcher with GetX in Flutter</category><title>How to Use url launcher in Flutter with GetX: Complete Guide and Code Example</title><description>&lt;h3&gt;Open URLs in Flutter Using &lt;code&gt;url_launcher&lt;/code&gt; with GetX Controller Binding&lt;/h3&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/AVvXsEgyMmjyyTkbC6aFGRbN1FfKMYo3LNvDQOTmY4u4Z-gdj9teG7MFzrk-2Vm3OYCdwK6vlt7Gq1ClFA14CAnoTHkcPg0Vxb1lffiJ_vwL05fkXOIdpnbqbb_1V-Z_NelijAo3TWql8AD2eoH-8EolQzQYY_NUj7uJpYM7i2rBgzH3ItuLK2dntveGkwD0INUT/s2560/RPY.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyMmjyyTkbC6aFGRbN1FfKMYo3LNvDQOTmY4u4Z-gdj9teG7MFzrk-2Vm3OYCdwK6vlt7Gq1ClFA14CAnoTHkcPg0Vxb1lffiJ_vwL05fkXOIdpnbqbb_1V-Z_NelijAo3TWql8AD2eoH-8EolQzQYY_NUj7uJpYM7i2rBgzH3ItuLK2dntveGkwD0INUT/s16000/RPY.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;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The &lt;code&gt;url_launcher&lt;/code&gt; package is essential for Flutter developers who need to open links, dial phone numbers, send SMS, or compose emails from their apps. This guide will walk you through using &lt;code&gt;url_launcher&lt;/code&gt; with &lt;code&gt;GetX&lt;/code&gt; to create a clean and structured implementation.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Make sure Flutter is installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX Package&lt;/strong&gt;: Install &lt;code&gt;get&lt;/code&gt; for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;url_launcher&lt;/strong&gt;: Add the package to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  url_launcher: ^6.1.10&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the packages.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Setting up the Controller&lt;/h3&gt;&lt;p&gt;We&#39;ll create a &lt;code&gt;UrlController&lt;/code&gt; to handle launching URLs using the &lt;code&gt;url_launcher&lt;/code&gt; package.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;url_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;package:url_launcher/url_launcher.dart&#39;;

class UrlController extends GetxController {
  // Method to open a URL
  Future&lt;void&gt; launchUrl(String url) async {
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw &#39;Could not launch $url&#39;;
    }
  }

  // Method to dial a phone number
  Future&lt;void&gt; dialNumber(String phoneNumber) async {
    final url = &#39;tel:$phoneNumber&#39;;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw &#39;Could not dial $phoneNumber&#39;;
    }
  }

  // Method to send SMS
  Future&lt;void&gt; sendSms(String phoneNumber) async {
    final url = &#39;sms:$phoneNumber&#39;;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw &#39;Could not send SMS to $phoneNumber&#39;;
    }
  }

  // Method to compose email
  Future&lt;void&gt; composeEmail(String email) async {
    final url = &#39;mailto:$email&#39;;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw &#39;Could not compose email to $email&#39;;
     }
   }
 }&lt;/void&gt;&lt;/void&gt;&lt;/void&gt;&lt;/void&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;launchUrl&lt;/strong&gt;: Opens a URL in the default browser.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;dialNumber&lt;/strong&gt;: Dials a phone number using the phone&#39;s dialer.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;sendSms&lt;/strong&gt;: Opens the SMS app with the specified number.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;composeEmail&lt;/strong&gt;: Opens the email client with a recipient pre-filled.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will allow users to input various types of data and trigger different actions by calling the appropriate controller methods.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;url_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;url_controller.dart&#39;;

 class UrlView extends GetView&lt;urlcontroller&gt; {
  final TextEditingController urlController = TextEditingController();
  final TextEditingController phoneController = TextEditingController();
  final TextEditingController emailController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;URL Launcher Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            TextField(
              controller: urlController,
              decoration: InputDecoration(labelText: &#39;Enter URL&#39;),
            ),
            const SizedBox(height: 10),
            ElevatedButton(
              onPressed: () {
                controller.launchUrl(urlController.text);
              },
              child: const Text(&quot;Open URL&quot;),
            ),
            const SizedBox(height: 20),
            TextField(
              controller: phoneController,
              decoration: InputDecoration(labelText: &#39;Enter Phone Number&#39;),
            ),
            const SizedBox(height: 10),
            ElevatedButton(
              onPressed: () {
                controller.dialNumber(phoneController.text);
              },
              child: const Text(&quot;Dial Phone Number&quot;),
            ),
            const SizedBox(height: 20),
            TextField(
              controller: emailController,
              decoration: InputDecoration(labelText: &#39;Enter Email Address&#39;),
            ),
            const SizedBox(height: 10),
            ElevatedButton(
              onPressed: () {
                controller.composeEmail(emailController.text);
              },
              child: const Text(&quot;Compose Email&quot;),
            ),
          ],
        ),
      ),
     );
   }
 }&lt;/urlcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;TextFields&lt;/strong&gt;: Allow users to enter a URL, phone number, or email address.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Buttons&lt;/strong&gt;: Trigger the appropriate action using the &lt;code&gt;UrlController&lt;/code&gt; methods.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;To inject &lt;code&gt;UrlController&lt;/code&gt; into the view, we’ll create a binding.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;url_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;url_controller.dart&#39;;

 class UrlBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;urlcontroller&gt;(() =&amp;gt; UrlController());
   }
 }&lt;/urlcontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This binding ensures the &lt;code&gt;UrlController&lt;/code&gt; is created when needed, keeping the app memory-efficient.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Running the App&lt;/h3&gt;&lt;p&gt;Finally, update &lt;code&gt;main.dart&lt;/code&gt; to configure the binding and routing.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;
 import &#39;package:get/get.dart&#39;;
 import &#39;url_view.dart&#39;;
 import &#39;url_binding.dart&#39;;

 void main() {
  runApp(MyApp());
 }

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; UrlView(),
          binding: UrlBinding(),
        ),
      ],
      title: &#39;URL Launcher Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
   }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;This code demonstrates how to:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open URLs, dial phone numbers, send SMS, and compose emails using &lt;code&gt;url_launcher&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Use &lt;code&gt;GetX&lt;/code&gt; for controller binding, creating a clean and scalable architecture.&lt;/li&gt;&lt;li&gt;Handle various launch actions from a single view with minimal code.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The combination of &lt;code&gt;url_launcher&lt;/code&gt; and &lt;code&gt;GetX&lt;/code&gt; provides a robust and efficient approach to managing URL actions in a Flutter app. Get started today and give your users a more dynamic experience!&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-use-url-launcher-in-flutter-with.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyMmjyyTkbC6aFGRbN1FfKMYo3LNvDQOTmY4u4Z-gdj9teG7MFzrk-2Vm3OYCdwK6vlt7Gq1ClFA14CAnoTHkcPg0Vxb1lffiJ_vwL05fkXOIdpnbqbb_1V-Z_NelijAo3TWql8AD2eoH-8EolQzQYY_NUj7uJpYM7i2rBgzH3ItuLK2dntveGkwD0INUT/s72-c/RPY.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-4001008770300708727</guid><pubDate>Tue, 15 Oct 2024 07:47:00 +0000</pubDate><atom:updated>2024-10-15T22:20:23.556+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter code example shared pref</category><category domain="http://www.blogger.com/atom/ns#">Flutter shared preferences example</category><category domain="http://www.blogger.com/atom/ns#">local storage Flutter GetX</category><category domain="http://www.blogger.com/atom/ns#">save data in Flutter with shared preferences</category><category domain="http://www.blogger.com/atom/ns#">shared pref in Flutter</category><category domain="http://www.blogger.com/atom/ns#">shared preferences with GetX Flutter</category><title>Flutter shared preferences Tutorial: Save and Retrieve Data with GetX (Full Code)</title><description>&lt;h3&gt;How to Use &lt;code&gt;shared_preferences&lt;/code&gt; in Flutter with GetX: Save &amp;amp; Retrieve Data Easily&lt;/h3&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/AVvXsEgLr-bn4jTivoZaUB13HD7XK4i3yxiGF2MWmCujmYWTtUobS3yl5k77ytYL-qcxZIaJf8Zs999wA_9OHWiGTRzlMlpJFIo2e3obzT-6owoPLCvNv05LqKXg8CVokZIk1qDTNTBQG9AY1tV1E7ouk6LJ4ypcXNNt0j6PCbgFPJpqRSEBrbipCkdjv9DI4uhX/s2560/RPY%20(1).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter shared preferences Tutorial&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLr-bn4jTivoZaUB13HD7XK4i3yxiGF2MWmCujmYWTtUobS3yl5k77ytYL-qcxZIaJf8Zs999wA_9OHWiGTRzlMlpJFIo2e3obzT-6owoPLCvNv05LqKXg8CVokZIk1qDTNTBQG9AY1tV1E7ouk6LJ4ypcXNNt0j6PCbgFPJpqRSEBrbipCkdjv9DI4uhX/s16000/RPY%20(1).png&quot; title=&quot;Flutter shared preferences Tutorial in getx&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;shared_preferences&lt;/code&gt; package is a popular choice for Flutter developers to store and retrieve small amounts of data. This guide will show you how to use &lt;code&gt;shared_preferences&lt;/code&gt; with the &lt;code&gt;GetX&lt;/code&gt; package to manage state in a Flutter app, following a complete MVC structure.&lt;/p&gt;&lt;h4&gt;Why Use &lt;code&gt;shared_preferences&lt;/code&gt; in Flutter?&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;shared_preferences&lt;/code&gt; package allows you to:&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Store simple data such as strings, integers, booleans, and lists.&lt;/li&gt;&lt;li&gt;Save data persistently across app launches.&lt;/li&gt;&lt;li&gt;Quickly retrieve values with a straightforward API.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Ensure Flutter is installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GetX&lt;/strong&gt;: Install the &lt;code&gt;get&lt;/code&gt; package for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;shared_preferences&lt;/strong&gt;: Add the package to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  shared_preferences: ^2.0.15
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the dependencies.&lt;/p&gt;&lt;hr /&gt;&lt;h3&gt;Step 1: Setting up the Controller&lt;/h3&gt;&lt;p&gt;We&#39;ll create a &lt;code&gt;PreferencesController&lt;/code&gt; to handle saving and retrieving values from &lt;code&gt;shared_preferences&lt;/code&gt;.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;preferences_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:get/get.dart&#39;;
import &#39;package:shared_preferences/shared_preferences.dart&#39;;

class PreferencesController extends GetxController {
  // Observables
  var username = &#39;&#39;.obs;
  var isLoggedIn = false.obs;

  // Method to save username
  Future&lt;void&gt; saveUsername(String name) async {
    final prefs = await SharedPreferences.getInstance();
    await prefs.setString(&#39;username&#39;, name);
    username.value = name;
  }

  // Method to get username
  Future&lt;void&gt; getUsername() async {
    final prefs = await SharedPreferences.getInstance();
    username.value = prefs.getString(&#39;username&#39;) ?? &#39;&#39;;
  }

  // Method to save login status
  Future&lt;void&gt; saveLoginStatus(bool status) async {
    final prefs = await SharedPreferences.getInstance();
    await prefs.setBool(&#39;isLoggedIn&#39;, status);
    isLoggedIn.value = status;
  }

  // Method to get login status
  Future&lt;void&gt; getLoginStatus() async {
    final prefs = await SharedPreferences.getInstance();
    isLoggedIn.value = prefs.getBool(&#39;isLoggedIn&#39;) ?? false;
  }

  @override
  void onInit() {
    super.onInit();
    getUsername();
    getLoginStatus();
   }
 }&lt;/void&gt;&lt;/void&gt;&lt;/void&gt;&lt;/void&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Observables&lt;/strong&gt;: &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;isLoggedIn&lt;/code&gt; are observable variables.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Save &amp;amp; Retrieve Methods&lt;/strong&gt;: Methods for saving and retrieving values in &lt;code&gt;shared_preferences&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;onInit&lt;/strong&gt;: Initializes data retrieval when the controller is loaded.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will interact with the controller to display and update saved preferences. We’ll use &lt;code&gt;GetView&amp;lt;PreferencesController&amp;gt;&lt;/code&gt; for a clean setup.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;preferences_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre class=&quot;!overflow-visible&quot;&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative&quot;&gt;&lt;div class=&quot;flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:get/get.dart&#39;;
import &#39;preferences_controller.dart&#39;;

class PreferencesView extends GetView&lt;preferencescontroller&gt; {
  final TextEditingController nameController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Shared Preferences Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Obx(() =&amp;gt; Text(
                  &#39;Welcome, ${controller.username.value}&#39;,
                  style: const TextStyle(fontSize: 20),
                )),
            TextField(
              controller: nameController,
              decoration: InputDecoration(labelText: &#39;Enter Username&#39;),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                controller.saveUsername(nameController.text);
              },
              child: const Text(&quot;Save Username&quot;),
            ),
            const SizedBox(height: 20),
            Obx(() =&amp;gt; SwitchListTile(
                  title: const Text(&#39;Logged In&#39;),
                  value: controller.isLoggedIn.value,
                  onChanged: (value) {
                    controller.saveLoginStatus(value);
                  },
                )),
           ],
         ),
       ),
     );
   }
 }&lt;/preferencescontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this view:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Obx Widgets&lt;/strong&gt;: Reactive widgets to display the &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;isLoggedIn&lt;/code&gt; states.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;TextField&lt;/strong&gt;: Allows input for the username.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Button&lt;/strong&gt;: Saves the entered username.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SwitchListTile&lt;/strong&gt;: Toggles the login status and saves it.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Step 3: Setting up the Binding&lt;/h3&gt;&lt;p&gt;To inject &lt;code&gt;PreferencesController&lt;/code&gt; into the view, we’ll create a binding.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;preferences_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;preferences_controller.dart&#39;;

 class PreferencesBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;preferencescontroller&gt;(() =&amp;gt; PreferencesController());
  }
 }&lt;/preferencescontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;h3&gt;Step 4: Running the App&lt;/h3&gt;&lt;p&gt;Finally, update &lt;code&gt;main.dart&lt;/code&gt; to use the binding and route configuration.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:get/get.dart&#39;;
import &#39;preferences_view.dart&#39;;
import &#39;preferences_binding.dart&#39;;

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; PreferencesView(),
          binding: PreferencesBinding(),
        ),
      ],
      title: &#39;Shared Preferences Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
  }
 }&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;With the above code:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;You’ve set up a &lt;code&gt;PreferencesController&lt;/code&gt; to handle saving and retrieving data.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;PreferencesView&lt;/code&gt; allows user interaction and updates the UI based on stored values.&lt;/li&gt;&lt;li&gt;Using &lt;code&gt;GetX&lt;/code&gt; binding ensures a clean architecture and efficient state management.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The &lt;code&gt;shared_preferences&lt;/code&gt; package makes it easy to store simple data types persistently, enhancing the user experience with features like saved usernames and login status. Get started today and take advantage of this powerful combination of &lt;code&gt;shared_preferences&lt;/code&gt; and &lt;code&gt;GetX&lt;/code&gt; in your Flutter apps!&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/flutter-sharedpreferences-tutorial-save.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLr-bn4jTivoZaUB13HD7XK4i3yxiGF2MWmCujmYWTtUobS3yl5k77ytYL-qcxZIaJf8Zs999wA_9OHWiGTRzlMlpJFIo2e3obzT-6owoPLCvNv05LqKXg8CVokZIk1qDTNTBQG9AY1tV1E7ouk6LJ4ypcXNNt0j6PCbgFPJpqRSEBrbipCkdjv9DI4uhX/s72-c/RPY%20(1).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-2896286876403091903</guid><pubDate>Tue, 15 Oct 2024 07:00:00 +0000</pubDate><atom:updated>2024-10-15T22:54:48.815+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">GetX state management</category><category domain="http://www.blogger.com/atom/ns#">How to share content in Flutter using share_plus</category><category domain="http://www.blogger.com/atom/ns#">How to use share_plus</category><category domain="http://www.blogger.com/atom/ns#">Implementing content sharing in Flutter with share_plus and GetX</category><category domain="http://www.blogger.com/atom/ns#">share_plus package Flutter</category><title>How to Use the share plus Package in Flutter with GetX for Easy Content Sharing.</title><description>&lt;h3&gt;How to Use &lt;code&gt;share_plus&lt;/code&gt; in Flutter for Easy Content Sharing (Version 10.0.3)&lt;/h3&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/AVvXsEgj99f4Azn15rdco5BAwZ8rfRV9qYOYueNtmoEWnzCk7j1oDIznqpTbABAddheaL0cv7wIVWs9a7rlZpjoW4xcGO3MPjT-tHjOTXEWJz46NgpqPgn9QfOQMpkwHaTChkGfAMrt6EQBNWVPr42uy9DD1rqp1_9U7xXxSI-Mna_DAjT6fb27OYjpMElb2hPnc/s2560/RPY%20(2).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to Use the share plus Package in Flutter with GetX&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj99f4Azn15rdco5BAwZ8rfRV9qYOYueNtmoEWnzCk7j1oDIznqpTbABAddheaL0cv7wIVWs9a7rlZpjoW4xcGO3MPjT-tHjOTXEWJz46NgpqPgn9QfOQMpkwHaTChkGfAMrt6EQBNWVPr42uy9DD1rqp1_9U7xXxSI-Mna_DAjT6fb27OYjpMElb2hPnc/s16000/RPY%20(2).png&quot; title=&quot;share plus Package in Flutter with GetX&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Are you looking to add a share feature to your Flutter app? The &lt;code&gt;share_plus&lt;/code&gt; package offers a seamless way to share text, files, and more across various platforms. This tutorial will show you how to integrate &lt;code&gt;share_plus&lt;/code&gt; version 10.0.3 with &lt;code&gt;GetX&lt;/code&gt; for clean state management and a full MVC structure, ensuring optimized performance.&lt;/div&gt;&lt;h4&gt;Key Benefits of Using &lt;code&gt;share_plus&lt;/code&gt; in Flutter&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;share_plus&lt;/code&gt; package is one of the best options for content sharing in Flutter. Here are a few reasons why:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Cross-Platform Compatibility&lt;/strong&gt;: Works on Android, iOS, Web, macOS, Windows, and Linux.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Simple API&lt;/strong&gt;: Just a few lines of code to share content across different platforms.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Open Source&lt;/strong&gt;: It’s free and open-source, maintained by the Flutter community.&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Ensure you have Flutter installed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Add GetX&lt;/strong&gt;: Install the &lt;code&gt;get&lt;/code&gt; package for state management.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Install &lt;code&gt;share_plus&lt;/code&gt;&lt;/strong&gt;: Add the package to your &lt;code&gt;pubspec.yaml&lt;/code&gt; file.&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;code&gt; dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  share_plus: ^10.0.3&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the dependencies.&lt;/p&gt;&lt;h3&gt;Step 1: Setting up the Controller&lt;/h3&gt;&lt;p&gt;The controller will handle the logic for sharing content. In this example, we’ll create a &lt;code&gt;ShareController&lt;/code&gt; using GetX.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;share_controller.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:get/get.dart&#39;;
import &#39;package:share_plus/share_plus.dart&#39;;

 class ShareController extends GetxController {
  // Function to share text content
  void shareText(String text) {
    Share.share(text);
  }

  // Function to share content with subject
  void shareWithSubject(String text, String subject) {
    Share.share(text, subject: subject);
  }

  // Function to share files
  void shareFile(String filePath, {String? text}) {
    Share.shareFiles([filePath], text: text);
  }
 }&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this controller:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;shareText&lt;/code&gt;: This method is for sharing plain text.&lt;/li&gt;&lt;li&gt;&lt;code&gt;shareWithSubject&lt;/code&gt;: This method adds a subject to the text.&lt;/li&gt;&lt;li&gt;&lt;code&gt;shareFile&lt;/code&gt;: This method allows sharing a file with optional text.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 2: Setting up the View&lt;/h3&gt;&lt;p&gt;The view will contain a simple UI to demonstrate sharing options. We will use a &lt;code&gt;GetView&amp;lt;ShareController&amp;gt;&lt;/code&gt; for dependency injection.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;share_view.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:get/get.dart&#39;;
import &#39;share_controller.dart&#39;;

class ShareView extends GetView&lt;sharecontroller&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(&#39;Share Plus Example&#39;),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          children: [
            TextField(
              controller: TextEditingController(),
              decoration: InputDecoration(labelText: &#39;Text to Share&#39;),
              onChanged: (value) =&amp;gt; controller.shareText(value),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () =&amp;gt; controller.shareText(&quot;Hello from Flutter!&quot;),
              child: const Text(&quot;Share Text&quot;),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () =&amp;gt; controller.shareWithSubject(
                &quot;Hello from Flutter!&quot;,
                &quot;Greetings&quot;,
              ),
              child: const Text(&quot;Share with Subject&quot;),
            ),
          ],
        ),
      ),
    );
  }
 }&lt;/sharecontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this UI:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The text field accepts user input to share as text.&lt;/li&gt;&lt;li&gt;Buttons trigger the share functions using &lt;code&gt;GetX&lt;/code&gt; binding.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 3: Binding the Controller&lt;/h3&gt;&lt;p&gt;Next, bind the &lt;code&gt;ShareController&lt;/code&gt; to the view using a custom binding.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;share_binding.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:get/get.dart&#39;;
 import &#39;share_controller.dart&#39;;

 class ShareBinding extends Bindings {
  @override
  void dependencies() {
    Get.lazyPut&lt;sharecontroller&gt;(() =&amp;gt; ShareController());
  }
 }&lt;/sharecontroller&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 4: Configuring Routes and Running the App&lt;/h3&gt;&lt;p&gt;Update your &lt;code&gt;main.dart&lt;/code&gt; to use &lt;code&gt;ShareBinding&lt;/code&gt; when navigating to &lt;code&gt;ShareView&lt;/code&gt;.&lt;/p&gt;&lt;h4&gt;&lt;code&gt;main.dart&lt;/code&gt;&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:get/get.dart&#39;;
import &#39;share_view.dart&#39;;
import &#39;share_binding.dart&#39;;

void main() {
  runApp(MyApp());
}

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      initialRoute: &#39;/&#39;,
      getPages: [
        GetPage(
          name: &#39;/&#39;,
          page: () =&amp;gt; ShareView(),
          binding: ShareBinding(),
        ),
      ],
      title: &#39;Share Plus Example&#39;,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
  }
 }
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Wrapping Up&lt;/h3&gt;&lt;p&gt;With the above code:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;You’ve set up a &lt;code&gt;ShareController&lt;/code&gt; for handling sharing operations.&lt;/li&gt;&lt;li&gt;You created a UI in &lt;code&gt;ShareView&lt;/code&gt; to interact with the sharing functionality.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;GetX&lt;/code&gt; bindings make sure everything is injected correctly.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The &lt;code&gt;share_plus&lt;/code&gt; package, combined with the &lt;code&gt;GetX&lt;/code&gt; architecture, allows you to easily implement content sharing across your Flutter app. Happy coding, and share your awesome content with ease!&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2024/10/how-to-use-shareplus-package-in-flutter.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj99f4Azn15rdco5BAwZ8rfRV9qYOYueNtmoEWnzCk7j1oDIznqpTbABAddheaL0cv7wIVWs9a7rlZpjoW4xcGO3MPjT-tHjOTXEWJz46NgpqPgn9QfOQMpkwHaTChkGfAMrt6EQBNWVPr42uy9DD1rqp1_9U7xXxSI-Mna_DAjT6fb27OYjpMElb2hPnc/s72-c/RPY%20(2).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7625933557021806879</guid><pubDate>Tue, 15 Oct 2024 06:25:00 +0000</pubDate><atom:updated>2025-11-26T16:54:21.959+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dart 3.5 updates</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.24</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.24 DevTools enhancements</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.24 features</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.24 new widgets</category><category domain="http://www.blogger.com/atom/ns#">Flutter 3.24 release</category><title>What’s New in Flutter 3.24: Complete Guide to the Latest Features and Updates</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/AVvXsEhMsNhoTUZC91mntrvv4AjGI2hwJDOHJlvgD-G0WdIIFX5beSCUbaAO89CBc9Hclj9WNDc4DTKG8QVE6Vs70fg0Km8uHQmOpbuYnsu-jFF7XFgZiw_OLYEcMppF9nRV7Ik9qAIrr3pGIS0xdJC98XR9M2W4Rbod8P7xYbxHbPbohmw6xHfCFBYm-2s5deHQ/s1664/1764156202.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;928&quot; data-original-width=&quot;1664&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMsNhoTUZC91mntrvv4AjGI2hwJDOHJlvgD-G0WdIIFX5beSCUbaAO89CBc9Hclj9WNDc4DTKG8QVE6Vs70fg0Km8uHQmOpbuYnsu-jFF7XFgZiw_OLYEcMppF9nRV7Ik9qAIrr3pGIS0xdJC98XR9M2W4Rbod8P7xYbxHbPbohmw6xHfCFBYm-2s5deHQ/w640-h356/1764156202.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Flutter 3.24 introduces a suite of features and improvements designed to enhance both performance and developer experience. Here’s a comprehensive overview of the major updates, along with examples and SEO-focused insights to help rank your post on Google.&lt;/p&gt;&lt;h3&gt;1. &lt;strong&gt;Dart 3.5 and Language Enhancements&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Flutter 3.24 works with Dart 3.5, which includes new language features like pattern matching and record types. These features simplify coding by enabling more expressive and concise code, which makes the development process smoother and helps reduce potential bugs.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. &lt;strong&gt;Graphics and Image Rendering Improvements&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;The &lt;strong&gt;Impeller Graphics Engine&lt;/strong&gt; in Flutter 3.24 has received performance and visual upgrades, addressing issues related to text rendering. It improves text weight, spacing, and kerning, matching the previous legacy renderer quality.&lt;/li&gt;&lt;li&gt;Image rendering has also been optimized by changing the default &lt;code&gt;FilterQuality&lt;/code&gt; to &lt;code&gt;Medium&lt;/code&gt;, which makes images sharper, especially when downscaled, and enhances visual consistency without sacrificing performance​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://dev.to/blup_tool/whats-new-in-flutter-324-features-enhancements-and-more-ng7&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;DEV Community&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://blog.200oksolutions.com/whats-new-flutter-3-24-overview/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;200OK Solutions&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. &lt;strong&gt;Expanded Widget Functionality&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Enhanced SelectionArea Widget&lt;/strong&gt;: This widget now supports triple-clicks to select entire paragraphs and has improved drag-to-select functionality, making it particularly useful for applications requiring text editing​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://blog.200oksolutions.com/whats-new-flutter-3-24-overview/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;200OK Solutions&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;New Sliver Components&lt;/strong&gt;: Flutter 3.24 introduces dynamic Sliver components, including the &lt;code&gt;PinnedHeaderSliver&lt;/code&gt; and &lt;code&gt;SliverResizingHeader&lt;/code&gt;, enabling app bars to float or resize based on the scroll position. These components enhance the flexibility of app layouts​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://evincedev.com/blog/whats-new-in-flutter-3-24-latest-update-detailed-guide/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;EvinceDev&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CarouselView and TreeView Widgets&lt;/strong&gt;: The CarouselView widget provides a Material Design-inspired scrolling carousel, while the TreeView widget enables developers to create multi-directional tree structures for hierarchical data representation​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://blog.200oksolutions.com/whats-new-flutter-3-24-overview/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;200OK Solutions&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://evincedev.com/blog/whats-new-in-flutter-3-24-latest-update-detailed-guide/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;EvinceDev&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. &lt;strong&gt;DevTools Enhancements for Better Debugging&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Advanced DevTools&lt;/strong&gt;: With this update, Flutter’s DevTools offers advanced debugging and profiling tools, including deeper insights into memory usage and frame rendering times. These tools are instrumental for identifying performance bottlenecks and optimizing the app’s overall performance, crucial for building high-performance applications across multiple platforms​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://evincedev.com/blog/whats-new-in-flutter-3-24-latest-update-detailed-guide/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;EvinceDev&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;5. &lt;strong&gt;Shared Preferences Plugin Upgrades&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;New Shared Preferences features include &lt;code&gt;SharedPreferencesAsync&lt;/code&gt; for running preference operations on background threads, reducing UI latency, and &lt;code&gt;SharedPreferencesWithCache&lt;/code&gt; for minimizing disk access, which speeds up read operations. This is especially beneficial for apps that frequently read from but infrequently write to preferences​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://blog.200oksolutions.com/whats-new-flutter-3-24-overview/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;200OK Solutions&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://evincedev.com/blog/whats-new-in-flutter-3-24-latest-update-detailed-guide/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;EvinceDev&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;6. &lt;strong&gt;Cupertino Library and iOS-like Enhancements&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;The Cupertino library now offers updated haptic feedback for &lt;code&gt;CupertinoActionSheet&lt;/code&gt; buttons, matching iOS button styles, and customizable colors for disabled &lt;code&gt;CupertinoTextField&lt;/code&gt;. These updates bring Flutter’s iOS-like components closer to native functionality and aesthetics​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://blog.200oksolutions.com/whats-new-flutter-3-24-overview/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;200OK Solutions&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://evincedev.com/blog/whats-new-in-flutter-3-24-latest-update-detailed-guide/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;EvinceDev&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;7. &lt;strong&gt;Monetization with Video Ads&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Flutter 3.24 also brings improved monetization opportunities with support for video ads, which allows developers to integrate in-app video ads seamlessly, enhancing the potential revenue streams for apps​&lt;span data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative inline-flex items-center&quot;&gt;&lt;a class=&quot;flex h-6 items-center rounded-xl px-2 text-[0.5em] !font-medium uppercase bg-[#f4f4f4] !text-token-text-secondary hover:bg-token-text-primary hover:!text-token-main-surface-secondary dark:bg-token-main-surface-secondary dark:hover:bg-token-text-primary relative top-[-0.1875rem]&quot; href=&quot;https://dev.to/blup_tool/whats-new-in-flutter-324-features-enhancements-and-more-ng7&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;truncate&quot;&gt;DEV Community&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Sample Code for New Slivers&lt;/h3&gt;&lt;p&gt;Here’s a quick code snippet for implementing the &lt;code&gt;PinnedHeaderSliver&lt;/code&gt; in your app to make the header stick to the top as users scroll:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class=&quot;!overflow-visible&quot;&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative&quot;&gt;&lt;div class=&quot;flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt; import &#39;package:flutter/material.dart&#39;;

 class PinnedHeaderExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
      slivers: &lt;widget&gt;[
        SliverPersistentHeader(
          pinned: true,
          delegate: _PinnedHeaderDelegate(),
        ),
        SliverList(
          delegate: SliverChildBuilderDelegate(
            (context, index) =&amp;gt; ListTile(
              title: Text(&#39;Item #$index&#39;),
            ),
            childCount: 50,
          ),
        ),
      ],
    );
  }
 }

 class _PinnedHeaderDelegate extends SliverPersistentHeaderDelegate {
  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return Container(
      color: Colors.blue,
      child: Center(
        child: Text(
          &#39;Pinned Header&#39;,
          style: TextStyle(color: Colors.white),
        ),
      ),
    );
  }

  @override
  double get maxExtent =&amp;gt; 60.0;
  @override
  double get minExtent =&amp;gt; 60.0;
  @override
  bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) =&amp;gt; false;
 }
&lt;/widget&gt;&lt;/code&gt;&lt;/pre&gt;Flutter 3.24’s updates highlight the framework’s continued evolution, delivering robust new features that streamline development and provide advanced tools for building high-quality, visually engaging cross-platform apps.
</description><link>https://codeswithsunny.blogspot.com/2024/10/whats-new-in-flutter-324-complete-guide.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMsNhoTUZC91mntrvv4AjGI2hwJDOHJlvgD-G0WdIIFX5beSCUbaAO89CBc9Hclj9WNDc4DTKG8QVE6Vs70fg0Km8uHQmOpbuYnsu-jFF7XFgZiw_OLYEcMppF9nRV7Ik9qAIrr3pGIS0xdJC98XR9M2W4Rbod8P7xYbxHbPbohmw6xHfCFBYm-2s5deHQ/s72-w640-h356-c/1764156202.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-4850360503224539699</guid><pubDate>Tue, 28 Mar 2023 17:01:00 +0000</pubDate><atom:updated>2024-10-15T10:40:15.607+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dropdown in Flutter Example Code</category><category domain="http://www.blogger.com/atom/ns#">How to Create a Dropdown in Flutter</category><category domain="http://www.blogger.com/atom/ns#">What is Dropdown</category><title>How to Create a Dropdown in Flutter: Example Code with Step-by-Step Guide</title><description>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;h2&gt;How to Create a Dropdown in Flutter&lt;/h2&gt;&lt;p&gt;A dropdown widget is a common UI element in Flutter used to display a list of options that a user can select. Typically used in forms, settings, and other input screens, the dropdown widget allows users to choose one option from a list. In Flutter, you can easily create a dropdown using the &lt;code&gt;DropdownButton&lt;/code&gt; widget.&lt;/p&gt;&lt;h3&gt;What is a Dropdown in Flutter?&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;DropdownButton&lt;/code&gt; widget in Flutter displays a button that, when pressed, reveals a list of items for the user to choose from. You can customize the dropdown’s appearance using properties like &lt;code&gt;icon&lt;/code&gt;, &lt;code&gt;iconSize&lt;/code&gt;, &lt;code&gt;style&lt;/code&gt;, and &lt;code&gt;isExpanded&lt;/code&gt;. This flexibility makes it ideal for creating user-friendly forms and settings screens.&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;div&gt;&lt;h3 style=&quot;font-family: monospace; white-space: pre;&quot;&gt;Code Example: Creating a Dropdown in Flutter&lt;/h3&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;

&lt;pre&gt;&lt;code&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;pre class=&quot;!overflow-visible&quot;&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative&quot;&gt;&lt;div class=&quot;flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt; &lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:flutter/material.dart&#39;;

 void main() {
   runApp(MyApp());
 }

class MyApp extends StatelessWidget {
  final List&lt;string&gt; items = [&#39;Item 1&#39;, &#39;Item 2&#39;, &#39;Item 3&#39;, &#39;Item 4&#39;];
  String dropdownValue = &#39;Item 1&#39;;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: &#39;Flutter Demo&#39;,
      home: Scaffold(
        appBar: AppBar(
          title: Text(&#39;Dropdown List Example&#39;),
        ),
        body: Center(
          child: DropdownButton&lt;string&gt;(
            value: dropdownValue,
            onChanged: (newValue) {
              // setState(() {
              //   dropdownValue = newValue;
              // });
              dropdownValue = newValue!;
              print(dropdownValue);
            },
            items: items.map&lt;dropdownmenuitem tring=&quot;&quot;&gt;&amp;gt;((String value) {
              return DropdownMenuItem&lt;string&gt;(
                value: value,
                child: Text(value),
              );
            }).toList(),
          ),
        ),
      ),
    );
  }
} &lt;/string&gt;&lt;/dropdownmenuitem&gt;&lt;/string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Explanation of the Code&lt;/h3&gt;&lt;p&gt;In the code above, we are creating a simple Flutter app that displays a dropdown button. Here’s a step-by-step breakdown of how it works:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initialize the List of Items&lt;/strong&gt;: We start by defining a list of &lt;code&gt;String&lt;/code&gt; items (&lt;code&gt;items&lt;/code&gt;), which represent the dropdown options. The &lt;code&gt;dropdownValue&lt;/code&gt; variable is initialized with a default selection.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create the DropdownButton Widget&lt;/strong&gt;: The &lt;code&gt;DropdownButton&lt;/code&gt; widget is used to display the dropdown. The &lt;code&gt;value&lt;/code&gt; parameter is assigned to &lt;code&gt;dropdownValue&lt;/code&gt;, and the &lt;code&gt;onChanged&lt;/code&gt; callback updates the &lt;code&gt;dropdownValue&lt;/code&gt; whenever the user selects a new option. This ensures that the dropdown reflects the user’s current selection.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mapping the Items List&lt;/strong&gt;: The &lt;code&gt;items&lt;/code&gt; property requires a list of &lt;code&gt;DropdownMenuItem&lt;/code&gt; widgets. We map each string in the &lt;code&gt;items&lt;/code&gt; list to a &lt;code&gt;DropdownMenuItem&lt;/code&gt;, passing &lt;code&gt;value&lt;/code&gt; to each one. This allows Flutter to generate a list of dropdown options.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customization&lt;/strong&gt;: You can further customize the dropdown by adding properties like &lt;code&gt;icon&lt;/code&gt; to change the dropdown icon, &lt;code&gt;iconSize&lt;/code&gt; to adjust the icon size, and &lt;code&gt;isExpanded&lt;/code&gt; to control whether the dropdown takes the full width of its container.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Benefits of Using Dropdown in Flutter&lt;/h3&gt;&lt;p&gt;Using dropdown widgets enhances the usability of your app by making forms and settings screens more interactive and user-friendly. The &lt;code&gt;DropdownButton&lt;/code&gt; widget in Flutter is highly customizable and easy to implement, making it an essential tool for creating intuitive app interfaces.&lt;/p&gt;&lt;p&gt;By following this guide, you can quickly add a functional dropdown to your Flutter app, providing a clean and professional look while keeping your UI responsive and interactive.&lt;/p&gt;</description><link>https://codeswithsunny.blogspot.com/2023/03/dropdown-in-flutter-example-code.html</link><author>noreply@blogger.com (Sunny Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5908630989808172402</guid><pubDate>Thu, 09 Feb 2023 17:46:00 +0000</pubDate><atom:updated>2024-10-15T11:37:07.631+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">CRUD App in Flutter</category><category domain="http://www.blogger.com/atom/ns#">Flutter CRUD Example</category><category domain="http://www.blogger.com/atom/ns#">Flutter CRUD Operations</category><category domain="http://www.blogger.com/atom/ns#">Flutter Database Example</category><category domain="http://www.blogger.com/atom/ns#">Flutter SQLite Database Tutorial</category><category domain="http://www.blogger.com/atom/ns#">How to Build CRUD in Flutter</category><category domain="http://www.blogger.com/atom/ns#">SQLite CRUD in Flutter</category><category domain="http://www.blogger.com/atom/ns#">SQLite CRUD Operations.</category><title>Complete Flutter CRUD Operations Example: Build a Functional App with SQLite Database</title><description>&lt;h2&gt;Flutter CRUD Operations Example: A Step-by-Step Guide with SQLite&lt;/h2&gt;&lt;p&gt;CRUD operations—Create, Read, Update, and Delete—are essential for managing data in any application. In this guide, we’ll cover how to implement CRUD operations in Flutter using Dart and an SQLite database. This approach is ideal for apps that need offline data storage and basic database functionalities.&lt;/p&gt;&lt;h3&gt;Step 1: Set Up Your Flutter Project and SQLite Database&lt;/h3&gt;&lt;p&gt;To get started, follow these steps:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Create a New Flutter Project&lt;/strong&gt;: Open your terminal or command prompt, navigate to your preferred directory, and run:&lt;/li&gt;&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt; flutter create flutter_crud_example
 cd flutter_crud_example
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;Add Dependencies&lt;/strong&gt;: Open the &lt;code&gt;pubspec.yaml&lt;/code&gt; file and add &lt;code&gt;sqflite&lt;/code&gt; and &lt;code&gt;path&lt;/code&gt; dependencies. These packages help you work with SQLite databases in Flutter:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt; dependencies:
  sqflite: ^2.0.0+4
  path: ^1.8.0
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 2: Define the Database Schema&lt;/h3&gt;&lt;p&gt;Let’s create a simple database schema. For this example, we’ll create a &lt;code&gt;Todo&lt;/code&gt; model with properties like &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, and &lt;code&gt;description&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; class Todo {
  final int? id;
  final String title;
  final String description;

  Todo({this.id, required this.title, required this.description});

  // Convert a Todo into a Map
  Map&lt;string dynamic=&quot;&quot;&gt; toMap() {
    return {
      &#39;id&#39;: id,
      &#39;title&#39;: title,
      &#39;description&#39;: description,
    };
  }

  // Convert a Map into a Todo
  factory Todo.fromMap(Map&lt;string dynamic=&quot;&quot;&gt; map) {
    return Todo(
      id: map[&#39;id&#39;],
      title: map[&#39;title&#39;],
      description: map[&#39;description&#39;],
    );
  }
 }&lt;/string&gt;&lt;/string&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 3: Initialize the Database&lt;/h3&gt;&lt;p&gt;Create a new file &lt;code&gt;db_helper.dart&lt;/code&gt; to manage database operations. We’ll set up the database and define the CRUD functions here.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;import &#39;package:path/path.dart&#39;;
import &#39;package:sqflite/sqflite.dart&#39;;
import &#39;todo.dart&#39;;

 class DatabaseHelper {
  static final DatabaseHelper instance = DatabaseHelper._init();
  static Database? _database;

  DatabaseHelper._init();

  Future&lt;database&gt; get database async {
    if (_database != null) return _database!;
    _database = await _initDB(&#39;todo.db&#39;);
    return _database!;
  }

  Future&lt;database&gt; _initDB(String filePath) async {
    final dbPath = await getDatabasesPath();
    final path = join(dbPath, filePath);

    return await openDatabase(path, version: 1, onCreate: _createDB);
  }

  Future _createDB(Database db, int version) async {
    const idType = &#39;INTEGER PRIMARY KEY AUTOINCREMENT&#39;;
    const textType = &#39;TEXT NOT NULL&#39;;

    await db.execute(&#39;&#39;&#39;
 CREATE TABLE Todo ( 
  id $idType, 
  title $textType,
  description $textType
  )
 &#39;&#39;&#39;);
  }
 }
&lt;/database&gt;&lt;/database&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 4: Implement CRUD Operations&lt;/h3&gt;&lt;h4&gt;1. &lt;strong&gt;Create Operation&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;addTodo&lt;/code&gt; function inserts a new record into the &lt;code&gt;Todo&lt;/code&gt; table.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; Future&lt;int&gt; addTodo(Todo todo) async {
  final db = await instance.database;
  return await db.insert(&#39;Todo&#39;, todo.toMap());
 }&lt;/int&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;2. &lt;strong&gt;Read Operation&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;getTodos&lt;/code&gt; function fetches all records from the &lt;code&gt;Todo&lt;/code&gt; table.&lt;/p&gt;&lt;pre class=&quot;!overflow-visible&quot;&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative&quot;&gt;&lt;div class=&quot;flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt; Future&lt;list odo=&quot;&quot;&gt;&amp;gt; getTodos() async {
  final db = await instance.database;
  final result = await db.query(&#39;Todo&#39;);
  return result.map((json) =&amp;gt; Todo.fromMap(json)).toList();
 }&lt;/list&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;3. &lt;strong&gt;Update Operation&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;updateTodo&lt;/code&gt; function modifies an existing record based on the &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt; Future&lt;int&gt; updateTodo(Todo todo) async {
  final db = await instance.database;
  return await db.update(
    &#39;Todo&#39;,
    todo.toMap(),
    where: &#39;id = ?&#39;,
    whereArgs: [todo.id],
  );
 }&lt;/int&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;4. &lt;strong&gt;Delete Operation&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;deleteTodo&lt;/code&gt; function removes a record from the &lt;code&gt;Todo&lt;/code&gt; table.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;   Future&lt;int&gt; deleteTodo(int id) async {
  final db = await instance.database;
  return await db.delete(
    &#39;Todo&#39;,
    where: &#39;id = ?&#39;,
    whereArgs: [id],
  );
 }&lt;/int&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 5: Connect the Database to the UI&lt;/h3&gt;&lt;p&gt;Now that you have the CRUD operations in place, it’s time to integrate them into your Flutter UI. For simplicity, here’s how you could use a button to add a new todo:&lt;/p&gt;&lt;pre&gt;&lt;code&gt; ElevatedButton(
  onPressed: () async {
    final todo = Todo(
      title: &#39;Sample Task&#39;,
      description: &#39;Description of the sample task&#39;,
    );
    await DatabaseHelper.instance.addTodo(todo);
    print(&#39;New task added!&#39;);
  },
  child: Text(&#39;Add Todo&#39;),
 )
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Step 6: Test Your CRUD Operations&lt;/h3&gt;&lt;p&gt;Testing is crucial to make sure everything works as expected:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt;: Add a new record and confirm it’s added to the database.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Read&lt;/strong&gt;: Fetch all records and display them in a list.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Update&lt;/strong&gt;: Modify an existing record and verify the change.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Delete&lt;/strong&gt;: Delete a record and ensure it’s removed from the database.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Additional Tips&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;: Implement error handling with &lt;code&gt;try-catch&lt;/code&gt; blocks to manage exceptions like database connection failures or invalid queries.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Use Stateful Widgets&lt;/strong&gt;: For dynamic updates in the UI, such as updating the list of todos after adding or deleting, use &lt;code&gt;StatefulWidget&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Explore State Management&lt;/strong&gt;: Use &lt;code&gt;Provider&lt;/code&gt;, &lt;code&gt;GetX&lt;/code&gt;, or &lt;code&gt;Riverpod&lt;/code&gt; for better state management if your app scales.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Testing&lt;/strong&gt;: Write test cases for each CRUD function using Flutter&#39;s testing framework to ensure they work correctly.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By following this guide, you’ve built a functional Flutter app with CRUD operations using SQLite. With robust features like data persistence, offline access, and an easy-to-navigate UI, you’re well on your way to creating high-quality Flutter applications.&lt;/p&gt;
</description><link>https://codeswithsunny.blogspot.com/2023/02/flutter-curd-operation-example-flutter.html</link><author>noreply@blogger.com (Sunny Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7319194386698913310</guid><pubDate>Mon, 06 Feb 2023 09:24:00 +0000</pubDate><atom:updated>2025-11-26T17:05:24.452+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Create an e-commerce app in Flutter.</category><title>Step-by-Step Guide to Building an E-Commerce App in Flutter: Complete Tutorial for Beginners</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&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/b/R29vZ2xl/AVvXsEjkA2blCRCC7WoiLxZJvbM0HzPDXj0DFg37-gd4W7iH9Ro0v35QczXeSYpokpUmvF6fqfGK4Jd4ZBhVeVImEV8u5vexidaaLpNr6UY-vFgNtF1o1eHQw937dhYyX9Fd0ve7vwLyorgJvf3T4UOvHf-euijIUFoD80m-P-48RgcEdxz01dKppIOXA3OFMFAY/s1600/A%20modern,%20clean,%20professional%20digital%20illustration%20representing%20a%20Flutter%20E-Commerce%20App%20tutorial.%20Use%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20highlights%20and%20subtle%20abstract%20shapes.%20Display%203%E2%80%934%20smartphone%20screens%20showing%20e-com.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;896&quot; data-original-width=&quot;1600&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkA2blCRCC7WoiLxZJvbM0HzPDXj0DFg37-gd4W7iH9Ro0v35QczXeSYpokpUmvF6fqfGK4Jd4ZBhVeVImEV8u5vexidaaLpNr6UY-vFgNtF1o1eHQw937dhYyX9Fd0ve7vwLyorgJvf3T4UOvHf-euijIUFoD80m-P-48RgcEdxz01dKppIOXA3OFMFAY/w640-h358/A%20modern,%20clean,%20professional%20digital%20illustration%20representing%20a%20Flutter%20E-Commerce%20App%20tutorial.%20Use%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20highlights%20and%20subtle%20abstract%20shapes.%20Display%203%E2%80%934%20smartphone%20screens%20showing%20e-com.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;&lt;br /&gt;&lt;br /&gt;How to Build an E-Commerce App in Flutter: Step-by-Step Guide for Beginners&lt;/h2&gt;&lt;p&gt;Creating an e-commerce app in Flutter is a rewarding experience that allows you to leverage the power of Flutter&#39;s rich UI components, cross-platform capabilities, and speed. This guide walks you through the essential steps to build an e-commerce app from scratch, with features like product listings, shopping cart, and payment gateway integration. Whether you’re new to Flutter or have some experience, follow these steps to create your own app and launch it on both Android and iOS.&lt;/p&gt;&lt;h3&gt;Step 1: Plan and Design Your App&lt;/h3&gt;&lt;p&gt;To start, outline the core features and functionality you want in your e-commerce app. Here are some common features to consider:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;User Registration/Login&lt;/strong&gt;: Enable users to sign up and log in to save their personal information.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Product Listings&lt;/strong&gt;: Display a list of products with options to filter and sort.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Product Details Page&lt;/strong&gt;: Show details of each product, including images, descriptions, pricing, and reviews.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shopping Cart&lt;/strong&gt;: Let users add items to a shopping cart, update quantities, and view their total.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Payment Gateway Integration&lt;/strong&gt;: Integrate with payment providers (Stripe, PayPal, etc.) to handle transactions securely.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Order Tracking&lt;/strong&gt;: Allow users to view their order history and track order statuses.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Push Notifications&lt;/strong&gt;: Notify users about new arrivals, sales, or special offers.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Take the time to sketch out the user interface for each feature, and decide on a color scheme and overall visual style. Tools like Figma or Adobe XD are great for creating design mockups.&lt;/p&gt;&lt;h3&gt;Step 2: Set Up Your Development Environment&lt;/h3&gt;&lt;p&gt;To develop a Flutter app, you&#39;ll need to install the following:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Flutter SDK&lt;/strong&gt;: Download from the &lt;a href=&quot;https://flutter.dev/&quot; rel=&quot;noopener&quot; target=&quot;_new&quot;&gt;official Flutter website&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;IDE&lt;/strong&gt;: Use Android Studio, Visual Studio Code, or IntelliJ IDEA for a rich development environment.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Emulator or Physical Device&lt;/strong&gt;: Set up an Android or iOS emulator, or connect a physical device for testing.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;After installation, open your terminal and run &lt;code&gt;flutter doctor&lt;/code&gt; to ensure that all dependencies are correctly configured.&lt;/p&gt;&lt;h3&gt;Step 3: Build the UI Using Flutter Widgets&lt;/h3&gt;&lt;p&gt;Flutter offers a variety of widgets to build a beautiful UI. Here are some screens to develop:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Home Screen&lt;/strong&gt;: Display product categories, featured products, and banners.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Product Listing Screen&lt;/strong&gt;: Use &lt;code&gt;ListView&lt;/code&gt; or &lt;code&gt;GridView&lt;/code&gt; to display a list of products with images, prices, and ratings.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Product Details Screen&lt;/strong&gt;: Create a detailed page for each product with &lt;code&gt;Column&lt;/code&gt;, &lt;code&gt;Image&lt;/code&gt;, &lt;code&gt;Text&lt;/code&gt;, and &lt;code&gt;Button&lt;/code&gt; widgets for essential product information.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shopping Cart Screen&lt;/strong&gt;: List all items in the cart, with buttons for increasing/decreasing quantities and calculating the total.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Checkout Screen&lt;/strong&gt;: Include forms for users to enter shipping information and select payment options.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 4: Implement Core Functionality with APIs&lt;/h3&gt;&lt;p&gt;Now, let’s add the backend functionalities that make the app dynamic:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Product API Integration&lt;/strong&gt;: Fetch product data from a RESTful API. Use the &lt;code&gt;http&lt;/code&gt; package in Flutter to make HTTP requests. Here’s an example:&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt; import &#39;package:http/http.dart&#39; as http;
 Future fetchProducts() async {
  final response = await http.get(Uri.parse(&#39;https://api.example.com/products&#39;));
  if (response.statusCode == 200) {
    return json.decode(response.body);
  } else {
    throw Exception(&#39;Failed to load products&#39;);
  }
 } 
 &lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;





&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Shopping Cart Management&lt;/strong&gt;: Use a state management solution like Provider, GetX, or Riverpod to handle adding and removing items from the cart.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Payment Gateway Integration&lt;/strong&gt;: Integrate a payment gateway like Stripe or PayPal for processing payments. Each provider has specific APIs and SDKs for Flutter.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;User Authentication&lt;/strong&gt;: Implement user sign-up, login, and profile management using Firebase Authentication or your preferred auth provider.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Order Management&lt;/strong&gt;: Use APIs to handle orders and track the status of each order.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 5: Test and Debug Your App&lt;/h3&gt;&lt;p&gt;Testing is crucial to ensuring a smooth user experience:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Testing on Devices&lt;/strong&gt;: Run your app on multiple devices or simulators with different screen sizes to verify responsiveness.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Debugging&lt;/strong&gt;: Use Flutter’s built-in debugging tools in VS Code or Android Studio to resolve any errors.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;User Testing&lt;/strong&gt;: Consider testing with a small group of users to gather feedback on the app’s functionality and ease of use.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 6: Deploy to App Stores&lt;/h3&gt;&lt;p&gt;Once testing is complete, you’re ready to publish:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Prepare App Store Assets&lt;/strong&gt;: Create app icons, screenshots, and promotional images.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Build the App for Release&lt;/strong&gt;: Run &lt;code&gt;flutter build apk&lt;/code&gt; for Android or &lt;code&gt;flutter build ios&lt;/code&gt; for iOS.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Register Developer Accounts&lt;/strong&gt;: Sign up for Google Play Console and Apple Developer Program.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Submit the App&lt;/strong&gt;: Follow each store&#39;s submission guidelines to publish your app. Make sure to fill out all required details and adhere to their policies.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Additional Tips for Building a Successful E-Commerce App&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Optimize Performance&lt;/strong&gt;: Use lazy loading for images, reduce API call frequency, and leverage caching to make the app faster.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Analytics&lt;/strong&gt;: Integrate tools like Firebase Analytics to track user behavior and improve the app over time.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Push Notifications&lt;/strong&gt;: Set up push notifications for user engagement using Firebase Cloud Messaging (FCM) or similar services.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By following this guide, you’ll be able to build a fully functional e-commerce app with Flutter, ready for launch on both Android and iOS platforms. With a strong design, robust features, and a well-tested app, you can provide users with a seamless and engaging shopping experience.&lt;/p&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2023/02/create-e-commerce-app-in-flutter-you.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkA2blCRCC7WoiLxZJvbM0HzPDXj0DFg37-gd4W7iH9Ro0v35QczXeSYpokpUmvF6fqfGK4Jd4ZBhVeVImEV8u5vexidaaLpNr6UY-vFgNtF1o1eHQw937dhYyX9Fd0ve7vwLyorgJvf3T4UOvHf-euijIUFoD80m-P-48RgcEdxz01dKppIOXA3OFMFAY/s72-w640-h358-c/A%20modern,%20clean,%20professional%20digital%20illustration%20representing%20a%20Flutter%20E-Commerce%20App%20tutorial.%20Use%20a%20blue%20Flutter-themed%20gradient%20background%20with%20soft%20highlights%20and%20subtle%20abstract%20shapes.%20Display%203%E2%80%934%20smartphone%20screens%20showing%20e-com.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-3070674685259546268</guid><pubDate>Sat, 02 Apr 2022 06:09:00 +0000</pubDate><atom:updated>2023-03-14T14:29:31.764+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flutter Login and Register UI</category><category domain="http://www.blogger.com/atom/ns#">flutter ui</category><category domain="http://www.blogger.com/atom/ns#">forgot screen</category><category domain="http://www.blogger.com/atom/ns#">Login</category><category domain="http://www.blogger.com/atom/ns#">login validation</category><category domain="http://www.blogger.com/atom/ns#">Sign in</category><category domain="http://www.blogger.com/atom/ns#">Sign Up UI</category><category domain="http://www.blogger.com/atom/ns#">validation</category><title>Login Sign Up and Forgot Screen With Validation | Flutter UI</title><description>&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;This tutorial is a step-by-step guide to building a Flutter app that integrates login and registration and forgot password features.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white;&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/b/R29vZ2xl/AVvXsEiiaHY0UyYR_sWbLACXeGTF5cJ0ufJ0dTQ-jHhxCGtRSPpFZmVOjr4ZhYhvZqaU-RLOxofeB-0zIaJ9UjTUOJKPnj5JUXG28L3KXjuNQLtRkxMztivj_TR1vMtcjH-G5zjy2p7x_bvLZtttSloUz4u8kNtv132z5mnkzfs0FYzlqtw2v0CqujR6BO1aiA/s2560/RPY%20(3).png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiaHY0UyYR_sWbLACXeGTF5cJ0ufJ0dTQ-jHhxCGtRSPpFZmVOjr4ZhYhvZqaU-RLOxofeB-0zIaJ9UjTUOJKPnj5JUXG28L3KXjuNQLtRkxMztivj_TR1vMtcjH-G5zjy2p7x_bvLZtttSloUz4u8kNtv132z5mnkzfs0FYzlqtw2v0CqujR6BO1aiA/w640-h360/RPY%20(3).png&quot; title=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h2 style=&quot;background: 0px 0px; border: 0px; font-size: 24px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Flutter Login Sign Up and Forgot password Design&amp;nbsp;&lt;/h2&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;In this tutorial, you will learn how to create a login and a register and forgot password ui for a flutter project.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-6540565728135118&quot; data-ad-format=&quot;fluid&quot; data-ad-layout-key=&quot;-ef+6k-30-ac+ty&quot; data-ad-slot=&quot;9935679662&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 1:&lt;/b&gt;&amp;nbsp;Add the Dependency to pubspec.yaml file as shown below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;dev_dependencies:
  google_fonts: ^2.1.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 2&lt;/b&gt;: Import the library&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Now in your Dart code, you can use:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:google_fonts/google_fonts.dart&#39;;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Full Source Code&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: initial; font-size: medium; font-weight: normal;&quot;&gt;A main.dart file is a file in the Flutter framework that contains the logic for your app. It is the entry point for the application and is where you can define any variables you need to use in your code.&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial; font-size: medium; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: initial; font-size: medium;&quot;&gt;&lt;b&gt;btn.dart&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:flutter/material.dart&#39;;

class ButtonWidget extends StatelessWidget {
  final String text;
  final List&lt;color&gt; backColor;

  final List&lt;color&gt; textColor;
  final GestureTapCallback onPressed;

  const ButtonWidget({
    Key? key,
    required this.text,
    required this.backColor,
    required this.textColor,
    required this.onPressed,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Shader textGradient = LinearGradient(
      colors: &lt;color&gt;[textColor[0], textColor[1]],
    ).createShader(
      const Rect.fromLTWH(
        0.0,
        0.0,
        200.0,
        70.0,
      ),
    );
    var size = MediaQuery.of(context).size;
    return SizedBox(
      height: size.height * 0.07,
      width: size.width * 0.9,
      child: InkWell(
        onTap: onPressed,
        child: Container(
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(15.0),
            gradient: LinearGradient(
              stops: const [0.4, 2],
              begin: Alignment.centerRight,
              end: Alignment.centerLeft,
              colors: backColor,
            ),
          ),
          child: Align(
            child: Text(
              text,
              style: TextStyle(
                foreground: Paint()..shader = textGradient,
                fontWeight: FontWeight.bold,
                fontSize: size.height * 0.02,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
&lt;/color&gt;&lt;/color&gt;&lt;/color&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ads&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;main.dart&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: large; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:login_blk/screen/auth.dart&#39;;
void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(const App());
}

class App extends StatefulWidget {
  const App({Key? key}) : super(key: key);
  @override
  _AppState createState() =&amp;gt; _AppState();
}

class _AppState extends State&lt;app&gt; {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      title: &#39;Login UI&#39;,
      home: AuthPage(),
    );
  }
}&lt;/app&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;u style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: large; outline: 0px; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;auth.dart&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #545454; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;This blog shares insight into the login page that&#39;s being built with Flutter. The login page will allow users to enter their username and password to authenticate before accessing the app&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-6540565728135118&quot; data-ad-format=&quot;fluid&quot; data-ad-layout=&quot;in-article&quot; data-ad-slot=&quot;8931293601&quot; style=&quot;display: block; text-align: center;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span&gt;This blog shares insight into the register page that&#39;s being built with Flutter. The register page will allow users to enter their first name,last name, email and password and confirm password to authenticate before accessing the app&lt;/span&gt;&lt;span style=&quot;color: #545454;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:google_fonts/google_fonts.dart&#39;;
import &#39;package:login_blk/btn_widget.dart&#39;;
import &#39;package:login_blk/screen/forgot_pass.dart&#39;;

class AuthPage extends StatefulWidget {
  const AuthPage({Key? key}) : super(key: key);

  @override
  _AuthPageState createState() =&amp;gt; _AuthPageState();
}

class _AuthPageState extends State&lt;/span&gt;&lt;authpage&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; {
  bool checkedValue = false;
  bool register = true;
  List textfieldsStrings = [
    &quot;&quot;, 
    &quot;&quot;, 
    &quot;&quot;, 
    &quot;&quot;, 
    &quot;&quot;, 
  ];

  final _firstnamekey = GlobalKey&lt;/span&gt;&lt;formstate&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;();
  final _lastNamekey = GlobalKey&lt;/span&gt;&lt;formstate&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;();
  final _emailKey = GlobalKey&lt;/span&gt;&lt;formstate&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;();
  final _passwordKey = GlobalKey&lt;/span&gt;&lt;formstate&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;();
  final _confirmPasswordKey = GlobalKey&lt;/span&gt;&lt;formstate&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;();

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    var brightness = MediaQuery.of(context).platformBrightness;
    bool isDarkMode = brightness == Brightness.dark;
    return Scaffold(
      body: Center(
        child: Container(
          height: size.height,
          width: size.height,
          decoration: BoxDecoration(
            color: isDarkMode ? const Color(0xff151f2c) : Colors.white,
          ),
          child: SafeArea(
            child: Stack(
              children: [
                SingleChildScrollView(
                  child: Column(
                    children: [
                      Padding(
                        padding: EdgeInsets.only(top: size.height * 0.015),
                        child: Align(
                          child: register
                              ? Text(
                                  &#39;Create an Account&#39;,
                                  style: GoogleFonts.poppins(
                                    color: isDarkMode
                                        ? Colors.white
                                        : const Color(0xff1D1617),
                                    fontSize: size.height * 0.025,
                                    fontWeight: FontWeight.bold,
                                  ),
                                )
                              : Column(
                            mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Text(
                                      &#39;Login&#39;,
                                      style: GoogleFonts.poppins(
                                        color: isDarkMode
                                            ? Colors.white
                                            : const Color(0xff1D1617),
                                        fontSize: size.height * 0.05,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                    Text(
                                      &#39;Welcome Back&#39;,
                                      style: GoogleFonts.poppins(
                                        color: isDarkMode
                                            ? Colors.white
                                            : const Color(0xff1D1617),
                                        fontSize: size.height * 0.025,
                                        fontWeight: FontWeight.normal,
                                      ),
                                    ),
                                  ],
                                ),
                        ),
                      ),
                      Padding(
                        padding: EdgeInsets.only(top: size.height * 0.01),
                      ),
                      SizedBox(
                        height: 60,
                        child: register
                            ? buildTextField(
                                &quot;First Name&quot;,
                                Icons.person_outlined,
                                false,
                                size,
                                (valuename) {
                                  if (valuename.length &amp;lt;= 2) {
                                    buildSnackError(
                                      &#39;Name is Require&#39;,
                                      context,
                                      size,
                                    );
                                    return &#39;&#39;;
                                  }
                                  return null;
                                },
                                _firstnamekey,
                                0,
                                isDarkMode,
                              )
                            : Container(),
                      ),
                      SizedBox(
                        height: 60,
                        child: register
                            ? buildTextField(
                                &quot;Last Name&quot;,
                                Icons.person_outlined,
                                false,
                                size,
                                (valuesurname) {
                                  if (valuesurname.length &amp;lt;= 2) {
                                    buildSnackError(
                                      &#39;Last name is Require&#39;,
                                      context,
                                      size,
                                    );
                                    return &#39;&#39;;
                                  }
                                  return null;
                                },
                                _lastNamekey,
                                1,
                                isDarkMode,
                              )
                            : Container(),
                      ),
                      Form(
                        child: SizedBox(
                          height: 60,
                          child: buildTextField(
                            &quot;Email&quot;,
                            Icons.email_outlined,
                            false,
                            size,
                            (valuemail) {
                              if (valuemail.length &amp;lt; 5) {
                                buildSnackError(
                                  &#39;Email Id Require&#39;,
                                  context,
                                  size,
                                );
                                return &#39;&#39;;
                              }
                              if (!RegExp(
                                      r&quot;^[a-zA-Z0-9.a-zA-Z0-9.!#$%&amp;amp;&#39;*+-/=?^_`{|}~]+@[a-zA-Z0-9]+.[a-zA-Z]+&quot;)
                                  .hasMatch(valuemail)) {
                                buildSnackError(
                                  &#39;Please Enter Valid Email&#39;,
                                  context,
                                  size,
                                );
                                return &#39;&#39;;
                              }
                              return null;
                            },
                            _emailKey,
                            2,
                            isDarkMode,
                          ),
                        ),
                      ),
                      Form(
                        child: SizedBox(
                          height: 60,
                          child: buildTextField(
                            &quot;Passsword&quot;,
                            Icons.lock_outline,
                            true,
                            size,
                            (valuepassword) {
                              if (valuepassword.length &amp;lt;= 2) {
                                buildSnackError(
                                  &#39;Password is Require&#39;,
                                  context,
                                  size,
                                );
                                return &#39;&#39;;
                              }
                              if (valuepassword.length &amp;lt; 6) {
                                buildSnackError(
                                  &#39;Password must be at least 6 characters&#39;,
                                  context,
                                  size,
                                );
                                return &#39;&#39;;
                              }
                              return null;
                            },
                            _passwordKey,
                            3,
                            isDarkMode,
                          ),
                        ),
                      ),
                      Form(
                        child: SizedBox(
                          height: 60,
                          child: register
                              ? buildTextField(
                                  &quot;Confirm Passsword&quot;,
                                  Icons.lock_outline,
                                  true,
                                  size,
                                  (valuepassword) {
                                    if (valuepassword != textfieldsStrings[3]) {
                                      buildSnackError(
                                        &#39;Confirm password does not match the entered&#39;,
                                        context,
                                        size,
                                      );
                                      return &#39;&#39;;
                                    }
                                    return null;
                                  },
                                  _confirmPasswordKey,
                                  4,
                                  isDarkMode,
                                )
                              : Container(),
                        ),
                      ),
                      Padding(
                        padding: EdgeInsets.symmetric(
                          horizontal: size.width * 0.015,
                          vertical: size.height * 0.025,
                        ),
                        child: register
                            ? CheckboxListTile(
                                title: RichText(
                                  textAlign: TextAlign.left,
                                  text: TextSpan(
                                    children: [
                                      TextSpan(
                                        text:
                                            &quot;By creating an account, you agree to our &quot;,
                                        style: TextStyle(
                                          color: const Color(0xffADA4A5),
                                          fontSize: size.height * 0.015,
                                        ),
                                      ),
                                      WidgetSpan(
                                        child: InkWell(
                                          onTap: () {
                                            print(&#39;Conditions of Use&#39;);
                                          },
                                          child: Text(
                                            &quot;Conditions of Use&quot;,
                                            style: TextStyle(
                                              color: const Color(0xffADA4A5),
                                              decoration:
                                                  TextDecoration.underline,
                                              fontSize: size.height * 0.015,
                                            ),
                                          ),
                                        ),
                                      ),
                                      TextSpan(
                                        text: &quot; and &quot;,
                                        style: TextStyle(
                                          color: const Color(0xffADA4A5),
                                          fontSize: size.height * 0.015,
                                        ),
                                      ),
                                      WidgetSpan(
                                        child: InkWell(
                                          onTap: () {
                                            print(&#39;Privacy Notice&#39;);
                                          },
                                          child: Text(
                                            &quot;Privacy Notice&quot;,
                                            style: TextStyle(
                                              color: const Color(0xffADA4A5),
                                              decoration:
                                                  TextDecoration.underline,
                                              fontSize: size.height * 0.015,
                                            ),
                                          ),
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                activeColor: const Color(0xff55F233),
                                value: checkedValue,
                                onChanged: (newValue) {
                                  setState(() {
                                    checkedValue = newValue!;
                                  });
                                },
                                controlAffinity:
                                    ListTileControlAffinity.leading,
                              )
                            : InkWell(
                                onTap: () {
                                  Navigator.push(
                                    context,
                                    MaterialPageRoute(
                                        builder: (context) =&amp;gt;
                                            const ForgotPasswordPage()),
                                  );
                                },
                                child: Text(
                                  &quot;Forgot your password?&quot;,
                                  style: TextStyle(
                                    color: const Color(0xffADA4A5),
                                    decoration: TextDecoration.underline,
                                    fontSize: size.height * 0.02,
                                  ),
                                ),
                              ),
                      ),
                      AnimatedPadding(
                        duration: const Duration(milliseconds: 500),
                        padding: register
                            ? EdgeInsets.only(top: size.height * 0.025)
                            : EdgeInsets.only(top: size.height * 0.075),
                        child: ButtonWidget(
                          text: register ? &quot;Register&quot; : &quot;Login&quot;,
                          backColor: isDarkMode
                              ? [
                                  Colors.black,
                                  Colors.black,
                                ]
                              : const [
                                  Color(0xff000000),
                                  Color(0xff000000),
                                ],
                          textColor: const [
                            Colors.white,
                            Colors.white,
                          ],
                          onPressed: () async {
                            if (register) {
                              if (_firstnamekey.currentState!.validate()) {
                                if (_lastNamekey.currentState!.validate()) {
                                  if (_emailKey.currentState!.validate()) {
                                    if (_passwordKey.currentState!.validate()) {
                                      if (_confirmPasswordKey.currentState!
                                          .validate()) {
                                        if (checkedValue == false) {
                                          buildSnackError(
                                              &#39;Accept our Privacy Policy and Term Of Use&#39;,
                                              context,
                                              size);
                                        } else {
                                          print(&#39;register&#39;);
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            } else {
                              if (_emailKey.currentState!.validate()) {
                                if (_passwordKey.currentState!.validate()) {
                                  print(&#39;login&#39;);
                                }
                              }
                            }
                          },
                        ),
                      ),
                      AnimatedPadding(
                        duration: const Duration(milliseconds: 500),
                        padding: EdgeInsets.only(
                          top: register
                              ? size.height * 0.025
                              : size.height * 0.15,
                        ),
                      ),
                      RichText(
                        textAlign: TextAlign.left,
                        text: TextSpan(
                          children: [
                            TextSpan(
                              text: register
                                  ? &quot;Already have an account? &quot;
                                  : &quot;Don’t have an account yet? &quot;,
                              style: TextStyle(
                                color: isDarkMode
                                    ? Colors.white
                                    : const Color(0xff1D1617),
                                fontSize: size.height * 0.02,
                              ),
                            ),
                            WidgetSpan(
                              child: InkWell(
                                onTap: () =&amp;gt; setState(() {
                                  if (register) {
                                    register = false;
                                  } else {
                                    register = true;
                                  }
                                }),
                                child: register
                                    ? Text(
                                        &quot;Login&quot;,
                                        style: TextStyle(
                                            foreground: Paint()
                                              ..shader = const LinearGradient(
                                                colors: &lt;/span&gt;&lt;color&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                                                  Colors.blue,
                                                  Colors.indigo,
                                                ],
                                              ).createShader(
                                                const Rect.fromLTWH(
                                                  0.0,
                                                  0.0,
                                                  200.0,
                                                  70.0,
                                                ),
                                              ),
                                            fontSize: size.height * 0.02,
                                            fontWeight: FontWeight.bold),
                                      )
                                    : Text(
                                        &quot;Register&quot;,
                                        style: TextStyle(
                                            foreground: Paint()
                                              ..shader = const LinearGradient(
                                                colors: &lt;/span&gt;&lt;color&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                                                  Colors.blue,
                                                  Colors.indigo,
                                                ],
                                              ).createShader(
                                                const Rect.fromLTWH(
                                                    0.0, 0.0, 200.0, 70.0),
                                              ),
                                            fontSize: size.height * 0.02,
                                            fontWeight: FontWeight.bold),
                                      ),
                              ),
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }

  bool pwVisible = false;
  Widget buildTextField(
    String hintText,
    IconData icon,
    bool password,
    size,
    FormFieldValidator validator,
    Key key,
    int stringToEdit,
    bool isDarkMode,
  ) {
    return Padding(
      padding: EdgeInsets.only(top: size.height * 0.025),
      child: Container(
        width: size.width * 0.9,
        height: size.height * 0.05,
        decoration: BoxDecoration(
          color: isDarkMode ? Colors.black : const Color(0xffF7F8F8),
          borderRadius: const BorderRadius.all(Radius.circular(15)),
        ),
        child: Form(
          key: key,
          child: TextFormField(
            style: TextStyle(
                color: isDarkMode ? const Color(0xffADA4A5) : Colors.black),
            onChanged: (value) {
              setState(() {
                textfieldsStrings[stringToEdit] = value;
              });
            },
            validator: validator,
            textInputAction: TextInputAction.next,
            obscureText: password ? !pwVisible : false,
            decoration: InputDecoration(
              errorStyle: const TextStyle(height: 0),
              hintStyle: const TextStyle(
                color: Color(0xffADA4A5),
              ),
              border: InputBorder.none,
              contentPadding: EdgeInsets.only(
                top: size.height * 0.012,
              ),
              hintText: hintText,
              prefixIcon: Padding(
                padding: EdgeInsets.only(
                  top: size.height * 0.005,
                ),
                child: Icon(
                  icon,
                  color: const Color(0xff7B6F72),
                ),
              ),
              suffixIcon: password
                  ? Padding(
                      padding: EdgeInsets.only(
                        top: size.height * 0.005,
                      ),
                      child: InkWell(
                        onTap: () {
                          setState(() {
                            pwVisible = !pwVisible;
                          });
                        },
                        child: pwVisible
                            ? const Icon(
                                Icons.visibility_off_outlined,
                                color: Color(0xff7B6F72),
                              )
                            : const Icon(
                                Icons.visibility_outlined,
                                color: Color(0xff7B6F72),
                              ),
                      ),
                    )
                  : null,
            ),
          ),
        ),
      ),
    );
  }

  ScaffoldFeatureController&lt;/span&gt;&lt;snackbar snackbarclosedreason=&quot;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; buildSnackError(
      String error, context, size) {
    return ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
              topRight: Radius.circular(16), topLeft: Radius.circular(16)),
        ),
        duration: const Duration(seconds: 2),
        backgroundColor: Colors.black,
        content: SizedBox(
          height: size.height * 0.03,
          child: Text(
            error,
            style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
          ),
        ),
      ),
    );
  }
}&lt;/span&gt;
&lt;/snackbar&gt;&lt;/color&gt;&lt;/color&gt;&lt;/formstate&gt;&lt;/formstate&gt;&lt;/formstate&gt;&lt;/formstate&gt;&lt;/formstate&gt;&lt;/authpage&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;forgot_pass.dart&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:block&quot;
     data-ad-format=&quot;fluid&quot;
     data-ad-layout-key=&quot;-ef+6k-30-ac+ty&quot;
     data-ad-client=&quot;ca-pub-6540565728135118&quot;
     data-ad-slot=&quot;9935679662&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:login_blk/btn_widget.dart&#39;;
import &#39;package:flutter/material.dart&#39;;
import &#39;package:google_fonts/google_fonts.dart&#39;;

class ForgotPasswordPage extends StatefulWidget {
  const ForgotPasswordPage({Key? key}) : super(key: key);

  @override
  _ForgotPasswordPageState createState() =&amp;gt; _ForgotPasswordPageState();
}

class _ForgotPasswordPageState extends State&lt;forgotpasswordpage&gt; {
  String email = &#39;&#39;;

  final _emailKey = GlobalKey&lt;formstate&gt;();

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    var brightness = MediaQuery.of(context).platformBrightness;
    bool isDarkMode = brightness == Brightness.dark;
    return Scaffold(
      body: Center(
        child: Container(
          height: size.height,
          width: size.height,
          decoration: BoxDecoration(
            color: isDarkMode ? const Color(0xff151f2c) : Colors.white,
          ),
          child: SafeArea(
            child: Stack(
              children: [
                SingleChildScrollView(
                  child: Column(
                    children: [
                      Padding(
                        padding: EdgeInsets.symmetric(
                            horizontal: size.width * 0.030,vertical: 2),
                        child: Row(
                          children: [
                            InkWell(
                              onTap: () =&amp;gt;
                                  Navigator.pop(context), //go back to authPage
                              child: Icon(
                                Icons.arrow_back_ios,
                                color: isDarkMode ? Colors.white : Colors.black,
                                size: size.height * 0.04,
                              ),
                            ),
                            Padding(
                              padding: EdgeInsets.symmetric(
                                horizontal: size.width * 0.015,
                              ),
                            ),
                          ],
                        ),
                      ),
                      Padding(
                        padding: EdgeInsets.only(
                          top: size.height * 0.05,
                          left: size.width * 0.055,
                        ),
                        child: Align(
                          alignment: Alignment.centerLeft,
                          child: Text(
                            &#39;Forgot password&#39;,
                            style: GoogleFonts.poppins(
                              color: isDarkMode
                                  ? Colors.white
                                  : const Color(0xff1D1617),
                              fontSize: size.height * 0.035,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding: EdgeInsets.symmetric(
                            horizontal: size.width * 0.055),
                        child: Align(
                          child: Text(
                            &quot;Forgot your password?\nProvide your email and we will send you a link to reset your password.&quot;,
                            style: GoogleFonts.poppins(
                              color:
                              isDarkMode ? Colors.white54 : Colors.black54,
                              fontSize: size.height * 0.02,
                            ),
                          ),
                        ),
                      ),
                      Form(
                        child: buildTextField(
                          &quot;Email&quot;,
                          Icons.email_outlined,
                          false,
                          size,
                              (valuemail) {
                            if (valuemail.length &amp;lt; 5) {
                              buildSnackError(
                                &#39;Email Id Require&#39;,
                                context,
                                size,
                              );
                              return &#39;&#39;;
                            }
                            if (!RegExp(
                                r&quot;^[a-zA-Z0-9.a-zA-Z0-9.!#$%&amp;amp;&#39;*+-/=?^_`{|}~]+@[a-zA-Z0-9]+.[a-zA-Z]+&quot;)
                                .hasMatch(valuemail)) {
                              buildSnackError(
                                &#39;Please Enter Valid Email&#39;,
                                context,
                                size,
                              );
                              return &#39;&#39;;
                            }
                            return null;
                          },
                          isDarkMode,
                        ),
                      ),
                      Padding(
                        padding: EdgeInsets.only(top: size.height * 0.03),
                        child: ButtonWidget(
                            text: &#39;Reset&#39;,
                            backColor: isDarkMode
                                ? [
                              Colors.black,
                              Colors.black,
                            ]
                                : const [Color(0xff000000), Color(0xff000000),],
                            textColor: const [
                              Colors.white,
                              Colors.white,
                            ],
                            onPressed: () async {
                              if (_emailKey.currentState!.validate()) {
                                print(&#39;$email forgot password&#39;);
                              }
                            }),
                      ),

                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }

  bool pwVisible = false;
  Widget buildTextField(
      String hintText,
      IconData icon,
      bool password,
      size,
      FormFieldValidator validator,
      bool isDarkMode,
      ) {
    return Padding(
      padding: EdgeInsets.only(top: size.height * 0.025),
      child: Container(
        width: size.width * 0.9,
        height: size.height * 0.06,
        decoration: BoxDecoration(
          color: isDarkMode ? Colors.black : const Color(0xffF7F8F8),
          borderRadius: const BorderRadius.all(Radius.circular(10)),
        ),
        child: Form(
          key: _emailKey,
          child: TextFormField(
            style: TextStyle(
                color: isDarkMode ? const Color(0xffADA4A5) : Colors.black),
            onChanged: (value) {
              setState(() {
                email = value;
              });
            },
            validator: validator,
            textInputAction: TextInputAction.next,
            obscureText: password ? !pwVisible : false,
            decoration: InputDecoration(
              errorStyle: const TextStyle(height: 0),
              hintStyle: const TextStyle(
                color: Color(0xffADA4A5),
              ),
              border: InputBorder.none,
              contentPadding: EdgeInsets.only(
                top: size.height * 0.02,
              ),
              hintText: hintText,
              prefixIcon: Padding(
                padding: EdgeInsets.only(
                  top: size.height * 0.005,
                ),
                child: Icon(
                  icon,
                  color: const Color(0xff7B6F72),
                ),
              ),
              suffixIcon: password
                  ? Padding(
                padding: EdgeInsets.only(
                  top: size.height * 0.005,
                ),
                child: InkWell(
                  onTap: () {
                    setState(() {
                      pwVisible = !pwVisible;
                    });
                  },
                  child: pwVisible
                      ? const Icon(
                    Icons.visibility_off_outlined,
                    color: Color(0xff7B6F72),
                  )
                      : const Icon(
                    Icons.visibility_outlined,
                    color: Color(0xff7B6F72),
                  ),
                ),
              )
                  : null,
            ),
          ),
        ),
      ),
    );
  }

  ScaffoldFeatureController&lt;snackbar snackbarclosedreason=&quot;&quot;&gt; buildSnackError(
      String error, context, size) {
    return ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(
            topRight: Radius.circular(16),
            topLeft: Radius.circular(16)
        ),),
        duration: const Duration(seconds: 2),
        backgroundColor: Colors.black,
        content: SizedBox(
          height: size.height * 0.03,
          child: Text(error,style: TextStyle(fontSize: 15,fontWeight: FontWeight.bold),),
        ),
      ),
    );
  }
}&lt;/snackbar&gt;&lt;/formstate&gt;&lt;/forgotpasswordpage&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;OUTPUT
  &lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-6540565728135118&quot; data-ad-format=&quot;fluid&quot; data-ad-layout=&quot;in-article&quot; data-ad-slot=&quot;8931293601&quot; style=&quot;display: block; text-align: center;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
  &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&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/b/R29vZ2xl/AVvXsEhkLKO6E-JCwSTRLqbJ0LlIN5eZFiNL7H7JZ0ScKsCvzrVb0qTnaF5A_N1ojruVwUp3Dh-R9V6-Td6rVaDa_tzenpFzByPpb7Y8NcIZ6dm-N7LzjtQDhZ9NSHVv0L0x5odAMJFEBFhqm4BjNF478QJZT0jU-9s-F9axGw_5n23SEb0zKN6leQhdPCI3lw/s1407/Screenshot_2022_0402_104727.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1407&quot; data-original-width=&quot;719&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkLKO6E-JCwSTRLqbJ0LlIN5eZFiNL7H7JZ0ScKsCvzrVb0qTnaF5A_N1ojruVwUp3Dh-R9V6-Td6rVaDa_tzenpFzByPpb7Y8NcIZ6dm-N7LzjtQDhZ9NSHVv0L0x5odAMJFEBFhqm4BjNF478QJZT0jU-9s-F9axGw_5n23SEb0zKN6leQhdPCI3lw/w328-h640/Screenshot_2022_0402_104727.png&quot; title=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; width=&quot;328&quot; /&gt;&lt;/a&gt;&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/b/R29vZ2xl/AVvXsEh4VKTGexRTgnzCUpm-xxWCTsfczWjQ7QoMGqXEVkCHttwbqqydO2DHVaWx4s7rfhxDySd8ek7HVatfZ4uKdDjb5foAOSaPOlGSbr20xp3Bnq06euUcgDeXx9rIEuwPxV91-DXJhFfybUyiZSt2nespyREUgyiVE2fKz3cfeO7nyMlRk2pmjfunVhoo5w/s1401/Screenshot_2022_0402_104748.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1401&quot; data-original-width=&quot;719&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4VKTGexRTgnzCUpm-xxWCTsfczWjQ7QoMGqXEVkCHttwbqqydO2DHVaWx4s7rfhxDySd8ek7HVatfZ4uKdDjb5foAOSaPOlGSbr20xp3Bnq06euUcgDeXx9rIEuwPxV91-DXJhFfybUyiZSt2nespyREUgyiVE2fKz3cfeO7nyMlRk2pmjfunVhoo5w/w328-h640/Screenshot_2022_0402_104748.png&quot; title=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; width=&quot;328&quot; /&gt;&lt;/a&gt;&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/b/R29vZ2xl/AVvXsEhqTNM9tRm7N-girXu2LmMHimMRc8DdWTB4PwKnqdg8VsswwOaScSZzb2_sE3aU94DMnYjYMCW2B8dl7YIktulkaBFtCyyGa95RK4sxHAE2V0Np1ZfVgENXmApI-5g9JQLAuSyuRovl8upLYJNZKGY70GU_6U2YbsjQ0lN8JhWX1Z_dB6tV5sASm8Ld3w/s1402/Screenshot_2022_0402_104803.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1402&quot; data-original-width=&quot;719&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqTNM9tRm7N-girXu2LmMHimMRc8DdWTB4PwKnqdg8VsswwOaScSZzb2_sE3aU94DMnYjYMCW2B8dl7YIktulkaBFtCyyGa95RK4sxHAE2V0Np1ZfVgENXmApI-5g9JQLAuSyuRovl8upLYJNZKGY70GU_6U2YbsjQ0lN8JhWX1Z_dB6tV5sASm8Ld3w/w328-h640/Screenshot_2022_0402_104803.png&quot; title=&quot;Login Sign Up and Forgot Screen With Validation | Flutter UI&quot; width=&quot;328&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2022/04/login-sign-up-and-forgot-screen-with.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiaHY0UyYR_sWbLACXeGTF5cJ0ufJ0dTQ-jHhxCGtRSPpFZmVOjr4ZhYhvZqaU-RLOxofeB-0zIaJ9UjTUOJKPnj5JUXG28L3KXjuNQLtRkxMztivj_TR1vMtcjH-G5zjy2p7x_bvLZtttSloUz4u8kNtv132z5mnkzfs0FYzlqtw2v0CqujR6BO1aiA/s72-w640-h360-c/RPY%20(3).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-5380528864399119268</guid><pubDate>Thu, 31 Mar 2022 16:03:00 +0000</pubDate><atom:updated>2023-03-14T14:31:29.066+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">flutter ui</category><category domain="http://www.blogger.com/atom/ns#">login ui</category><category domain="http://www.blogger.com/atom/ns#">registration ui</category><category domain="http://www.blogger.com/atom/ns#">sign in design flutter</category><category domain="http://www.blogger.com/atom/ns#">sign up design</category><title>Flutter Login Design | Flutter UI | Sweet Alert </title><description>&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white; font-size: medium;&quot;&gt;This tutorial is a step-by-step guide to building a Flutter app that integrates login and registration features.&lt;/span&gt;&lt;div&gt;&lt;span face=&quot;Open Sans, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&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/b/R29vZ2xl/AVvXsEiotKo1TZI27ORgcRUfUEDXbgvWtb-W1AOMfxOumsYbTKWlQ2mgUlEz4bJePDQFYlVUfCDGYVtrAy9UEMAPZ8oMNYCnovAyjkEIwmaHZJ-5S121pYuIFG_-dlESkdqGcV6aAXIY0V6L6aynAkMaD9gOdIXzb3hkEyGRc46MtoHOJKGC7XzVjycWcDdl-g/s2560/RPY%20(2).png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Login and Registration Design | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiotKo1TZI27ORgcRUfUEDXbgvWtb-W1AOMfxOumsYbTKWlQ2mgUlEz4bJePDQFYlVUfCDGYVtrAy9UEMAPZ8oMNYCnovAyjkEIwmaHZJ-5S121pYuIFG_-dlESkdqGcV6aAXIY0V6L6aynAkMaD9gOdIXzb3hkEyGRc46MtoHOJKGC7XzVjycWcDdl-g/s16000/RPY%20(2).png&quot; title=&quot;Flutter Login and Registration Design | Flutter UI&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span face=&quot;Open Sans, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h2 style=&quot;background: 0px 0px; border: 0px; font-size: 24px; margin: 0px 0px 15px; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;Flutter Login Design&amp;nbsp;&lt;/h2&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;In this tutorial, you will learn how to create a login and a register ui for a flutter project.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #545454; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 21px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: large; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Complete Source Code&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;A main.dart file is a file in the Flutter framework that contains the logic for your app. It is the entry point for the application and is where you can define any variables you need to use in your code.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-6540565728135118&quot; data-ad-format=&quot;fluid&quot; data-ad-layout-key=&quot;-ef+6k-30-ac+ty&quot; data-ad-slot=&quot;9935679662&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span face=&quot;CircularStd, sans-serif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 1:&lt;/b&gt;&amp;nbsp;Add the Dependency to pubspec.yaml file as shown below:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white; color: #545454;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;dependencies:
  sweetalert: ^0.0.1&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;background: 0px 0px; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 2&lt;/b&gt;: Import the library&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #545454; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background: 0px 0px; border: 0px; font-size: medium; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Now in your Dart code, you can use:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 15px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:sweetalert/sweetalert.dart&#39;;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Sweet Alert Function&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;SweetAlert.show(context,
          title: &quot;Login Success !&quot;,
          subtitle: &quot;Congratulations&quot;,
          style: SweetAlertStyle.success);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Full Source Code&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;main.dart&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;package:flutter/material.dart&#39;;
import &#39;package:login_reg_1/animation.dart&#39;;
import &#39;package:sweetalert/sweetalert.dart&#39;;

void main() =&amp;gt; runApp(MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    ));

class HomePage extends StatefulWidget {
  @override
  State&lt;/span&gt;&lt;homepage&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; createState() =&amp;gt; _HomePageState();
}

class _HomePageState extends State&lt;/span&gt;&lt;homepage&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: double.infinity,
        decoration: BoxDecoration(
            gradient: LinearGradient(
                begin: Alignment.topCenter,
                colors: [Colors.amber, Colors.amber, Colors.amber])),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: &lt;/span&gt;&lt;widget&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
            SizedBox(
              height: 80,
            ),
            Padding(
              padding: EdgeInsets.all(20),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: &lt;/span&gt;&lt;widget&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                  Text(
                    &quot;Login&quot;,
                    style: TextStyle(color: Colors.white, fontSize: 40),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  Text(
                    &quot;Welcome Back&quot;,
                    style: TextStyle(color: Colors.white, fontSize: 18),
                  ),
                ],
              ),
            ),
            SizedBox(height: 20),
            Expanded(
              child: Container(
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.only(
                        topLeft: Radius.circular(20),
                        topRight: Radius.circular(20))),
                child: SingleChildScrollView(
                  child: Padding(
                    padding: EdgeInsets.all(30),
                    child: Column(
                      children: &lt;/span&gt;&lt;widget&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                        SizedBox(
                          height: 60,
                        ),
                        Container(
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(10),
                              boxShadow: [
                                BoxShadow(
                                    color: Color.fromRGBO(225, 95, 27, .3),
                                    blurRadius: 20,
                                    offset: Offset(0, 10))
                              ]),
                          child: Column(
                            children: &lt;/span&gt;&lt;widget&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                              Container(
                                padding: EdgeInsets.all(10),
                                decoration: BoxDecoration(
                                    border: Border(
                                        bottom:
                                            BorderSide(color: Colors.grey))),
                                child: TextField(
                                  decoration: InputDecoration(
                                      hintText: &quot;Email or Phone number&quot;,
                                      hintStyle: TextStyle(color: Colors.grey),
                                      border: InputBorder.none),
                                ),
                              ),
                              Container(
                                padding: EdgeInsets.all(10),
                                decoration: BoxDecoration(
                                    border: Border(
                                        bottom:
                                            BorderSide(color: Colors.grey))),
                                child: TextField(
                                  obscureText: true,
                                  decoration: InputDecoration(
                                      hintText: &quot;Password&quot;,
                                      hintStyle: TextStyle(color: Colors.grey),
                                      border: InputBorder.none),
                                ),
                              ),
                            ],
                          ),
                        ),
                        SizedBox(
                          height: 40,
                        ),
                        Text(
                          &quot;Forgot Password?&quot;,
                          style: TextStyle(color: Colors.grey,fontSize: 20),
                        ),
                        SizedBox(
                          height: 40,
                        ),
                        InkWell(
                          onTap: (){
                            SweetAlert.show(context,
                                title: &quot;Login Success !&quot;,
                                subtitle: &quot;Congratulations&quot;,
                                style: SweetAlertStyle.success);
                          },
                          child: Container(
                            height: 50,
                            margin: EdgeInsets.symmetric(horizontal: 50),
                            decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(50),
                                color: Colors.amber[900]),
                            child: Center(
                              child: Text(
                                &quot;Login&quot;,
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 20,
                                    fontWeight: FontWeight.bold),
                              ),
                            ),
                          ),
                        ),
                        SizedBox(
                          height: 50,
                        ),
                        Text(
                          &quot;Connect with social media&quot;,
                          style: TextStyle(color: Colors.grey,fontSize: 18),
                        ),
                        SizedBox(
                          height: 30,
                        ),
                        Row(
                          children: &lt;/span&gt;&lt;widget&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[
                            Expanded(
                                child: Container(
                              height: 50,
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(50),
                                  color: Colors.pinkAccent),
                              child: Center(
                                child: Text(
                                  &quot;Instagram&quot;,
                                  style: TextStyle(
                                      color: Colors.white,
                                      fontWeight: FontWeight.bold),
                                ),
                              ),
                            )),
                            SizedBox(
                              width: 30,
                            ),
                            Expanded(
                                child: Container(
                              height: 50,
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(50),
                                  color: Colors.red),
                              child: Center(
                                child: Text(
                                  &quot;Youtube&quot;,
                                  style: TextStyle(
                                      color: Colors.white,
                                      fontWeight: FontWeight.bold),
                                ),
                              ),
                            )),
                          ],
                        )
                      ],
                    ),
                  ),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}&lt;/span&gt;
&lt;/widget&gt;&lt;/widget&gt;&lt;/widget&gt;&lt;/widget&gt;&lt;/widget&gt;&lt;/homepage&gt;&lt;/homepage&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&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/b/R29vZ2xl/AVvXsEgQ315yfb6z3cenkYNDv8eR3YF3HBGQm1-TmMrygU0SAePsClguABVv3JJpTCLfntfOYMD0uUVacXcTdZoo6Zj5zJpZBWPuiXRhk8XpTXU2aWIpwAkVJABzeTqGpaVPKzS-QDwed_6Y18T9VSWFM4aWfUYyi2QhQzOiixk1EApjGc9XqX4pm3_ervokaA/s1398/Screenshot_2022_0331_185540.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Login Design | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1398&quot; data-original-width=&quot;719&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ315yfb6z3cenkYNDv8eR3YF3HBGQm1-TmMrygU0SAePsClguABVv3JJpTCLfntfOYMD0uUVacXcTdZoo6Zj5zJpZBWPuiXRhk8XpTXU2aWIpwAkVJABzeTqGpaVPKzS-QDwed_6Y18T9VSWFM4aWfUYyi2QhQzOiixk1EApjGc9XqX4pm3_ervokaA/w330-h640/Screenshot_2022_0331_185540.png&quot; title=&quot;Flutter Login Design | Flutter UI&quot; width=&quot;330&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6540565728135118&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:block&quot;
     data-ad-format=&quot;fluid&quot;
     data-ad-layout-key=&quot;-ef+6k-30-ac+ty&quot;
     data-ad-client=&quot;ca-pub-6540565728135118&quot;
     data-ad-slot=&quot;9935679662&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&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/b/R29vZ2xl/AVvXsEjQmqEgjGhFqRnCvLWScB9Xa09RJXLnMPZqS4OxttSO9xkb4-XRMYfoCxr1n6WUIMzrDugEsX0FVT2VqmR_TSJYo580O2r9sem-sqDJf41IhX6tZFzTf_ABdfttFPzRRzm_HTmfIawLMHfybKRb62RphQyI4ZC3dzR-oPupKmmpSF67c0V5bDc0P60VNQ/s1398/Screenshot_2022_0331_185556.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Flutter Login Design | Flutter UI&quot; border=&quot;0&quot; data-original-height=&quot;1398&quot; data-original-width=&quot;719&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQmqEgjGhFqRnCvLWScB9Xa09RJXLnMPZqS4OxttSO9xkb4-XRMYfoCxr1n6WUIMzrDugEsX0FVT2VqmR_TSJYo580O2r9sem-sqDJf41IhX6tZFzTf_ABdfttFPzRRzm_HTmfIawLMHfybKRb62RphQyI4ZC3dzR-oPupKmmpSF67c0V5bDc0P60VNQ/w330-h640/Screenshot_2022_0331_185556.png&quot; title=&quot;Flutter Login Design | Flutter UI&quot; width=&quot;330&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://codeswithsunny.blogspot.com/2022/03/flutter-login-design-flutter-ui-sweet.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiotKo1TZI27ORgcRUfUEDXbgvWtb-W1AOMfxOumsYbTKWlQ2mgUlEz4bJePDQFYlVUfCDGYVtrAy9UEMAPZ8oMNYCnovAyjkEIwmaHZJ-5S121pYuIFG_-dlESkdqGcV6aAXIY0V6L6aynAkMaD9gOdIXzb3hkEyGRc46MtoHOJKGC7XzVjycWcDdl-g/s72-c/RPY%20(2).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-7331142689325173836</guid><pubDate>Thu, 31 Mar 2022 06:26:00 +0000</pubDate><atom:updated>2022-03-31T11:56:27.973+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">dart pattern</category><category domain="http://www.blogger.com/atom/ns#">dart pattern program</category><category domain="http://www.blogger.com/atom/ns#">Pyramid star pattern</category><category domain="http://www.blogger.com/atom/ns#">Sandglass Star Pattern</category><category domain="http://www.blogger.com/atom/ns#">star pattern</category><title>Sandglass Star Pattern in Dart</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/AVvXsEiGODWjiO-gbMaEBZ63TFX9_1NQkcMwPGEbbN9-hBhGMPJXUEtYZJmbCc9phgk0hsxtqI9PqBOC0Sxw-siixZXMoWfNg2FFmg4mWUF7JGU9kp6dS9XGuOuTzlbBxyJ8YPZoWxF0plT0CI17a_hhnPzLGNXlEbETRNil8buln-o5InigDfUx2VouGRt4Xg/s2560/RPY%20(1).png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Sandglass Star Pattern in Dart&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGODWjiO-gbMaEBZ63TFX9_1NQkcMwPGEbbN9-hBhGMPJXUEtYZJmbCc9phgk0hsxtqI9PqBOC0Sxw-siixZXMoWfNg2FFmg4mWUF7JGU9kp6dS9XGuOuTzlbBxyJ8YPZoWxF0plT0CI17a_hhnPzLGNXlEbETRNil8buln-o5InigDfUx2VouGRt4Xg/w640-h360/RPY%20(1).png&quot; title=&quot;Sandglass Star Pattern in Dart&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&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;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;dart:io&#39;;
void main() {
  int i, j, k, n = 5;

  for (i = 0; i &amp;lt;= n - 1; i++) {
    for (j = 0; j &amp;lt; i; j++) {
      stdout.write(&quot; &quot;);
    }
    for (k = i; k &amp;lt;= n - 1; k++) {
      stdout.write(&quot;*&quot; + &quot; &quot;);
    }
    stdout.writeln(&quot;&quot;);
  }
  for (i = n - 1; i &amp;gt;= 0; i--) {
    for (j = 0; j &amp;lt; i; j++) {
      stdout.write(&quot; &quot;);
    }
    for (k = i; k &amp;lt;= n - 1; k++) {
      stdout.write(&quot;*&quot; + &quot; &quot;);
    }
    stdout.writeln(&quot;&quot;);
  }
}
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt; &lt;br /&gt;&lt;h1 style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/h1&gt; &lt;pre&gt;&lt;code&gt;
                                       *   *   *   *   * 
                                         *   *   *   * 
                                           *   *   * 
                                             *   * 
                                               * 
                                             *   * 
                                           *   *   * 
                                         *   *   *   * 
                                       *   *   *   *    *
&lt;/code&gt;&lt;/pre&gt;</description><link>https://codeswithsunny.blogspot.com/2022/03/sandglass-star-pattern-in-dart.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGODWjiO-gbMaEBZ63TFX9_1NQkcMwPGEbbN9-hBhGMPJXUEtYZJmbCc9phgk0hsxtqI9PqBOC0Sxw-siixZXMoWfNg2FFmg4mWUF7JGU9kp6dS9XGuOuTzlbBxyJ8YPZoWxF0plT0CI17a_hhnPzLGNXlEbETRNil8buln-o5InigDfUx2VouGRt4Xg/s72-w640-h360-c/RPY%20(1).png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-4233958696255309994</guid><pubDate>Thu, 31 Mar 2022 06:04:00 +0000</pubDate><atom:updated>2022-03-31T11:34:55.548+05:30</atom:updated><title>Reverse Pyramid Star Pattern in Dart</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/AVvXsEhCo62iFtJpdJ4UjpebxFnvkeMEgIGQtFEs8W_pcplr-fcXXusMdDIqckBbOAzIMcGjtC36UZWBfI4rgBbbVhnHnlwe3Sys_MXUr3ayOvrhx7RyCj9STKYl5fdFdDUaLx9i8UnyhvK9cDuTH26MOEyAyOVIkJgm8MrOnT7agWDJ9r91CPcalxN3PTlTSQ/s2560/RPY.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Reverse Pyramid Star Pattern in Dart&quot; border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCo62iFtJpdJ4UjpebxFnvkeMEgIGQtFEs8W_pcplr-fcXXusMdDIqckBbOAzIMcGjtC36UZWBfI4rgBbbVhnHnlwe3Sys_MXUr3ayOvrhx7RyCj9STKYl5fdFdDUaLx9i8UnyhvK9cDuTH26MOEyAyOVIkJgm8MrOnT7agWDJ9r91CPcalxN3PTlTSQ/w640-h360/RPY.png&quot; title=&quot;Reverse Pyramid Star Pattern in Dart&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&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;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;dart:io&#39;;
void main() {
  int rows = 5;
  for (int i = 0; i &amp;lt; rows; i++) {
    for (int j = 0; j &amp;lt;= i; j++) {
      stdout.write(&quot; &quot;);
    }

    for (int k = 0; k &amp;lt;= rows - 1 - i; k++) {
      stdout.write(&quot;* &quot;);
    }

    stdout.writeln();
  }
}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;b&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;


&lt;pre&gt;&lt;code&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;     &lt;span style=&quot;font-size: medium;&quot;&gt;* * * * * &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     * * * * &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     * * * &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;     * * &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;    *&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>https://codeswithsunny.blogspot.com/2022/03/reverse-pyramid-star-pattern-in-dart.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCo62iFtJpdJ4UjpebxFnvkeMEgIGQtFEs8W_pcplr-fcXXusMdDIqckBbOAzIMcGjtC36UZWBfI4rgBbbVhnHnlwe3Sys_MXUr3ayOvrhx7RyCj9STKYl5fdFdDUaLx9i8UnyhvK9cDuTH26MOEyAyOVIkJgm8MrOnT7agWDJ9r91CPcalxN3PTlTSQ/s72-w640-h360-c/RPY.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-414846908490431988.post-6824735928958093303</guid><pubDate>Thu, 31 Mar 2022 05:47:00 +0000</pubDate><atom:updated>2022-03-31T11:17:29.475+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">dart pattern</category><category domain="http://www.blogger.com/atom/ns#">dart pattern program</category><category domain="http://www.blogger.com/atom/ns#">number pattern</category><category domain="http://www.blogger.com/atom/ns#">Pyramid star pattern</category><category domain="http://www.blogger.com/atom/ns#">symbol pattern</category><title>Pyramid star pattern in Dart</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/AVvXsEjxrSWKZtSXRegP_eYtnM3rsPXn1tjM8QmaXy0clEwBnrJ-TAc-c9VnRiooJO5XJp1UbN2EhDztCO3M-QMAWOW-gQEip2a5y37X-AwmgwMd7r-FX5Fipdak1Kl2yK5e5JHApTqTHICfKRFVxJv3QWdy7Xac5CkRrsBIuejvXk2Y8KdBLZuhdzv6UXrc4Q/s2560/PY.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1440&quot; data-original-width=&quot;2560&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxrSWKZtSXRegP_eYtnM3rsPXn1tjM8QmaXy0clEwBnrJ-TAc-c9VnRiooJO5XJp1UbN2EhDztCO3M-QMAWOW-gQEip2a5y37X-AwmgwMd7r-FX5Fipdak1Kl2yK5e5JHApTqTHICfKRFVxJv3QWdy7Xac5CkRrsBIuejvXk2Y8KdBLZuhdzv6UXrc4Q/w640-h360/PY.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&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;pre&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;import &#39;dart:io&#39;;
void main() {
  int rows = 5;
  for (int i = 0; i &amp;lt; rows; i++) {
    for (int j = (rows - i); j &amp;gt; 1; j--) {
      stdout.write(&quot; &quot;);
    }
    for (int j = 0; j &amp;lt;= i; j++) {
      stdout.write(&quot;* &quot;);
    }
    stdout.writeln();
  }
}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;OUTPUT&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;pre&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;code&gt;    &lt;span style=&quot;font-size: medium;&quot;&gt;* 
   * * 
  * * * 
 * * * * 
* * * * *&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description><link>https://codeswithsunny.blogspot.com/2022/03/pyramid-star-pattern-in-dart.html</link><author>noreply@blogger.com (Sunny Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxrSWKZtSXRegP_eYtnM3rsPXn1tjM8QmaXy0clEwBnrJ-TAc-c9VnRiooJO5XJp1UbN2EhDztCO3M-QMAWOW-gQEip2a5y37X-AwmgwMd7r-FX5Fipdak1Kl2yK5e5JHApTqTHICfKRFVxJv3QWdy7Xac5CkRrsBIuejvXk2Y8KdBLZuhdzv6UXrc4Q/s72-w640-h360-c/PY.png" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>