<?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 Sephikhar Varid H on Medium]]></title>
        <description><![CDATA[Stories by Sephikhar Varid H on Medium]]></description>
        <link>https://medium.com/@sevikhar?source=rss-4a7186966f71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*v84PtNBLzvKDuxs4.jpg</url>
            <title>Stories by Sephikhar Varid H on Medium</title>
            <link>https://medium.com/@sevikhar?source=rss-4a7186966f71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 16:36:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sevikhar/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[Mobile Apps Stability Improvement Using Firebase Performance and Crashlytics in Flutter]]></title>
            <link>https://medium.com/@sevikhar/mobile-apps-stability-improvement-using-firebase-performance-and-crashlytics-in-flutter-b2be2078ab55?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2be2078ab55</guid>
            <category><![CDATA[crashlytics]]></category>
            <category><![CDATA[stability]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 05:31:07 GMT</pubDate>
            <atom:updated>2023-06-12T05:31:07.419Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6g6zrCj3LnMlJfni.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s5lUbq98byx1f-9u0kjRLA.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>Stability is a key factor in the success of mobile apps. Users expect reliable and smooth performance, and any crashes or performance issues can significantly impact user satisfaction. In Flutter, developers have access to powerful tools provided by Firebase to monitor and improve app stability. In this article, we will explore how Firebase Performance and Firebase Crashlytics can be leveraged to enhance stability in mobile apps, ensuring a seamless user experience.</p><ul><li><strong>Importance of Stability in Mobile Apps</strong>: Mobile app stability plays a crucial role in user engagement and retention. Apps that crash frequently or suffer from performance issues can lead to user frustration and negative reviews, ultimately resulting in user abandonment. By prioritizing stability, developers can build trust with their users, encourage app usage, and boost overall app success.</li><li><strong>Firebase Performance Monitoring</strong>: Firebase Performance Monitoring provides real-time insights into the performance of your app. It enables developers to identify performance bottlenecks and optimize critical areas. Key features of Firebase Performance Monitoring include:</li></ul><p>a. Performance Metrics: Track key metrics like app startup time, network. latency, and screen rendering time to identify areas for improvement.</p><p>b. Traces: Monitor custom traces to gain visibility into specific actions or events within the app, such as network requests or database operations.</p><p>c. Network Request Monitoring: Analyze network requests made by the app to identify slow or failed requests and optimize network performance.</p><p>d. Real User Monitoring: Capture performance data from actual users, allowing developers to understand how the app performs in different scenarios and on various devices.</p><ul><li><strong>Firebase Crashlytics</strong>: Firebase Crashlytics is a powerful tool for monitoring and analyzing app crashes. It helps identify the root causes of crashes and provides actionable insights to fix them. Key features of Firebase Crashlytics include:</li></ul><p>a. Real-time Crash Reporting: Receive immediate crash reports with detailed stack traces, device information, and contextual data to quickly diagnose and address issues.</p><p>b. Crash Prioritization: Prioritize and focus on the most critical crashes impacting users based on the frequency and impact of each crash.</p><p>c. Stability Analytics: Gain insights into crash trends, including the number of affected users, the percentage of crashes, and the stability of specific app versions.</p><p>d. Issue Resolution Workflow: Collaborate with team members by assigning, tracking, and resolving issues directly within the Firebase Crashlytics dashboard.</p><ul><li><strong>Implementation of Firebase Performance and Firebase Crashlytics</strong>: Integrating Firebase Performance and Firebase Crashlytics into your Flutter app is a straightforward process. It involves adding the necessary dependencies to your project, initializing the Firebase services, and instrumenting the app to capture performance data and crash reports.</li><li><strong>Continuous Monitoring and Iterative Improvement</strong>: Improving app stability is an ongoing process. Regularly monitor performance metrics and crash reports provided by Firebase Performance and Firebase Crashlytics. Analyze the data, identify patterns, and address issues promptly. Continuously optimize your app to ensure stability enhancements with each release and update.</li></ul><h3>Conclusion</h3><p>Enhancing the stability of mobile apps is crucial for providing an exceptional user experience. By leveraging Firebase Performance and Firebase Crashlytics in Flutter, developers can monitor and optimize app performance, identify crashes, and resolve issues promptly. Prioritizing stability and actively monitoring app performance and crashes can lead to increased user satisfaction, higher retention rates, and the overall success of mobile apps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2be2078ab55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing Error Handling in Programming: Dartz vs. Try-Catch]]></title>
            <link>https://medium.com/@sevikhar/comparing-error-handling-in-programming-dartz-vs-try-catch-df34f8c9eb33?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/df34f8c9eb33</guid>
            <category><![CDATA[dartz]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[try-catch]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 04:03:12 GMT</pubDate>
            <atom:updated>2023-06-12T04:03:12.084Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fiUtKP_o9h5YDgOqtZLHSQ.png" /></figure><h3>Introduction</h3><p>Error handling is an essential aspect of programming, ensuring that our applications can gracefully handle and recover from unexpected issues. In Flutter, developers have multiple options for handling errors, including libraries like Dartz and language constructs like Try-Catch. In this article, we will explore and compare the error handling capabilities of Dartz and Try-Catch in the context of Flutter development.</p><ul><li><strong>Understanding Try-Catch</strong>: Try-Catch is a fundamental error handling mechanism provided by the Dart language. It allows developers to encapsulate a block of code that might throw an exception within a “try” block. If an exception is thrown within the try block, it can be caught and handled in a “catch” block. The catch block provides an opportunity to handle the exception, log the error, or take appropriate recovery actions.</li><li><strong>Introducing Dartz</strong>: Dartz is a powerful functional programming library for Dart that provides additional error handling mechanisms. It introduces concepts such as Either and Option, which offer a more structured and expressive way to handle errors. Dartz promotes a functional programming style that encourages immutability and declarative error handling.</li><li><strong>Error Handling with Try-Catch</strong>: Try-Catch is relatively straightforward to use in Flutter. Developers can wrap a potentially error-prone code segment with a try block and handle the exception(s) in the corresponding catch block. This approach is suitable for handling synchronous exceptions and provides flexibility in deciding how to handle different types of errors. However, it can become cumbersome when dealing with complex asynchronous operations or multiple possible error scenarios.</li><li><strong>Error Handling with Dartz</strong>: Dartz introduces the concept of Either, which represents a value that can be either a success or a failure. Instead of throwing exceptions, Dartz allows developers to return an Either type from a function, where the left side represents a failure and the right side represents a success. This approach forces developers to explicitly handle potential errors and provides better type safety and compile-time checks.</li><li><strong>Benefits and Trade-offs</strong>: Try-Catch is the standard error handling mechanism in Dart and provides a simple and familiar approach for developers. It works well for synchronous code and provides flexibility in error handling. However, it lacks the type safety and composability provided by Dartz. On the other hand, Dartz’s functional programming approach with Either and Option offers better clarity, more robust error handling, and improved code organization. However, it may require a learning curve and can be perceived as overkill for small projects.</li><li><strong>Use Cases and Recommendations</strong>: Try-Catch is suitable for quick prototyping, small projects, or scenarios where simplicity and familiarity are essential. Dartz shines in larger applications, complex asynchronous operations, and scenarios where precise error handling and functional programming principles are desired. Developers should consider the project’s size, complexity, and team’s familiarity with functional programming when choosing between Try-Catch and Dartz.</li></ul><p>Here’s an example that demonstrates error handling using both Try-Catch and Dartz in Flutter:</p><pre>// Using Try-Catch for error handling<br>void divideNumbersTryCatch(int a, int b) {<br>  try {<br>    double result = a / b;<br>    print(&quot;Result: $result&quot;);<br>  } catch (e) {<br>    print(&quot;Error occurred: $e&quot;);<br>  }<br>}<br><br>// Using Dartz for error handling<br>import &#39;package:dartz/dartz.dart&#39;;<br><br>Either&lt;String, double&gt; divideNumbersDartz(int a, int b) {<br>  if (b == 0) {<br>    return left(&quot;Cannot divide by zero&quot;);<br>  } else {<br>    double result = a / b;<br>    return right(result);<br>  }<br>}<br><br>void main() {<br>  // Try-Catch example<br>  divideNumbersTryCatch(10, 2); // Output: Result: 5.0<br>  divideNumbersTryCatch(10, 0); // Output: Error occurred: IntegerDivisionByZeroException<br><br>  // Dartz example<br>  final result1 = divideNumbersDartz(10, 2);<br>  result1.fold(<br>    (error) =&gt; print(&quot;Error occurred: $error&quot;),<br>    (result) =&gt; print(&quot;Result: $result&quot;),<br>  ); // Output: Result: 5.0<br><br>  final result2 = divideNumbersDartz(10, 0);<br>  result2.fold(<br>    (error) =&gt; print(&quot;Error occurred: $error&quot;),<br>    (result) =&gt; print(&quot;Result: $result&quot;),<br>  ); // Output: Error occurred: Cannot divide by zero<br>}</pre><p>In this example, we have two functions: divideNumbersTryCatch and divideNumbersDartz. The divideNumbersTryCatch function uses Try-Catch to handle errors when dividing two numbers. If an error occurs (such as dividing by zero), it catches the exception and prints an error message. On the other hand, the divideNumbersDartz function uses Dartz&#39;s Either type to represent the result. It returns an Either&lt;String, double&gt;, where the left side represents an error message, and the right side represents the result. The fold method is used to handle the error or the successful result.</p><p>In the main function, we demonstrate both error handling approaches. We call the divideNumbersTryCatch function with valid and invalid inputs, and it prints the result or the error message using Try-Catch. Similarly, we call the divideNumbersDartz function with valid and invalid inputs, and it uses the fold method to handle the error or the result, providing more structured error handling using Dartz.</p><p>This example showcases how both Try-Catch and Dartz can be used for error handling in Flutter, with Try-Catch providing a more traditional approach and Dartz offering a functional programming-based solution with explicit error handling.</p><h3>Conclusion</h3><p>Error handling is a critical aspect of software development, ensuring our applications handle errors gracefully. In Flutter, developers have the choice between using Try-Catch, the standard language construct, or adopting libraries like Dartz. While Try-Catch provides a simple and flexible approach, Dartz offers a more structured and expressive error handling mechanism. Choosing the right approach depends on the project’s requirements, complexity, and team’s familiarity with functional programming concepts. Whichever option you choose, it’s crucial to handle errors effectively to ensure the stability and reliability of your Flutter applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df34f8c9eb33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying Monorepo Dependency Management with Melos: A Step-by-Step Guide — Part 2]]></title>
            <link>https://medium.com/@sevikhar/simplifying-monorepo-dependency-management-with-melos-a-step-by-step-guide-part-2-e0b82125f08b?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0b82125f08b</guid>
            <category><![CDATA[dependency-management]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 03:48:18 GMT</pubDate>
            <atom:updated>2023-06-09T03:48:18.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>Simplifying Monorepo Dependency Management with Melos: A Step-by-Step Guide — Part 2</h3><p>Previously, we have covered the topic of Installing Dependencies. Now, we will continue with the following discussions:</p><blockquote>Building Packages</blockquote><blockquote>Running Scripts Across Packages</blockquote><blockquote>Publishing Packages</blockquote><p><strong><em>Building Packages</em></strong></p><p>Once you have defined your packages and their dependencies, the next step is to build them. Building packages involves compiling the source code and generating the output artifacts, such as libraries or executables.</p><p>Melos provides a convenient command to build all the packages in your monorepo. Simply run the following command from the root directory of your monorepo:</p><pre>melos run build</pre><p>This command will execute the build script defined in each package’s melos.yaml configuration file. The build script typically includes instructions for compiling the code, running tests, and generating the desired artifacts.</p><p>By running the build command, Melos ensures that all the packages are built consistently and in the correct order based on their dependencies. It saves you from manually navigating to each package directory and running individual build commands.</p><p>During the build process, Melos will display the output of each package’s build script, allowing you to monitor the progress and identify any errors or warnings. Once the build process is complete, you will have the built artifacts ready for further testing or deployment.</p><p>It’s worth noting that Melos provides additional options and flags to customize the build process. You can specify specific packages to build, exclude certain packages, or enable verbose output for more detailed information.</p><p>Building packages with Melos simplifies the build management in a monorepo, ensuring a consistent and efficient process across multiple packages. It streamlines the development workflow and reduces the manual effort required for building and managing dependencies.</p><p><strong><em>Running Scripts Across Packages</em></strong></p><p>Melos allows you to define and execute scripts that run across multiple packages in your monorepo. This feature is particularly useful when you need to perform common tasks or run custom commands that involve multiple packages simultaneously.</p><p>To define a script that runs across packages, you can add a scripts section to your melos.yaml configuration file. In this section, you can define various scripts and their corresponding commands. Here&#39;s an example:</p><pre>scripts:<br>  lint:<br>    command: flutter analyze .<br>  test:<br>    command: flutter test</pre><p>In the above example, we have defined two scripts: lint and test. The lint script runs the command flutter analyze . which performs code analysis across all packages. The test script runs the command flutter test to execute tests across all packages.</p><p>To execute these scripts using Melos, you can run the following command:</p><pre>melos run &lt;script-name&gt;</pre><p>For example, to run the lint script, you would run:</p><pre>melos run lint</pre><p>This command will execute the corresponding command defined in the script section of your melos.yaml file for all the packages in your monorepo.</p><p>Running scripts across packages with Melos provides a centralized and consistent way to execute common tasks or custom commands. It eliminates the need to manually navigate to each package and run individual commands. This not only saves time but also ensures that the scripts are executed uniformly across all packages.</p><p>You can define as many scripts as needed in your melos.yaml file, tailoring them to your specific project requirements. Melos also supports passing arguments to scripts, allowing you to further customize their behavior based on your needs.</p><p>In the next section, we will discuss how to publish packages using Melos.</p><p><strong><em>Publishing Packages</em></strong></p><p>Melos provides convenient commands to simplify the process of publishing packages within your monorepo. Publishing packages allows you to share your code with others or make it available for consumption in other projects.</p><p>To publish packages using Melos, follow these steps:</p><ul><li>Ensure that your packages are properly configured for publishing. This typically involves setting the appropriate version numbers and updating any necessary metadata in your package’s pubspec.yaml file.</li><li>Run the following command to publish all packages in your monorepo:</li></ul><pre>melos publish</pre><p>This command will iterate through each package in your monorepo and publish them individually to the designated package repository (such as Pub.dev for Dart/Flutter packages).</p><p>Alternatively, you can use the --only-changed flag to only publish packages that have changes since the last publication:</p><pre>melos publish --only-changed</pre><p>This can be useful when you have a large number of packages and want to avoid unnecessary publication of packages that haven’t been modified.</p><ul><li>Melos will prompt you to confirm the publication for each package. Review the information displayed, such as the package version, and confirm the publication when prompted.</li></ul><blockquote>Note: Make sure you have the necessary credentials and permissions to publish packages to your designated package repository.</blockquote><ul><li>Melos will handle the publishing process for each package, including uploading the package files and updating the package repository with the latest version.</li></ul><p>Once the publishing process is complete, your packages will be available for consumption by others.</p><p>Publishing packages with Melos simplifies the process and ensures consistency across all packages in your monorepo. It streamlines the steps required to publish packages individually and eliminates the need to navigate to each package separately.</p><p>It’s important to note that before publishing packages, you should carefully consider versioning and follow semantic versioning practices to maintain compatibility and provide clear versioning information to users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0b82125f08b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying Monorepo Dependency Management with Melos: A Step-by-Step Guide — Part 1]]></title>
            <link>https://medium.com/@sevikhar/simplifying-monorepo-dependency-management-with-melos-a-step-by-step-guide-part-1-19be8363184?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/19be8363184</guid>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dependency-management]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 03:14:57 GMT</pubDate>
            <atom:updated>2023-06-09T03:48:57.148Z</atom:updated>
            <content:encoded><![CDATA[<h3>Simplifying Monorepo Dependency Management with Melos: A Step-by-Step Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*VewGgzzR6PNVyH2HU-cpwg.png" /><figcaption>Melos icon</figcaption></figure><h3><strong>Introduction</strong></h3><p>Managing dependencies in a monorepo can be a daunting task, especially when dealing with multiple packages and their interdependencies. Thankfully, there’s a powerful tool called Melos that simplifies this process and helps streamline your monorepo development workflow. In this step-by-step guide, we will explore how to set up and leverage Melos for efficient monorepo dependency management.</p><p><strong><em>Table of Contents:</em></strong></p><ul><li>What is Melos?</li><li>Benefits of Using Melos for Monorepo Dependency Management</li><li>Setting up Melos</li><li>Creating Packages and Defining Dependencies</li><li>Installing Dependencies</li><li>Building Packages</li><li>Running Scripts Across Packages</li><li>Publishing Packages</li></ul><p><strong><em>What is Melos ?</em></strong></p><p>Melos is a powerful dependency management tool specifically designed for monorepo projects. It simplifies the management of dependencies and workflows within a monorepo, allowing you to effectively develop and maintain multiple packages or modules within a single codebase.</p><p><strong><em>Benefits of Using Melos for Monorepo Dependency Management</em></strong></p><p>Using Melos for monorepo dependency management offers several benefits:</p><ol><li><strong>Simplified Dependency Management</strong>: Melos streamlines the management of dependencies within a monorepo. It handles the resolution of interdependencies between packages, ensuring that each package has the correct versions of its dependencies. This simplifies the process of managing and updating dependencies, reducing potential conflicts and compatibility issues.</li><li><strong>Efficient Code Sharing: With Melos</strong>, you can easily share code and reuse packages across different modules within your monorepo. This promotes code consistency, eliminates redundant code, and encourages modular development practices. It allows teams to collaborate more effectively and ensures that changes in shared code propagate seamlessly across packages.</li><li><strong>Improved Development Workflow</strong>: Melos optimizes the development workflow in a monorepo. It supports incremental builds, meaning it only rebuilds the packages that have changed or are affected by changes. This significantly reduces build times and speeds up the development process, especially in large-scale projects.</li><li><strong>Consistent Testing and Quality Assurance</strong>: Melos enables consistent testing and quality assurance practices across packages in a monorepo. It allows you to define and run scripts or workflows that can execute tests, perform linting, or run other quality checks across multiple packages. This ensures consistent code quality and helps identify issues early in the development cycle.</li><li><strong>Streamlined Publishing and Versioning</strong>: Melos provides a seamless publishing and versioning workflow for your packages. It offers version management and tagging capabilities, making it easy to release and publish packages to package registries like npm. This ensures controlled releases and simplifies the process of sharing your packages with the broader development community.</li><li><strong>Enhanced Collaboration and Code Reusability</strong>: Melos promotes collaboration and code reusability within a monorepo. It allows teams to work on different packages simultaneously while maintaining a unified codebase. Developers can share and reuse code across packages, reducing duplication and improving overall code organization. This facilitates better collaboration and knowledge sharing among team members.</li></ol><p>Overall, using Melos for monorepo dependency management enhances productivity, simplifies workflows, promotes code consistency, and enables efficient collaboration. It provides a robust foundation for managing complex projects with multiple interdependent packages within a single codebase.</p><p><strong><em>Setting up Melos</em></strong></p><p>Install Melos as a <a href="https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path"><strong>global package</strong></a> via <a href="https://pub.dev/"><strong>pub.dev</strong></a> so it can be used from anywhere on your system:</p><pre>dart pub global activate melos</pre><p>Different Melos workspaces might use different versions of Melos. To ensure everyone working in the workspace (as well as CI jobs) is using the same version of Melos, a dependency on the melos package has to be added to the pubspec.yaml file at the workspace root directory. The globally installed version of Melos will switch to the version specified in the pubspec.yaml file, if both versions are not the same.</p><p>Next create a melos.yaml file at the repository root. Within the melos.yaml file, add the name and packages fields:</p><pre>name: &lt;project&gt;<br><br>packages:<br>  - packages/*</pre><p>The packages list should contain paths to the individual packages within your project. Each path can be defined using the <a href="https://docs.python.org/3/library/glob.html"><strong>glob</strong></a> pattern expansion format.</p><p>Melos generates pubspec_overrides.yaml files to link local packages for development. Typically these files should be ignored by git. To ignore these files, add the following to your .gitignore file:</p><pre>pubspec_overrides.yaml</pre><p><strong><em>Creating Packages and Defining Dependencies</em></strong></p><p>When working with Melos in a monorepo, creating packages and defining dependencies is a crucial step. It allows you to modularize your codebase and manage the dependencies between different packages effectively. Here’s a detailed explanation of creating packages and defining dependencies using Melos:</p><p>1. <strong>Creating Packages</strong>: In a terminal or command prompt, navigate to the root directory of your monorepo. Use the following Melos command to create a new package:</p><pre>melos create &lt;package_name&gt;</pre><p>Replace `&lt;package_name&gt;` with the desired name for your package. Melos will generate a new directory for the package, including the necessary files and folder structure.</p><p>2. <strong>Defining Package Dependencies</strong>: Open the `pubspec.yaml` file in the newly created package directory. This file is used to specify the dependencies required for the package. Use the `dependencies` section to list the dependencies that the package relies on. For example:</p><pre>dependencies:<br>   package1: ^1.0.0<br>   package2: ^2.0.0<br>   flutter:<br>     sdk: flutter</pre><p>In the above example, the package depends on `package1`, `package2`, and the Flutter SDK. Adjust the dependency versions based on your requirements.</p><p>3. <strong>Shared Dependencies</strong>: If there are dependencies shared across multiple packages in your monorepo, it’s recommended to define them at the root level using the `melos.yaml` file. Open the `melos.yaml` file and specify the shared dependencies under the `packages` section. For example:</p><pre>packages:<br>  package1:<br>    path: packages/package1<br>    dependencies:<br>      package2: ^2.0.0</pre><p>By defining shared dependencies at the root level, Melos ensures that all packages can access and use those dependencies without duplication.</p><p>4. <strong>Package Interdependencies</strong>: If your packages have dependencies on each other within the monorepo, you can specify them using relative paths. For example, if `package1` depends on `package2`, open `package1`’s `pubspec.yaml` file and add the following:</p><pre>dependencies:<br>  package2:<br>    path: ../package2</pre><p>This allows `package1` to use `package2` as a local dependency within the monorepo.</p><p>By creating packages and defining dependencies using Melos, you establish a structured and modular codebase. It simplifies the management of dependencies within your monorepo and ensures that each package has access to the necessary dependencies for its functionality.</p><p><strong><em>Installing Dependencies</em></strong></p><p>Once you have defined the dependencies for your packages in a Melos-managed monorepo, the next step is to install those dependencies. Melos provides a convenient way to handle the installation process. Here’s a step-by-step guide on installing dependencies using Melos:</p><p>1. <strong>Navigate to the Root Directory</strong>: Open a terminal or command prompt and navigate to the root directory of your monorepo. This is the directory where the `melos.yaml` file is located.</p><p>2. <strong>Run the Install Command</strong>: Use the following command to install the dependencies for all the packages in the monorepo:</p><pre>melos bootstrap</pre><p>This command analyzes the dependency graph of your packages and installs the required dependencies for each package.</p><p>3. <strong>Individual Package Installation</strong>: If you only want to install dependencies for a specific package, you can use the `melos bootstrap` command with the ` — scope` flag followed by the package name. For example:</p><pre>melos bootstrap - scope=package1</pre><p>This command will install dependencies for the `package1` package only.</p><p>4. <strong>Parallel Installation</strong>: By default, Melos installs dependencies in parallel, which can speed up the installation process. If you want to limit the number of parallel jobs during installation, you can use the ` — jobs` flag followed by the desired number of jobs. For example:</p><pre>melos bootstrap - jobs=4</pre><p>This command limits the number of parallel jobs to 4 during dependency installation.</p><p>5. <strong>Updating Dependencies</strong>: If you need to update the dependencies for your packages, you can run the following command:</p><pre>melos upgrade</pre><p>This command analyzes the dependency graph and updates the dependencies to their latest compatible versions based on the version constraints specified in the `pubspec.yaml` files.</p><p>By using Melos to install dependencies, you ensure that all packages within your monorepo have their required dependencies correctly installed. Melos handles the dependency resolution and installation process, making it easier to manage dependencies in a monorepo setup.</p><blockquote>Notes : The next part is created separately from the following article.</blockquote><p><a href="https://medium.com/@sevikhar/simplifying-monorepo-dependency-management-with-melos-a-step-by-step-guide-part-2-e0b82125f08b">https://medium.com/@sevikhar/simplifying-monorepo-dependency-management-with-melos-a-step-by-step-guide-part-2-e0b82125f08b</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19be8363184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Way to Create Navigation in Flutter Using AutoRoute]]></title>
            <link>https://medium.com/@sevikhar/easy-way-to-create-navigation-in-flutter-using-autoroute-3e3c58b6f544?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e3c58b6f544</guid>
            <category><![CDATA[autoroute]]></category>
            <category><![CDATA[flutter-navigation]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[route]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 14:36:37 GMT</pubDate>
            <atom:updated>2023-06-08T14:36:37.712Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Declarative routing solution for Flutter</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iu9Lm_-_XpAQ-udO3RqxGw.png" /></figure><p>In the world of Flutter app development, efficient and intuitive navigation is a crucial aspect of building a successful application.</p><p>Navigating between screens, handling routes, and passing data can sometimes be a challenging and time-consuming task. However, thanks to the powerful AutoRoute library, navigating in Flutter has become easier and more streamlined.</p><p>In this article, we will explore the “Easy Way to Create Navigation in Flutter Using AutoRoute.” AutoRoute is a code-generation library that simplifies the process of defining and managing navigation routes in your Flutter app. It provides a declarative and type-safe approach to handle routing, making it a valuable tool for developers seeking efficient navigation solutions.</p><p>Throughout this article, we will walk you through the installation process of AutoRoute, demonstrate how to define routes using annotations, and showcase various navigation techniques offered by AutoRoute. We will also cover advanced features such as passing arguments, handling nested routes, and implementing custom transitions.</p><p>By the end of this article, you will have a solid understanding of how AutoRoute can revolutionize your Flutter navigation workflow. You’ll be equipped with the knowledge and skills to leverage this library effectively, reducing boilerplate code and enhancing the overall user experience of your Flutter applications.</p><p>So, let’s dive into the world of AutoRoute and discover the easy way to create seamless and efficient navigation in Flutter!</p><p>Before we delve into the examples and best practices, let’s start by setting up AutoRoute in your Flutter project.</p><p><em>Follow these steps to get started:</em></p><ul><li>Open your pubspec.yaml file and add the following dependency:</li></ul><pre>dependencies:<br>  auto_route: ^4.0.1</pre><ul><li>Run flutter pub get in your terminal to fetch the AutoRoute package.</li><li>Create a new file named router.dart (or any other preferred name) in your project&#39;s lib directory. This file will serve as your router configuration.</li><li>Inside router.dart, import the necessary packages:</li></ul><pre>import &#39;package:auto_route/auto_route.dart&#39;;</pre><ul><li>Define a class to configure your router. Let’s name it AppRouter. This class should extend AutoRouterProvider and annotate it with @MaterialAutoRouter (or @CupertinoAutoRouter for iOS-like navigation).</li></ul><pre>@MaterialAutoRouter(<br>  replaceInRouteName: &#39;Page,Route&#39;,<br>  routes: &lt;AutoRoute&gt;[<br>    // Define your routes here<br>  ],<br>)<br>class AppRouter extends _$AppRouter {}</pre><ul><li>Don&#39;t forget to add dependency build_runner</li><li>Save the file and run the code generation command in your terminal:</li></ul><pre>flutter pub run build_runner build</pre><p>This command generates the necessary code based on your router configuration.</p><p>With AutoRoute set up in your project, you’re ready to define and utilize navigation routes efficiently.</p><h3>Defining Routes and Navigating</h3><p>AutoRoute simplifies the process of defining routes by leveraging annotations. Let’s take a look at an example:</p><pre>@MaterialRoute(page: HomePage, initial: true)<br>class AppRouter extends _$AppRouter {<br>  @MaterialRoute(fullscreenDialog: true)<br>  void somePage({required String id}) {}<br><br>  @MaterialRoute()<br>  void profilePage() {}<br>  <br>  // Add more routes here<br>}</pre><p>In this example, we defined two routes: HomePage and somePage. The @MaterialRoute annotation provides configuration options such as fullscreenDialog to customize the behavior of each route.</p><p>To navigate to a specific route, use the ExtendedNavigator provided by AutoRoute:</p><pre>ExtendedNavigator.ofRouter&lt;AppRouter&gt;().pushNamed(Routes.homePage);</pre><p>AutoRoute generates route constants based on the route names, making it type-safe and preventing typos.</p><p>Make sure to set up your project with the necessary dependencies and imports for AutoRoute to work properly.</p><p>Remember to customize the UI and functionality of each page according to your specific requirements.</p><h3>Best Practices and Solutions</h3><ol><li><strong>Passing Arguments</strong>: To pass arguments to a route, simply add them as parameters to the corresponding method in your AppRouter class. AutoRoute handles the argument serialization and passing for you.</li><li><strong>Nested Routes</strong>: AutoRoute supports nested routes by defining sub-routers. This allows you to organize your routes hierarchically and navigate within nested screens seamlessly.</li><li><strong>Custom Transitions</strong>: AutoRoute offers various transition options such as slide, fade, and scale. You can customize the transition animation for specific routes to create a visually appealing navigation experience.</li><li><strong>Guarding Routes</strong>: Use AutoRoute’s @GuardedBy annotation to implement route guards and perform pre-navigation checks, such as authentication validation or data availability.</li></ol><p>By following these best practices and utilizing the solutions provided by AutoRoute, you can build a robust and efficient navigation system for your Flutter app.</p><p>In conclusion, AutoRoute is a powerful tool that simplifies navigation in Flutter. It offers a clean and declarative way to define routes, handle navigation, and pass arguments. By reducing boilerplate code and providing type-safe routing, AutoRoute improves the overall developer experience and enhances the user experience of your apps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e3c58b6f544" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Flutter Riverpod]]></title>
            <link>https://medium.com/@sevikhar/getting-started-with-flutter-riverpod-d8210817f7d4?source=rss-4a7186966f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8210817f7d4</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[riverpod]]></category>
            <category><![CDATA[provider]]></category>
            <dc:creator><![CDATA[Sephikhar Varid H]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 04:02:51 GMT</pubDate>
            <atom:updated>2023-03-03T08:26:36.983Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Flutter State Management : Riverpod</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZpSru2aRB12MGE1J.png" /></figure><p><em>This article comes out as a tutorial for simple usage of Riverpod</em></p><p>Flutter Riverpod is a state management library used to simplify state management in Flutter applications. Riverpod is developed by Remi Rousselet, who is also a developer of Provider.</p><p>Using Riverpod is suitable for building complex Flutter applications, making it easy to manage and update state across various parts of the application. Riverpod has several advantages compared to other state management libraries, one of which is that it is easy to learn and use.</p><p>Here are the steps to get started with Riverpod in Flutter:</p><h3><strong>Install Riverpod</strong></h3><p>First, make sure that the Flutter SDK is installed on your computer. Then, open the terminal or command prompt and run the following command to install Riverpod:</p><pre>flutter pub add riverpod</pre><h3><strong>Create a Provider file</strong></h3><p>After Riverpod is installed, create a new file called my_provider.dart or any name you want. This file will be used as a place to store the application&#39;s state. Then, add the following code to the file:</p><pre>import &#39;package:riverpod/riverpod.dart&#39;;</pre><pre>final counterProvider = StateProvider&lt;int&gt;((ref) =&gt; 0);</pre><p>The code above will create a provider named counterProvider, which has a state of an integer with an initial value of 0. This provider can be accessed and used in various parts of the application.</p><h3><strong>Access the Provider</strong></h3><p>After the provider is created, we can access it in various parts of the application, such as in widgets or in methods used for updating the state. Here’s an example of how to use it in a widget:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_riverpod/flutter_riverpod.dart&#39;;<br>import &#39;my_provider.dart&#39;;</pre><pre>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: Scaffold(<br>        body: Center(<br>          child: Consumer(<br>            builder: (context, watch, _) {<br>              final counter = watch(counterProvider).state;<br>              return Text(&#39;$counter&#39;);<br>            },<br>          ),<br>        ),<br>        floatingActionButton: FloatingActionButton(<br>          onPressed: () =&gt; context.read(counterProvider).state++,<br>          child: Icon(Icons.add),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p>The code above will display a Text widget that shows the state value of the counterProvider provider. When the FloatingActionButton is pressed, the state value will increase.</p><h3><strong>Test the Provider</strong></h3><p>To test the provider, we can create a new file named my_provider_test.dart, and add the following code:</p><pre>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>import &#39;package:flutter_riverpod/flutter_riverpod.dart&#39;;<br>import &#39;my_provider.dart&#39;;</pre><pre>void main() {<br>  test(&#39;counterProvider should start at 0&#39;, () {<br>    final container = ProviderContainer();<br>    final counter = container.read(counterProvider).state;<br>    expect(counter, 0);<br>  });<br>}</pre><p>The code above will perform a test on the counterProvider provider. In this test, we ensure that the initial value of the provider&#39;s state is 0.</p><p>These are the basic steps to get started with Riverpod in Flutter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8210817f7d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>