<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Artkinx on Medium]]></title>
        <description><![CDATA[Stories by Artkinx on Medium]]></description>
        <link>https://medium.com/@smilezmo101?source=rss-24043a4bb968------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fg7s2FJcxsKnOEpr</url>
            <title>Stories by Artkinx on Medium</title>
            <link>https://medium.com/@smilezmo101?source=rss-24043a4bb968------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:58:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@smilezmo101/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Candidly Speaking]]></title>
            <link>https://medium.com/@smilezmo101/candidly-speaking-ddcc5d25da28?source=rss-24043a4bb968------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddcc5d25da28</guid>
            <category><![CDATA[reality]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[truth]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Artkinx]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 00:22:36 GMT</pubDate>
            <atom:updated>2025-10-08T01:35:29.321Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*73dfePgw6L2N0GJZ0GVICw.jpeg" /><figcaption>The developer’s journey</figcaption></figure><h3>I’ve struggled to tell my story for reasons I can’t fully explain. It’s not that I don’t want to—it just feels overwhelming. I’m in the middle of everything. I’m active on platforms like LinkedIn, and I see people post exceptional things about themselves. In a way, it haunts me. I want to write too, but I rarely get past the question: <em>Is it worth it?</em></h3><p>I’ve been a software developer for over six years now. During that time, I’ve had consistent work and steady income. Sure, I’ve been broke a few times, but there’s always been something to fall back on—and at the end of the month, there’s that sweet, sweet payday.</p><p>My passion for computers goes way back to my secondary school days. I joined the Sciences class, then switched to a Technical secondary school where I took Computer classes. No surprise, I dreaded Mondays when I was doing other jobs. I worked as a cyber café attendant, a teacher/an admin staff member for a few years. Through it all, I knew I hated what I was doing.</p><p>Then came the big break in 2019—my first real shot at something I loved but didn’t fully understand. I got the opportunity to work as a Software Developer at Cloudware Limited. My then boss gave me what felt like a 30-minute crash course on C# and .NET Core, and the next thing I knew, I was working on live projects. I haven’t stopped since.</p><p>From sleepless nights to slow mornings and countless burnouts, one thing has remained constant: I keep going. I worked at Cloudware until 2023, when it became clear I needed to move on. That same year, I joined Uniccongroup, which seemed full of promise.</p><p>At Cloudware, I mastered C# and .NET Core, and built on my early mobile development experience with Xamarin Forms, .NET MAUI, and eventually Flutter—my personal favorite. At Uniccongroup, those skills proved invaluable. C# earned me a spot on the ICT team, and Flutter helped me keep it.</p><p>Fast forward to July 2025: management decided to let go of the entire ICT team, citing financial reasons. We were told we were still staff, but the arrangement shifted from salary-based to project-based contracts. Since then, it’s been a tough ride. Each new month feels harder than the last. I’ve sent out countless applications, only to face even more rejections. I know I can do the work, but lately, those rejections have made me question that.</p><p>So here I am, deciding to write my story as it is. It may not look good right now, but one thing coding has taught me is: <em>it doesn’t need to look good to work</em>.</p><p>This isn’t the end of my story. I don’t know what tomorrow holds, but I’ll keep showing up. I’ll keep trusting God that things will eventually come through. For now, this is <em>write</em> to you later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddcc5d25da28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter + Hive = Flive Pt2]]></title>
            <link>https://medium.com/@smilezmo101/flutter-hive-flive-pt2-48e498a14886?source=rss-24043a4bb968------2</link>
            <guid isPermaLink="false">https://medium.com/p/48e498a14886</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[local-database]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Artkinx]]></dc:creator>
            <pubDate>Tue, 09 May 2023 07:52:30 GMT</pubDate>
            <atom:updated>2023-05-09T07:55:00.057Z</atom:updated>
            <content:encoded><![CDATA[<p>It is lovely getting to finish up what we began few days ago with the first part of this article <a href="https://medium.com/@smilezmo101/flutter-hive-flive-part-1-12f319b5b6e4">Flutter + Hive = Flive pt1</a>. Where we discussed the basics of using Hivedb in Flutter in a way that re-usability is really intensified (best practices). Here in the final part, we are going to go further and look into the main part which is the actual implementation for the StorageService we’ve previously created.</p><blockquote>Here is a list of of what we would cover in this article:</blockquote><blockquote>1. Add the necessary packages<br>2. Setup the Hive initialization functions<br>3. Types of Hive Boxes<br>4. Define the core Hive functions<br>5. Usage</blockquote><h3><strong>Add Necessary Packages</strong></h3><p>Looking from the previous part of this article only the Hive, Hive generation and <a href="https://pub.dev/packages/build_runner">Build runner</a> packages were added which leaves one last package out. The <a href="https://pub.dev/packages/path_provider">path_provider package</a>, to add this package simply run the following command:</p><pre>flutter pub add path_provider</pre><p>or add it directly in the project’s pubspec.yaml file. So your pubspec.yaml dependencies should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*but_IEBSFKAQgd5ncxWAYg.png" /><figcaption>pubspec.yaml Complete dependencies</figcaption></figure><blockquote>With the help of this package, it would be possible to define the folder on the device’s filesystem to store the Hivedb components. Let’s get coding.</blockquote><h3>Hive initialization</h3><p>Open the <em>storage_service.dart</em> file. The file should contain the StorageService.dart file which would look something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yO1xqR3Z6JnvgAeka-U4mQ.png" /><figcaption>storage_service.dart Basic overview image.</figcaption></figure><p>Now that we have seen how the service looks like, let us do a little recap and also explain the new additional lines of code:</p><ol><li>late List&lt;LazyBox&gt; _storage;: This line declares a private variable _storage of type List&lt;LazyBox&gt;. The late keyword indicates that the variable will be lazily initialized, meaning it will be assigned a value at a later point in the code.</li><li>static late SettingsModel sysConfig;: This line declares a static variable sysConfig of type SettingsModel. Similar to _storage, it is also marked as late and will be lazily initialized.</li><li>StorageService._internal();: This is a private constructor for the StorageService class. It&#39;s marked with an underscore (_) at the beginning, indicating that it can only be called within the class itself.</li><li>static final StorageService _instance = StorageService._internal();: This line defines a static variable _instance of type StorageService and initializes it with a new instance of StorageService using the private constructor _internal(). This is a common approach for implementing the Singleton design pattern, where only one instance of the class is allowed.</li><li>factory StorageService() =&gt; _instance;: This line defines a factory constructor for the StorageService class. A factory constructor is a special type of constructor that can return an existing instance of the class instead of always creating a new one. In this case, it returns the static _instance variable, ensuring that only a single instance of StorageService is used throughout the application.</li></ol><h3>Types of Hive Boxes</h3><p>Notice that for this implementation I am using the LazyBox option because I found this more efficient than the normal box. There are generally three types of Hive boxes which are the normal Box, LazyBox and Encrypted Box.</p><p>Normal Box:<br>This type brings makes your stored values available in its full form in that the keys and the values are processed and provided in an object all at once.</p><p>LazyBox:<br>This box provides a way to retrieve your values by only making the keys available at first and then only loading the values for the keys that are requested.</p><p>EncryptedBox:<br>This generally is a normal box but with an extra layer on top which is the encryption. This type uses a key to facilitate its encryption and decryption so even the key needs to stored in a secure manner.</p><blockquote>N.B: For the sake of this article I am using the LazyBox type because why not use some efficiency even within this small application we are building here.</blockquote><h3><strong>Core Hive Functions</strong></h3><p>The first function we would be adding here is one that would be used to get a specific value from a specific box on our List of LazyBoxes, I have chosen to call this function getValue. Open the storage_service.dart file and add the following function to the class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*ZgXBrtKIgi2ffSTOeDWBZw.png" /><figcaption>storage_service.dart getValue Function</figcaption></figure><p>Here’s a breakdown of the code:</p><ol><li>The method is defined as Future&lt;dynamic&gt; getValue({required String key, required int boxIndex}. It returns a Future that will eventually resolve to a dynamic value.</li><li>The method takes two parameters:</li></ol><ul><li>key (required): A String representing the key used to identify the value in the box.</li><li>boxIndex (required): An int representing the index of the box from which the value is retrieved.</li></ul><p>3. var data = await _storage[boxIndex].get(key); retrieves the value from the specified box using the provided key. It uses the get() method on the _storage[boxIndex] object, where _storage is likely an instance of Hive or Box that represents the Hive database. The await keyword is used to wait for the completion of this asynchronous operation, and the retrieved value is stored in the data variable.</p><p>4.return data; returns the retrieved value.</p><p>The next function that is then to be added is one that we would use to initialize the variables we previously created. I chose to call this function init, so let’s take a look at what the code implementation looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xm3GU3l3TfuoH3i4baTNIg.png" /></figure><ol><li>The function is defined as Future&lt;void&gt; init() async, indicating that it is an asynchronous function that doesn&#39;t return a value.</li><li>Inside the function, a try-catch block is used to handle any potential exceptions that may occur during the initialization process.</li><li>_storage is a variable likely declared outside this function, which is expected to hold references to the Hive boxes or storage instances.</li><li>await Future.wait([...]) is used to asynchronously open the necessary Hive box(es) or storage instances. In this case, it opens a lazy box of type SettingsModel with the name specified as StorageBoxTypes.settings.name. The await keyword is used to wait for the completion of this asynchronous operation, and the resulting storage reference(s) are stored in the _storage variable.</li><li>var checkSettings = _storage[1].containsKey(StorageBoxTypes.settings.name) checks if the Hive box at index 1 (assumed to be stored in _storage) contains a specific key, StorageBoxTypes.settings.name. This is used to determine if the settings already exist in the box or need to be initialized.</li><li>If the key does not exist (i.e., !checkSettings), the code block inside the if statement is executed:</li></ol><ul><li>sysConfig is assigned a new instance of the SettingsModel class.</li><li>Some initial values are set for sysConfig, such as currentThemeIcon and themeMode.</li><li>_storage[1].put(StorageBoxTypes.settings.name, sysConfig) stores the sysConfig object in the Hive box at index 1 with the specified key.</li></ul><p>7. If the key exists (i.e., checkSettings), the code block inside the else statement is executed:</p><ul><li>The getValue() function (defined earlier) is called to retrieve the stored SettingsModel object using the key and box index.</li><li>The retrieved object is assigned to the sysConfig variable.</li></ul><p>8. If an exception occurs during the execution of the code, it is caught in the catch block, and the error message is printed.</p><p>After adding the init function we then move to the next one that is primarily saddled with the task of creating the local storage folder that Hive would use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*mKDppLCGrrCL_Eu1K_iuqw.png" /></figure><p>Here’s a breakdown of the code:</p><ol><li>The function is marked with the async keyword, indicating that it will perform asynchronous operations.</li><li>getApplicationDocumentsDirectory() is a method provided by the path_provider package in Flutter. It retrieves the directory where the application can store its documents. The await keyword is used to wait for the completion of this asynchronous operation, and the result is stored in the variable appDocDir.</li><li>appDocDir.create(recursive: true) creates the application documents directory if it doesn&#39;t exist. The recursive parameter is set to true to create any necessary parent directories as well.</li><li>var path = &quot;${appDocDir.path}/&lt;yourdbfoldername&gt;&quot;; constructs the path where the Hive database will be stored. It uses the path property of the appDocDir variable and appends the folder name you specify (replace &lt;yourdbfoldername&gt; with the desired folder name).</li><li>Hive..init(path) initializes Hive with the specified path. The .. notation is used for method cascading, allowing multiple method calls on the same object without repeating the object name.</li><li>Hive..registerAdapter(SettingsModelAdapter()) registers an adapter for a specific data model, SettingsModel in this case. Adapters are responsible for serializing and deserializing objects to and from the database. You&#39;ll need to replace SettingsModelAdapter() with the adapter for your own data model.</li><li>await init() calls the Function we earlier created function to initialize the variables needed for our Hivedb implementation.</li></ol><p>The last of the functions needed to be created is the one that would be in charge of freeing up memory resources which I have called disposeStorage. This is the way the code implementation looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*oygH6wf-EEH7kuc2Ao08Lw.png" /><figcaption>storage_service.dart disposeStorage Function</figcaption></figure><p>Here’s an explanation of the code:</p><ol><li>The function is defined as void disposeStorage() async, indicating that it is an asynchronous function that doesn&#39;t return a value.</li><li>Inside the function, the await keyword is used to wait for the completion of the Hive.close() operation.</li><li>Hive.close() is a method provided by Hive that closes the Hive database, releasing any associated resources.</li></ol><blockquote>N.B: By calling disposeStorage(), you ensure that the Hive database is properly closed and any resources it was using are freed. It&#39;s good practice to close the database when you&#39;re finished using it to prevent potential resource leaks or conflicts.</blockquote><h3>Usage</h3><p>First thing is to open up the main.dart file and edit the main function to look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*l2ZUeXCAYLgVqdfsP5w2_A.png" /><figcaption>main.dart main function</figcaption></figure><p>Here’s an explanation of the code:</p><ol><li>The main() function is the entry point of the Flutter application.</li><li>WidgetsFlutterBinding.ensureInitialized() is called to ensure that the Flutter framework is properly initialized before proceeding with other operations.</li><li>await StorageService().create() is used to asynchronously call the create() method of the StorageService class. This method is responsible for creating the Hive database and initializing the storage. The await keyword is used to wait for the completion of this asynchronous operation.</li><li>runApp(const MyApp()) is used to run the Flutter application, where MyApp() represents the root widget of your application. You should replace MyApp() with the appropriate widget class for your application.</li></ol><blockquote>By using await StorageService().create(), the code ensures that the Hive database is created and initialized before running the Flutter application. It helps in setting up the database correctly before any other parts of the application rely on it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*dAMv0vOoATVTq9BD0o5B_Q.png" /><figcaption>change_theme.dart</figcaption></figure><p>Here’s an explanation of the code:</p><ol><li>The ChangeTheme class is defined, likely to handle theme-related functionality.</li><li>The changeTheme() method is defined within the class, which takes two parameters:</li></ol><ul><li>mode: A String representing the new theme mode.</li><li>icon: An IconData object representing the new theme icon.</li></ul><p>3. Inside the changeTheme() method, the StorageService.sysConfig.themeMode is updated with the provided mode parameter, changing the theme mode to the new value.</p><p>4. Similarly, StorageService.sysConfig.currentThemeIcon is updated with icon.codePoint.toString(), which converts the codePoint of the IconData object to a String and assigns it to currentThemeIcon. This updates the theme icon to the new value.</p><p>5. Finally, StorageService.sysConfig.save() is called asynchronously to save the changes to the Hive database. It&#39;s assumed that the sysConfig object has a save() method that handles persisting the updated values.</p><blockquote>N.B: This code sample represents a separation of concerns where the ChangeTheme class is responsible for handling theme-related operations, while the StorageService class which we have encapsulated the logic related to Hive database interaction. As a recommendation, the dispose function in the StorageService class can be called after saving the changes as seen above or can be removed depending on what is the intended action.</blockquote><h3>Conclusion</h3><p>Thus far, we have been able to implement the Hivedb implementation I frequently use as well as looked at simple use case which highlights how the major functions we created can be used. If you want to see a more complex use case then drop your requests in the comment section below. Thank you for your time and if this was helpful to you, please like and follow me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48e498a14886" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FLUTTER + HIVE = FLIVE (part 1)]]></title>
            <link>https://medium.com/@smilezmo101/flutter-hive-flive-part-1-12f319b5b6e4?source=rss-24043a4bb968------2</link>
            <guid isPermaLink="false">https://medium.com/p/12f319b5b6e4</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[hive]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[local-database]]></category>
            <dc:creator><![CDATA[Artkinx]]></dc:creator>
            <pubDate>Mon, 01 May 2023 21:19:36 GMT</pubDate>
            <atom:updated>2023-05-01T21:19:36.092Z</atom:updated>
            <content:encoded><![CDATA[<p>Flutter is a powerful framework that allows developers to create high-performance mobile applications with ease. It has gained a lot of popularity in recent years due to its ability to build apps that run on both iOS and Android devices. Flutter provides a wide range of packages that can be used to add functionalities to your apps, including the Hive package. Hive is a lightweight and fast key-value database that is optimized for mobile and web applications. In this article, we will explore how to use Hive in your Flutter app.</p><h3>THE SETUP</h3><p>To use Hive in your Flutter app, you will first need to add the Hive package to your pubspec.yaml file. Open the file and add the following code to your dependencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*fqzkueKLTXeDW8mwEXscXA.png" /><figcaption>pubspec.yaml setup for Hive package</figcaption></figure><p>Once you have added the Hive package to your dependencies, run the following command to install it:</p><pre>flutter packages get</pre><h3>Hive Box</h3><p>This where things become a lot more interesting, where we implement the STORAGE SERVICE to handle everything we would be needing to work with Hive in flutter.</p><p>First, let us talk a little about what Hive boxes mean. A Hive box is simply like a room in a multiple bedroom apartment while the Hivedb location is the apartment itself. Inside each room we can have different sections for organizing things neatly. In a nutshell, the Hive boxes are the data or content holders for a hive database. These boxes can be opened to allow for interactions with it and should also be closed after use to free up resources.</p><p>Now into my implementation. We create a sample model called SettingsModel inside a Models folder to showcase how we can make use of classes to give structure to our Hive boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4u2Y9_lhOIDcgWoIJ-iEw.png" /><figcaption>SettingsModel.dart</figcaption></figure><p>In the code above, we have defined a simple Settings model class that has two properties: themeMode and currentThemeIcon. We have also annotated the class with the @HiveType decorator, which tells Hive that this is a Hive object. The @HiveField decorator is used to define the index of each property in the box.</p><p>Then we would need to tell the build runner to generate the missing class that handles the actual communication with the Hivedb we would be creating soon. Open your pubspec.yaml again and add the build_runner package under the devdependencies which should look like the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Gc68sMNOy2bq-iC9-SW6Jw.png" /><figcaption>devdependencies in pubspec.yaml</figcaption></figure><p>Once that is done, we should then run the following command to install the package:</p><pre>flutter packages get</pre><p>Next, we need to generate the adapter for this class using the Hive generator. To do this, run the following command:</p><pre>flutter packages pub run build_runner build</pre><p>This command will generate a file named settings_model.g.dart in the lib/Models directory. This file contains the adapter for the SettingsModel class.</p><p>Now we move into the heartbeat of this implementation, the service the does the main work (StorageService).</p><p>First, create a folder called Services then create a dart file inside that folder called StorageService. This file would hold the <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwjRz7m15tT-AhXPOuwKHX-wAXEQFnoECAgQAw&amp;url=https%3A%2F%2Fwww.techopedia.com%2Fdefinition%2F15830%2Fsingleton&amp;usg=AOvVaw2HHubzGDCGN-Opj511akeI">singleton</a> implementation of our StorageService class. The class should look like the sample below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4atP1kjqLfiNvpyiXTtFg.png" /><figcaption>StorageService.dart first look</figcaption></figure><p>Looking at the above code, we see that there is an enum declared called StorageBoxTypes. This would be used the setup the boxes for each of the Hive boxes required for your project. <strong><em>N.B: The names used here should reference the name of the Hive objects intended to be used and should be meaningful.</em></strong></p><p>Then inside the StorageService class we then add the following code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fn3JCwA8nqFuLRyhJpw2CA.png" /><figcaption>StorageService.dart singleton</figcaption></figure><p>Here’s a breakdown of what’s happening:</p><ol><li>A private constructor StorageService._internal() is defined. This constructor can only be accessed within the class and is used to create an instance of the StorageService class.</li><li>A static variable _instance of type StorageService is defined and initialized with a new instance of StorageService._internal(). The static variable is private and can only be accessed within the class.</li><li>A factory constructor factory StorageService() =&gt; _instance is defined. This constructor creates a new instance of StorageService only if it doesn&#39;t exist yet, otherwise it returns the existing instance. This is achieved by returning the static _instance variable that was initialized with a new instance of StorageService in step 2.</li><li>To use the StorageService class, you can simply call StorageService() to get the instance. If an instance already exists, it will be returned, otherwise a new instance will be created.</li></ol><h3>Conclusion</h3><p>Thus far we have been able to do the following:</p><ol><li>set up Hive in our project</li><li>defined a Hive object called SettingsModel and generated the adapter class use Hive generator that depends on build_runner package</li><li>created our StorageService class</li><li>added the singleton parttern to the StorageService class</li></ol><p>Watch out for the second part where we bring in the working parts of our service to facilitate the necessary Hive operations. Thank you for reading through and see you soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12f319b5b6e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>