<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chibueze  felix</title>
    <description>The latest articles on DEV Community by Chibueze  felix (@leadpresence).</description>
    <link>https://dev.to/leadpresence</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1118240%2F0e75a99e-a1e3-482f-aba9-8c61a05f8390.jpeg</url>
      <title>DEV Community: Chibueze  felix</title>
      <link>https://dev.to/leadpresence</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leadpresence"/>
    <language>en</language>
    <item>
      <title>New Go Tools You Should Know: Level Up Your Development!</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Fri, 13 Jun 2025 08:42:07 +0000</pubDate>
      <link>https://dev.to/leadpresence/new-go-tools-you-should-know-level-up-your-development-3mm9</link>
      <guid>https://dev.to/leadpresence/new-go-tools-you-should-know-level-up-your-development-3mm9</guid>
      <description>&lt;p&gt;Hey Gophers! 👋 Ever feel like your Go toolkit could use a refresh? Today, we’re spotlighting five new (or newly updated) tools that can seriously upgrade your workflow—whether you’re building AI apps, squeezing out performance, or diving into embedded systems. Let’s jump in!&lt;/p&gt;

&lt;p&gt;1️⃣ &lt;strong&gt;redis/go-redis v9.10.0 (Vector Sets)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it is: The popular Redis client for Go, now with experimental vector set support.&lt;br&gt;
Why it’s cool: Unlock AI/ML superpowers in Redis! Store and query vector embeddings (think: semantic search, recommendation engines) without leaving your Go app.&lt;br&gt;
Simple use case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Store &amp;amp; query vectors  
client.Do(ctx, "VSET", "user_embeddings", "id123", []float32{0.1, 0.8, -0.2})  
result := client.Do(ctx, "VSEARCH", "user_embeddings", "K=5", "VECTOR", queryVector)  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ &lt;strong&gt;gorse-io/goat&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it is: A Go assembly transpiler that converts C code to Go assembly.&lt;br&gt;
Why it’s cool: Turbocharge performance-critical code by leveraging C’s optimizations (like SIMD instructions) in Go.&lt;br&gt;
Simple use case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;goat -i optimized.c -o optimized_amd64.s # Transpile C to Go assembly  

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then call it from Go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Go wrapper  
func FastMatrixMul(a, b []float64) []float64 { ... }  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ideal for: Math-heavy workloads (e.g., data processing) 🚀&lt;/p&gt;

&lt;p&gt;3️⃣ &lt;strong&gt;hybridgroup/tinygo-tkey&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it is: A library for programming the Tillitis TKey-1 (open-source USB security key) using TinyGo.&lt;br&gt;
Why it’s cool: Build ultra-secure embedded apps with Go—think hardware-backed auth or cryptographic tools.&lt;br&gt;
Simple use case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "github.com/hybridgroup/tinygo-tkey"  
func main() {  
    tkey.BlueLEDOn()  // Control hardware directly!  
    // Sign data with the key’s secure enclave  
    signature := tkey.Sign([]byte("LOCK"))  
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great for: DIY security keys or hardware-bound secrets 🔒&lt;/p&gt;

&lt;p&gt;4️⃣ &lt;strong&gt;BrownNPC/Raylib-Go-Wasm&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it is: Raylib bindings for Go + WebAssembly.&lt;br&gt;
Why it’s cool: Build 2D games or visualizations in Go and run them in the browser.&lt;br&gt;
Simple use case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import rl "github.com/BrownNPC/Raylib-Go-Wasm/raylib"  
func main() {  
    rl.InitWindow(800, 600, "Go in Browser!")  
    for !rl.WindowShouldClose() {  
        rl.DrawText("Hello, WASM!", 100, 100, 20, rl.Black)  
    }  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build: Web-based games, interactive demos, or data viz 🎮&lt;/p&gt;

&lt;p&gt;5️⃣ &lt;strong&gt;asdf-vm/asdf&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it is: A multi-language version manager (not Go-specific, but a lifesaver for Gophers).&lt;br&gt;
Why it’s cool: Switch between Go versions (or Node/Python/Ruby) per-project with one command.&lt;br&gt;
Simple use case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;asdf plugin-add golang  
asdf install golang 1.22.1  
asdf local golang 1.22.1  # Sets version for current project  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No more: go version conflicts across projects! ✨&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrapping Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These tools open doors to new domains (AI, embedded, gaming), boost performance, and simplify workflows. Try one in your next project:&lt;/p&gt;

&lt;p&gt;Store vectors with go-redis/v9 → &lt;a href="https://github.com/redis/go-redis/releases/tag/v9.10.0" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Optimize C code with goat → &lt;a href="https://github.com/gorse-io/goat" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hack hardware with tinygo-tkey → &lt;a href="https://github.com/hybridgroup/tinygo-tkey" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Build WASM games with Raylib-Go-Wasm → &lt;a href="https://github.com/BrownNPC/Raylib-Go-Wasm" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Manage versions with asdf → &lt;a href="https://github.com/asdf-vm/asdf" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go explore—and level up your 2024 code! 🚀&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Cover image via GopherCon. Tools sourced from &lt;a href="https://golangweekly.com/" rel="noopener noreferrer"&gt;Go Weekly&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;p&gt;What’s your favorite new tool? Share below! 👇&lt;/p&gt;

</description>
      <category>programming</category>
      <category>go</category>
      <category>tooling</category>
      <category>ai</category>
    </item>
    <item>
      <title>Get Better at Golang with these hacks..!!!!!</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Mon, 07 Apr 2025 09:41:33 +0000</pubDate>
      <link>https://dev.to/leadpresence/get-better-at-golang-with-these-hacks-466g</link>
      <guid>https://dev.to/leadpresence/get-better-at-golang-with-these-hacks-466g</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/mattyedwards/boost-your-golang-development-efficiency-with-these-tools-3iai" class="crayons-story__hidden-navigation-link"&gt;Boost Your Golang Development Efficiency with These Tools&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/mattyedwards" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2974883%2F88c8396e-f893-44fe-b7fe-c3f7727605f3.png" alt="mattyedwards profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/mattyedwards" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Matty
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Matty
                
              
              &lt;div id="story-author-preview-content-2361951" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/mattyedwards" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2974883%2F88c8396e-f893-44fe-b7fe-c3f7727605f3.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Matty&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/mattyedwards/boost-your-golang-development-efficiency-with-these-tools-3iai" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 28 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/mattyedwards/boost-your-golang-development-efficiency-with-these-tools-3iai" id="article-link-2361951"&gt;
          Boost Your Golang Development Efficiency with These Tools
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/mattyedwards/boost-your-golang-development-efficiency-with-these-tools-3iai" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;66&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/mattyedwards/boost-your-golang-development-efficiency-with-these-tools-3iai#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              7&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Understanding Operating System concepts</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Sun, 30 Mar 2025 20:41:58 +0000</pubDate>
      <link>https://dev.to/leadpresence/understanding-operating-system-concepts-41e9</link>
      <guid>https://dev.to/leadpresence/understanding-operating-system-concepts-41e9</guid>
      <description>&lt;p&gt;Hello Felix what do you understand by "MUTEX"?&lt;/p&gt;

&lt;p&gt;Yes, that was the question that was thrown at me on one of those interview days I had in the past, and it got me stuttering🤔.&lt;br&gt;
I honestly responded that I had not idea what that is😒. And yes, honesty is good however, every software engineer is expected to know some basic concepts; especially those that are core to the system on which most software runs - An Operating system.  &lt;/p&gt;

&lt;p&gt;The operating system is the core software of every device, it is the parent software on which other software runs; that is the most basic definition I could get for an operating  system.&lt;/p&gt;

&lt;p&gt;Being the core of every other operations that happens on a system(system here can be a server, a phone, a Payment terminal etc), it is expected that data is stored, processed and easily accessible   in the best ways possible. However, for this efficiency to be achieved by any software engineer it is expected that one understands some basic concepts related to the operating system(OS).&lt;/p&gt;

&lt;p&gt;A good understanding  of these concepts will make you a better engineer and this will be evident in what data types you utilise and in one's algorithms to access or process such data efficiently.&lt;/p&gt;

&lt;p&gt;In this article we will provide clarity to a few operating system concepts these include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stacks&lt;/li&gt;
&lt;li&gt;Heaps&lt;/li&gt;
&lt;li&gt;Threads&lt;/li&gt;
&lt;li&gt;Mutex&lt;/li&gt;
&lt;li&gt;Scheduling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please note that these are just a few OS concepts and We can not exhaust all in one article as it is intended to be as short and possible to clarify these handpicked topics 😄. Lets get to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stacks&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A stack is a last-in, first-out (LIFO) data structure that plays a key role in operating systems. Think of it like a stack of plates—adding or removing items only happens at the top. In programming, the call stack keeps track of function calls, storing return addresses and local variables. When you call a function, the OS pushes a new frame onto the stack; when the function returns, that frame gets popped off. Exceeding the allocated stack memory—often due to infinite recursion—results in a stack overflow. Stacks provide fast and predictable memory allocation, making them essential for function execution.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heaps&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Heaps are used by OS memory managers for dynamic memory allocation. Unlike stacks, heaps allow flexible allocation and deallocation, though at the cost of efficiency. When a program calls &lt;code&gt;malloc()&lt;/code&gt; or &lt;code&gt;new&lt;/code&gt;, memory is allocated from the heap. Over time, repeated allocation and deallocation can lead to fragmentation, making memory usage less efficient. To combat this, modern OSes use strategies like buddy allocation and slab allocation. A common issue with heap memory is memory leaks—when allocated memory isn’t freed, it slowly consumes system resources, potentially leading to performance degradation or crashes.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Threads&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A thread is the smallest unit of execution that an OS scheduler manages. If a process is a running program, threads are independent execution paths within that process. Since threads share the same memory space but have separate execution stacks, they enable concurrent execution without the overhead of creating new processes. OSes support kernel threads (managed by the OS) and user threads (managed by libraries like pthreads). Multithreading is crucial for taking advantage of modern multicore processors, improving responsiveness and parallelism. Since thread context switching is lighter than process switching, threads are an efficient way to handle multiple tasks concurrently.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mutex&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A mutex (short for mutual exclusion) is a synchronisation mechanism that ensures only one thread accesses a shared resource at a time. Think of it like a bathroom key—only one person can hold it at a time, and others have to wait. Mutexes prevent race conditions, where multiple threads modifying shared data simultaneously can lead to unpredictable results. However, they need to be used carefully—improper usage can lead to deadlocks (where threads are stuck waiting for each other) or priority inversion (where a low-priority thread holds up a high-priority one). Thoughtful mutex design is key to writing thread-safe concurrent programs.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheduling&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Scheduling determines how the OS assigns CPU time to threads. The goal is to balance performance, fairness, and responsiveness. Common scheduling strategies include round-robin (giving each thread a fixed time slice), priority-based (favoring higher-priority tasks), and multilevel feedback queues (dynamically adjusting priorities based on behavior). Real-time operating systems take scheduling further by guaranteeing response times for critical tasks. Every time the OS switches from one thread to another, a context switch occurs, which involves saving and restoring CPU state. Efficient scheduling is essential for ensuring smooth system performance and optimal resource utilisation.  &lt;/p&gt;

&lt;p&gt;These concepts provide basic insights into data types and the operations used in basically all Operating systems, feel free to research more on other concepts related to the OS such as Security, Memory management, Concurrency,Interrupt, Kernel.🚀🚀🚀.&lt;/p&gt;

&lt;p&gt;Thanks for your time !!!🚀🚀🚀&lt;/p&gt;

</description>
      <category>programming</category>
      <category>career</category>
      <category>go</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Embed Google Ads in Flutter Using Native Ads</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Sun, 29 Sep 2024 01:46:36 +0000</pubDate>
      <link>https://dev.to/leadpresence/embed-google-ads-in-flutter-using-native-ads-24a5</link>
      <guid>https://dev.to/leadpresence/embed-google-ads-in-flutter-using-native-ads-24a5</guid>
      <description>&lt;p&gt;While implementing this feature on an app I found the following links useful, hence i thought I should share here. You may seek some examples , however I also added a link to small application provided by the team which you can customize you to your niche idea:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/admob/android/quick-start#kotlin_3" rel="noopener noreferrer"&gt;Get Started here&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/admob/android/native" rel="noopener noreferrer"&gt;All About Native Ads&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/admob/flutter/native/platforms" rel="noopener noreferrer"&gt;Native set up for Android and iOS&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/googleads/googleads-mobile-flutter/blob/main/samples/admob/native_platform_example/lib/main.dart" rel="noopener noreferrer"&gt;Example App:&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pub.dev/packages/google_mobile_ads" rel="noopener noreferrer"&gt;Flutter Package&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for your time.&lt;/p&gt;

&lt;p&gt;Happy Hacking !!.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Managing dependencies like a pro in Android with version catalogs</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Wed, 18 Sep 2024 01:37:44 +0000</pubDate>
      <link>https://dev.to/leadpresence/managing-dependencies-like-a-pro-in-android-with-version-catalogs-54mf</link>
      <guid>https://dev.to/leadpresence/managing-dependencies-like-a-pro-in-android-with-version-catalogs-54mf</guid>
      <description>&lt;p&gt;While building multi-modular android applications it can be a painful task to manage dependencies  especially when one have to maintain project one inherited...haha, in this post we will see better ways of setting up our dependencies so they can be managed better form one single file even in large projects. &lt;br&gt;
In this article we will cover the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is version catalog&lt;/li&gt;
&lt;li&gt;Steps How to Migrate to version catalog
**&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  What is version catalog
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Before now,  how you add dependencies to your project in a modern android application it painfully like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// .....
//other codes.....
dependencies {

    implementation("androidx.core:core-ktx:1.10.1")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
    implementation("androidx.activity:activity-compose:1.7.0")
    implementation(platform("androidx.compose:compose-bom:2023.08.00"))
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.ui:ui-graphics")
    implementation("androidx.compose.ui:ui-tooling-preview")
    implementation("androidx.compose.material3:material3")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
    androidTestImplementation("androidx.compose.ui:ui-test-junit4")
    debugImplementation("androidx.compose.ui:ui-tooling")
    debugImplementation("androidx.compose.ui:ui-test-manifest")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hold on a second! imagine for a moment, you have to do this for every    build.gradle file for every module in a multi modular project say with about 20 modules; Welcome back, yes many survived it,I did, however its time consuming especially when you face managing compatibility and versions between modules. This is where version catalogs becomes a hero for saving your development time as well as future managements and dependencies upgrade, isn't that great? just have one place to look for all application dependencies.&lt;/p&gt;

&lt;p&gt;According to google developers,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Gradle version catalogs enable you to add and maintain dependencies and plugins in a scalable way. Using Gradle version catalogs makes managing dependencies and plugins easier when you have multiple modules. Instead of hardcoding dependency names and versions in individual build files and updating each entry whenever you need to upgrade a dependency, you can create a central version catalog of dependencies that various modules can reference in a type-safe way with Android Studio assistance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So basically , a version catalog file is a  TOML file that is used to manage dependencies in modern android development.&lt;/p&gt;

&lt;p&gt;The TOML file consists of 4 major sections:&lt;br&gt;
the [versions] section is used to declare versions which can be referenced by dependencies&lt;br&gt;
the [libraries] section is used to declare the aliases to coordinates&lt;br&gt;
the [bundles] section is used to declare dependency bundles&lt;br&gt;
the [plugins] section is used to declare plugins&lt;/p&gt;
&lt;h2&gt;
  
  
  Steps How to Migrate to version catalog
&lt;/h2&gt;

&lt;p&gt;For brevity, there for about six simple steps to migrate and enjoy the benefits of version catalogs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a version catalog file: In the root project gradle folder create the &lt;code&gt;libs.versions.toml&lt;/code&gt; Add these sections to it:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[versions]

[libraries]

[plugins]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Each sections hold version numbers, gradle libraries and plugins respectively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the new entry to the file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjsh57d8853bhn8ne2jn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjsh57d8853bhn8ne2jn.png" alt="Image description" width="800" height="215"&gt;&lt;/a&gt;&lt;br&gt;
Next we will add &lt;code&gt;implementation("androidx.core:core-ktx:1.10.1")&lt;/code&gt; to the newly created file, by first adding the version number then the library in the respective sections:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[versions]
ktx-version ="1.10.1"

[libraries]
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx-version" }
[plugins]
....
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sync the Android project&lt;br&gt;
Once the previous step is done rightly you may sync gradle to update the new settings of your project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replace the previous string declaration with the catalog type-safe accessor:&lt;br&gt;
Do the previous steps 2 and 3 for every new dependency you add  to the &lt;code&gt;libs.versions.toml&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the plugins to the plugins block :&lt;br&gt;
Just like the previous steps you would need to. add the version of th e plugin in the versions section but this time the dependency goes to the plugin section of the file, like so:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[versions]
ktx-version ="1.10.1"
androidGradlePlugin = "7.4.1"
//....
[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Referencing the catalog : In your build.gradle file (app) you can refer to the plugins with &lt;code&gt;alias&lt;/code&gt; ,and libraries with &lt;code&gt;implementation&lt;/code&gt; ,  see below for examples:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Top-level build.gradle.kts
plugins {
   alias(libs.plugins.android.application) apply false

}

// module build.gradle.kts
plugins {
   alias(libs.plugins.android.application)

}

dependencies {
   implementation(libs.androidx.ktx)

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you may go ahead and add more dependencies for all modules, as much as you want. Each module will reference same &lt;code&gt;libs.versions.toml&lt;/code&gt; file so no issues with incompatible versions or wrong version&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro Tip
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use alias for plugins in the version catalog aand id for plugins not in the version catalog.&lt;/li&gt;
&lt;li&gt;If you are using Gradle version below 8.1 you need to annotate the plugins{} block with @Suppress("DSL_SCOPE_VIOLATION") when using version catalogs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well done, you have read this far !! Do well to share....&lt;/p&gt;

</description>
      <category>android</category>
      <category>androiddev</category>
      <category>productivity</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Managing Flutter Versions with fvm. Let's Talk FVM 🚀</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Wed, 11 Sep 2024 05:03:35 +0000</pubDate>
      <link>https://dev.to/leadpresence/managing-flutter-versions-with-fvm-26hp</link>
      <guid>https://dev.to/leadpresence/managing-flutter-versions-with-fvm-26hp</guid>
      <description>&lt;p&gt;Suffice it to say ,nearly every flutter developer like myself has had one point or another work with projects with different flutter versions based on when such projects were first compiled or created or even by subsequent builds/updates. If one happens to work on such projects from the-same computer, there is need for you to manage the versions of flutter for which you are running thoe projects, especially if there dependencies that depends on specific version &lt;a href="https://pub.dev/packages/fvm" rel="noopener noreferrer"&gt;flutter fvm package&lt;/a&gt; is here to save the day. In this are article we will shortly explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What fvm is&lt;/li&gt;
&lt;li&gt;How to install fvm&lt;/li&gt;
&lt;li&gt;How to set fvm setup&lt;/li&gt;
&lt;li&gt;How to use fvm&lt;/li&gt;
&lt;li&gt;How to switch flutter channels&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, you've been diving deep into Flutter development, crafting beautiful UIs, and bringing your app ideas to life. But let me ask you this: have you ever found yourself in a sticky situation where one project needs Flutter 2.5, another needs 3.0, and your latest experiment demands the bleeding edge version? If you're nodding your head (or even if you're not), let me introduce you to your new best friend: Flutter Version Management, or FVM for short!&lt;/p&gt;

&lt;h2&gt;
  
  
  What's FVM and Why Should You Care?
&lt;/h2&gt;

&lt;p&gt;FVM is a simple cli to manage Flutter SDK versions per project. It support channels, releases and local cache for fast switching between versions.&lt;/p&gt;

&lt;p&gt;FVM is like having a magical Flutter toolbox that lets you switch between different Flutter versions faster than you can say "hot reload." It's a game-changer for developers like us who juggle multiple projects or just love to experiment with the latest Flutter features without breaking our stable apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with FVM
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install FVM&lt;/strong&gt;
First things first, let's get FVM on your machine. Open up your terminal and type:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   dart pub global activate fvm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like that, you've taken your first step into a larger world!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use FVM in Your Project&lt;/strong&gt;
Navigate to your Flutter project directory and run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   fvm use &amp;lt;version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the Flutter version you want. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   fvm use 3.10.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;FVM will download and set up this version for your project. Magic, right?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Switch Between Versions&lt;/strong&gt;&lt;br&gt;
Working on an older project? No problem! Just use the same command with a different version. FVM makes it as easy as changing your socks (and much more exciting).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;List Available Versions&lt;/strong&gt;&lt;br&gt;
Feeling adventurous? Check out what versions are available:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   fvm list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's like a buffet of Flutter goodness!&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro Tips for FVM Mastery
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use FVM in Your CI/CD Pipeline&lt;/strong&gt;: Ensure consistent builds across your team and CI environment. It's like giving everyone the same LEGO set to build with!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Try Flutter Beta Channels&lt;/strong&gt;: Want to live on the edge? Use FVM to experiment with beta releases without affecting your stable setup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project-Specific Settings&lt;/strong&gt;: Create a &lt;code&gt;.fvmrc&lt;/code&gt; file in your project root to specify the Flutter version. It's like leaving a note for your future self (and your teammates).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;FVM is more than just a tool; it's your ticket to a smoother, more flexible Flutter development experience. It's like having a time machine for your Flutter SDK – you can jump back and forth between versions without breaking a sweat.&lt;/p&gt;

&lt;p&gt;Remember, the goal isn't just to manage versions; it's to give you the freedom to create, experiment, and build amazing things with Flutter. So go ahead, give FVM a spin, and watch your Flutter workflow transform!&lt;/p&gt;

&lt;p&gt;Happy coding, and may your widgets always align perfectly! 🎉📱💙&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to to attach a function to a struct in Golang</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Sun, 04 Aug 2024 21:25:28 +0000</pubDate>
      <link>https://dev.to/leadpresence/how-to-to-attach-a-function-to-a-struct-in-golang-1o3o</link>
      <guid>https://dev.to/leadpresence/how-to-to-attach-a-function-to-a-struct-in-golang-1o3o</guid>
      <description>&lt;p&gt;If you are coming from other languages such as php, C# , Dart etc  you would be familiar with creating methods for classes. Usually these methods implement one action for that class. In such &lt;a href="https://en.wikipedia.org/wiki/Object-oriented_programming" rel="noopener noreferrer"&gt;OOP&lt;/a&gt; languages you create such methods in the class scope such as :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ClassName{
....
 function functionName(){
  // perform action
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In go you first create a struct then you can attach receivers to perform specific actions for the struct. For instance we have as model User to which we want it to have a method that returns the user's full name we have that as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type myUser struct{
 FirstName string
LastName string
PostalCode string
DateOfBirth time.Time
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above we just created a User type with the various attributes such as FirstName, LastName .... , we want to have a method that perform some special action for the 'myUser' type in this case just return the full name form the stated attributes FirstName,LastName.&lt;/p&gt;

&lt;p&gt;We can go n a create a receiver function fullname that returns a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func (user *myUser) fullname() (string, string){
   return user.FirstName ,user.LastName
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How can we use this? we could test this directly in the main function just to see how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func main() {

    user := myUser{
        FirstName: "Felix",
        LastName:  "chi",
    }
    fmt.Println(user.fullname())

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence we have successfully created a receiver method  for our myUser struct. The full code will loke like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "fmt"
    "time"
)

type myUser struct {
    FirstName   string
    LastName    string
    PostalCode  string
    DateOfBirth time.Time
}

func (user *myUser) fullname() (string, string) {
    return user.FirstName, user.LastName
}

func main() {

    user := myUser{
        FirstName: "Felix",
        LastName:  "chi",
    }
    fmt.Println(user.fullname())

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So whats next? go ahead and  paste code on &lt;a href="https://go.dev/play/" rel="noopener noreferrer"&gt;https://go.dev/play/&lt;/a&gt; to see how it truly works. See in your on my next post...!!!!&lt;/p&gt;

</description>
      <category>go</category>
      <category>backend</category>
    </item>
    <item>
      <title>How to add Firebase CLI to your Flutter Project- Fast Steps</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Wed, 09 Aug 2023 18:21:51 +0000</pubDate>
      <link>https://dev.to/leadpresence/how-to-add-firebase-cli-to-your-flutter-project-fast-steps-3fdj</link>
      <guid>https://dev.to/leadpresence/how-to-add-firebase-cli-to-your-flutter-project-fast-steps-3fdj</guid>
      <description>&lt;p&gt;First of all a  quick &lt;em&gt;disclaimer&lt;/em&gt; this will be quick and short as well directly targeted at macOS users.&lt;br&gt;
 What motivated me  to do this because I needed a TLDR version of doing this and it took time and various tabs to achieve. So this might help and save you some time&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create and app&lt;/strong&gt; on &lt;a href="https://console.firebase.google.com/" rel="noopener noreferrer"&gt;firebase&lt;/a&gt; enter your name of choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add firebase to your PATH&lt;/strong&gt; like so:&lt;br&gt;
   on your terminal enter &lt;code&gt;nano ~/zshrc&lt;/code&gt;&lt;br&gt;
   add this to the list &lt;code&gt;export PATH="$PATH":"$HOME/.pub-cache/bin"&lt;/code&gt; quit and save&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install firebase tool with command&lt;/strong&gt;&lt;br&gt;
   on your terminal enter &lt;code&gt;curl -sL firebase.tools | upgrade=true bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enter password(if any)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Login to firebase&lt;/strong&gt; &lt;br&gt;
 on your terminal enter &lt;code&gt;firebase login&lt;/code&gt; this open your browser and ask for access to your firebase account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Activate firebase on your app&lt;/strong&gt;. On the directory of your flutter project.&lt;br&gt;
on your terminal enter &lt;code&gt;flutter configure&lt;/code&gt;&lt;br&gt;
This configures all requirement onto your app. Confirm installation with  firebase --version &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add flutter_core package&lt;/strong&gt; to you app.&lt;/p&gt;

&lt;p&gt;Thats it. Short right?? Now you can use most firebase services such as Firebase app distribution, realtime database etc.&lt;/p&gt;

&lt;p&gt;Connect with me on &lt;a href="https://www.linkedin.com/in/chibueze-felix-ab0a0477/" rel="noopener noreferrer"&gt;linkedIn&lt;/a&gt; and &lt;a href="https://twitter.com/" rel="noopener noreferrer"&gt;twitter&lt;/a&gt; 😋&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>flutterfire</category>
      <category>macbook</category>
    </item>
    <item>
      <title>Convert Widget (a view) to image in flutter</title>
      <dc:creator>Chibueze  felix</dc:creator>
      <pubDate>Sat, 22 Jul 2023 16:29:49 +0000</pubDate>
      <link>https://dev.to/leadpresence/convert-widget-a-view-to-image-in-flutter-5bn7</link>
      <guid>https://dev.to/leadpresence/convert-widget-a-view-to-image-in-flutter-5bn7</guid>
      <description>&lt;p&gt;I get this question a lot if I am also a flutter developer and most recruiters ask me if I have equal proficiency in both, and most of the time my response to this is yes I do have equal proficiency in both and I am on the journey of adding more technologies to my stack as it relates to mobile application development.&lt;/p&gt;

&lt;p&gt;To the subject how do you convert and widget to an image programmatically? Yes, many would go for the screenshot package in pub.dev. However, I am a great advocate of having lighter applications, and I love taking full control of what a feature does even if I am using a plugin, package or library. Now the aforementioned package is awesome and allows you to take screenshots and save them as an image, how about you want to convert your widget to another file format asides from PNG or JPEG?&lt;/p&gt;

&lt;p&gt;Here I am going to show you how to convert your widget to any file format you wish and perhaps be able to share it in that format, provide you can save it to the device you work with.&lt;/p&gt;

&lt;p&gt;Now flutter is a rendering framework, that mostly works on a rendering engine. See &lt;a href="https://docs.flutter.dev/resources/architectural-overview#:~:text=On%20the%20surface%2C%20Flutter%20is,when%20the%20application%20state%20changes." rel="noopener noreferrer"&gt;here&lt;/a&gt; for more, And we can utilize the rendering service to do so much provided we can render such a view. &lt;/p&gt;

&lt;p&gt;Firstly, let's mention an important setup on the view you want to convert and I must mention that you can convert whatsoever, remember everything is a widget in flutter. Oh boy! show me some code already :)&lt;/p&gt;

&lt;p&gt;Import required services into your widget&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'dart:io';
 import 'dart:ui' as ui; 
import package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a Global key and create a nullable file(where we can save the file)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GlobalKey _yourGlobalKey = GlobalKey();
File? widgetFilePath;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wrap the widget you want to convert with the &lt;a href="https://api.flutter.dev/flutter/widgets/RepaintBoundary-class.html" rel="noopener noreferrer"&gt;RepaintBoundary&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RepaintBoundary(
key: _globalKey,
child: Container()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the container widget with any other of your choice&lt;/p&gt;

&lt;p&gt;Create the capture function that captures the wrapped widget through _yourGlobalkey  you created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Future&amp;lt;ui.Image&amp;gt; captureWidgetImage() async {
RenderRepaintBoundary boundary =_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
final image = await boundary.toImage(pixelRatio: 1.0);

return image;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have the set-up complete and create the function how can we call the &lt;code&gt;captureWidgetImage&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;Now we can actually just capture the widget but what can we do with it ? how about we save the image :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Future&amp;lt;void&amp;gt; saveImageAsPng() async {

/// TODO Check File write permission
/// you can change the format here to pdf,jpeg etc

//1 widgetFilePath = File(appDocDirectory.path + '/capturedWidget.png');

//2
if(mounted){

//3 ui.Image image = await captureImage();

//4 ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
//5 if (byteData != null) {

//6 final buffer = byteData.buffer.asUint8List();

//7 await widgetFilePath?.writeAsBytes(buffer);
}

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the save saveImageAsPng and captureWidgetImage&lt;br&gt;
You can use these functions by calling saveImageAsPng() in say a button click when you do this&lt;br&gt;
i. A widgetFilePath file u created initially is then initialised and assigned a path and a name.&lt;br&gt;
ii. In #2 You check if the widget is still in the tree and not disposed you initialise ui.Image and call the captureImage in #3 Remember it returns an image.&lt;/p&gt;

&lt;p&gt;iii. since better work on images as bytes data in #4 we convert the to bytes with toByteData and format it into png format&lt;br&gt;
iv. In #5 we check we actually have an image and then in #6 we convert these bytes to a usable list asUint8List and write the parts of this list to the file we created initially.&lt;/p&gt;

&lt;p&gt;Thats it....!&lt;br&gt;
Where to go next!!!!&lt;br&gt;
You can share images and save them in your gallery or show users in a pop, a very good use case is to show or share qr images, show or share receipts etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/leadpresence/c6fedb74490caa2435d63e60ac9d531f" rel="noopener noreferrer"&gt;Here&lt;/a&gt; is a GitHub gist of more code 👨‍💻&lt;/p&gt;

&lt;p&gt;Thanks for reading this far, until next time, you reach out to me on &lt;a href="https://www.linkedin.com/in/chibueze-felix-ab0a0477/" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt;, happy hacking👨‍💻 !!!&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
