<?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: Dipen Maharjan</title>
    <description>The latest articles on DEV Community by Dipen Maharjan (@slimpotatoboy).</description>
    <link>https://dev.to/slimpotatoboy</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%2F809201%2F2b47aa74-67a7-4121-b832-c959fcc61707.jpg</url>
      <title>DEV Community: Dipen Maharjan</title>
      <link>https://dev.to/slimpotatoboy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/slimpotatoboy"/>
    <language>en</language>
    <item>
      <title>Projects Sections in My Website</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Sat, 01 Apr 2023 12:29:50 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/projects-sections-in-my-website-2h45</link>
      <guid>https://dev.to/slimpotatoboy/projects-sections-in-my-website-2h45</guid>
      <description>&lt;p&gt;Hello friends, I have now added a projects sections on my personal website. It contains the list of projects that I have contributed. I hope to add more projects after completing it in few months. I've been working as a freelancer for past 3-4 months and it's been a hell of a journey. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gGxvdHNg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b0qmmlwi4g5qo14do1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gGxvdHNg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b0qmmlwi4g5qo14do1y.png" alt="Image description" width="880" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Website Link: &lt;a href="https://dipenmaharjan.com.np/"&gt;https://dipenmaharjan.com.np/&lt;/a&gt;&lt;br&gt;
Follow me on Twitter: &lt;a href="https://twitter.com/slimpotatoboy"&gt;https://twitter.com/slimpotatoboy&lt;/a&gt;&lt;/p&gt;

</description>
      <category>projects</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Slack Logger to Log your debug issues</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Sun, 19 Mar 2023 17:19:49 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/slack-logger-to-log-your-debug-issues-2fmn</link>
      <guid>https://dev.to/slimpotatoboy/slack-logger-to-log-your-debug-issues-2fmn</guid>
      <description>&lt;p&gt;Mobile application development is a complex process that requires constant debugging and monitoring. Logging is an essential part of this process, as it allows developers to understand the flow of the application and debug issues. Slack logger is a package that allows developers to send logs to a Slack channel, making it easier to keep track of logs and collaborate with team members. In this blog, we will explore the Slack Logger package for Flutter and its features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of Slack Logger:&lt;/strong&gt;&lt;br&gt;
 Slack Logger is an open-source package for Flutter that allows developers to send logs to a Slack channel. It is a simple and easy-to-use package that can be integrated into any Flutter project. The package uses the Slack API to send logs to a Slack channel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features of Slack Logger: &lt;/strong&gt;&lt;br&gt;
Slack Logger has several features that make it an essential tool for Flutter developers. Some of the key features of Slack Logger are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Easy integration: Slack Logger can be easily integrated into any Flutter project. The package is available on pub.dev and can be installed using pub.&lt;/li&gt;
&lt;li&gt;Customizable: Slack Logger allows developers to customize the log message format and the Slack channel to which logs are sent.&lt;/li&gt;
&lt;li&gt;Exception logging: Slack Logger can log exceptions in addition to regular log messages. When an exception occurs, Slack Logger can send the exception details to a Slack channel, making it easier to debug issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Steps before using this package:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add Apps to 🔗 &lt;a href="https://api.slack.com/apps/"&gt;https://api.slack.com/apps/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Go to Incoming Webhook Link and Enable it.&lt;/li&gt;
&lt;li&gt;Create your slack channel.&lt;/li&gt;
&lt;li&gt;Create new webhook and link slack channel.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How to use Slack Logger: &lt;/strong&gt;&lt;br&gt;
Using Slack Logger in your Flutter project is easy. First, you need to add the package to your pubspec.yaml file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  slack_logger: ^1.0.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the package is added to your pubspec.yaml file, you can import it into your Dart code and configure it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:slack_logger/slack_logger.dart';

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

  @override
  Widget build(BuildContext context) {

    SlackLogger(webhookUrl: "[Add Your Web Hook Url]");

    return MaterialApp(
      ...
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create Instance of SlackLogger:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;final slack = SlackLogger.instance; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send Message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;…
slack.send("This is a error log to my channel");
…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send Image:&lt;br&gt;
&lt;/p&gt;

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

slack.sendImage(
  imageUrl: "[image url]",
  imageAltText: "[alt text for image]",
);

...

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

&lt;/div&gt;



&lt;p&gt;Conclusion: &lt;br&gt;
Slack Logger is a powerful package for Flutter developers that allows them to send logs to a Slack channel. With its customizable log message format, level-based logging, and exception logging, Slack Logger is an essential tool for mobile application development. Whether you are debugging issues or collaborating with team members, Slack Logger makes it easy to keep track of logs and stay on top of your flutter development.&lt;br&gt;
Pub Dev: &lt;a href="https://pub.dev/packages/slack_logger"&gt;https://pub.dev/packages/slack_logger&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/slimpotatoboy/slack_logger"&gt;https://github.com/slimpotatoboy/slack_logger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚀 Contributors&lt;br&gt;
Dipen Maharjan&lt;br&gt;
Ashim Upadhaya&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to setup Flutter for App Development?</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Tue, 14 Feb 2023 16:55:52 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/how-to-setup-flutter-for-app-development-5080</link>
      <guid>https://dev.to/slimpotatoboy/how-to-setup-flutter-for-app-development-5080</guid>
      <description>&lt;p&gt;Flutter is an open-source mobile application development framework created by Google. It is used to develop high-performance mobile applications for iOS and Android, as well as web and desktop applications. Flutter is built on top of the Dart programming language and provides a rich set of features and tools to help developers build beautiful and engaging applications.&lt;br&gt;
If you are new to Flutter and want to get started with mobile app development, this blog will guide you through the process of setting up a Flutter development environment on your computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Requirements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before you start the installation process, ensure that your computer meets the following system requirements:&lt;br&gt;
Operating System: Windows 7 or later, macOS (64-bit) 10.14 or later, or Linux (64-bit)&lt;br&gt;
Disk Space: 2.8 GB (for the Flutter SDK and its dependencies)&lt;br&gt;
RAM: 4 GB or higher&lt;br&gt;
Graphics Card: Intel HD Graphics 4000 or higher (or equivalent graphics card from AMD or NVIDIA)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install Flutter SDK&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first step is to download the Flutter SDK, which includes the Flutter framework, Dart programming language, and other essential tools. Follow these steps to download the Flutter SDK:&lt;br&gt;
Go to the Flutter website at &lt;a href="https://flutter.dev/docs/get-started/install"&gt;https://flutter.dev/docs/get-started/install&lt;/a&gt; and select your operating system.&lt;br&gt;
Follow the installation instructions for your operating system.&lt;br&gt;
After the installation is complete, open your terminal or command prompt and run the command flutter doctor to check that the installation was successful.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install Android Studio or Visual Studio Code&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flutter can be used with various code editors, including Android Studio and Visual Studio Code. These editors provide a rich set of features, such as code completion, debugging, and more, to help you develop your Flutter apps. Here's how to install Android Studio or Visual Studio Code:&lt;br&gt;
Android Studio: Download Android Studio from the official website at &lt;a href="https://developer.android.com/studio"&gt;https://developer.android.com/studio&lt;/a&gt;. Follow the installation instructions for your operating system.&lt;br&gt;
Visual Studio Code: Download Visual Studio Code from the official website at &lt;a href="https://code.visualstudio.com/"&gt;https://code.visualstudio.com/&lt;/a&gt;. Follow the installation instructions for your operating system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Set up an emulator or device&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To test your Flutter apps, you will need to set up an emulator or device. An emulator is a software that simulates a mobile device, while a physical device is an actual mobile device that you can connect to your computer. Here's how to set up an emulator or device:&lt;br&gt;
Emulator: Open Android Studio and select "AVD Manager" from the "Configure" menu. Follow the instructions to create a new emulator.&lt;br&gt;
Physical device: Connect your device to your computer using a USB cable. Follow the instructions to enable developer mode and USB debugging on your device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create your first Flutter app&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that you have set up your development environment, it's time to create your first Flutter app. Follow these steps to create a new Flutter app:&lt;br&gt;
Open your code editor (Android Studio or Visual Studio Code) and create a new Flutter project.&lt;br&gt;
Run the app on your emulator or physical device.&lt;br&gt;
Edit the code and see the changes in real-time using Flutter's hot reload feature.&lt;/p&gt;

&lt;p&gt;Congratulations! You have successfully set up a Flutter development environment and created your first Flutter app.&lt;br&gt;
In conclusion, setting up a Flutter development environment is a straightforward process that requires downloading the Flutter SDK, installing a code editor, and setting up an emulator or device. With the Flutter framework and its rich set of features, you can develop high-performance, beautiful mobile apps for iOS and Android in no time.&lt;/p&gt;

&lt;p&gt;Thank You!&lt;/p&gt;

&lt;p&gt;If you haven’t watched my first youtube video:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=XwBv0Cb648I"&gt;Click here to watch&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DCTBFYub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1vovdutzgltd0cpo1oex.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DCTBFYub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1vovdutzgltd0cpo1oex.jpeg" alt="Image" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Logging your error message of your Flutter App directly into Slack Channel?</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Mon, 07 Nov 2022 11:15:56 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/logging-your-error-message-of-your-flutter-app-directly-into-slack-channel-27e5</link>
      <guid>https://dev.to/slimpotatoboy/logging-your-error-message-of-your-flutter-app-directly-into-slack-channel-27e5</guid>
      <description>&lt;p&gt;Wanna know how to log your error message in #flutter to your slack channel ?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create new App in Slack&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Go to &lt;a href="https://api.slack.com/apps"&gt;https://api.slack.com/apps&lt;/a&gt; and create a new app.&lt;/p&gt;

&lt;p&gt;Select from scratch option and in next option&lt;br&gt;
Pick your appname and pick your workspace to send messages.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Enable Incoming Webhooks&lt;br&gt;
After that, you need to enable incoming webhooks. and you will get the webhook url.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now create your flutter project or in your exisiting project&lt;br&gt;
In your terminal add this package slack_logger:&lt;br&gt;
&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;flutter pub add slack_logger
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;now in your main.dart file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    SlackLogger(webhookUrl: "[Add Your Web Hook Url]");

    return MaterialApp(
      ...
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now in your class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;final SlackLogger _slack = SlackLogger.instance;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and in your try catch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try {
  ...
} catch (e) {
  _slack.send(e.toString());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when you get your error, you'll recieve the slack message in your selected channel.&lt;br&gt;
Package Url : &lt;a href="https://pub.dev/packages/slack_logger/"&gt;https://pub.dev/packages/slack_logger/&lt;/a&gt;&lt;br&gt;
Github Url: &lt;a href="https://github.com/slimpotatoboy/slack_logger"&gt;https://github.com/slimpotatoboy/slack_logger&lt;/a&gt;&lt;br&gt;
Feel Free to request any missing features or report issues &lt;a href="https://github.com/slimpotatoboy/slack_logger/issues"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XzE_l9Fp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmmty9etl0s02o5waqwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XzE_l9Fp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmmty9etl0s02o5waqwv.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>web3</category>
      <category>mobile</category>
      <category>programming</category>
    </item>
    <item>
      <title>Top 5 Flutter Packages that you need to add to your Flutter Project RIGHT NOW.</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Fri, 04 Nov 2022 13:43:48 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/top-5-flutter-packages-that-you-need-to-add-to-your-flutter-project-right-now-5d68</link>
      <guid>https://dev.to/slimpotatoboy/top-5-flutter-packages-that-you-need-to-add-to-your-flutter-project-right-now-5d68</guid>
      <description>&lt;p&gt;&lt;a href="https://media.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%2F8o7jlo6c690jhqqv9v9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8o7jlo6c690jhqqv9v9v.png" alt="Top 5 flutter packages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Shared Preferences
&lt;/h2&gt;

&lt;p&gt;url: &lt;a href="https://pub.dev/packages/shared_preferences" rel="noopener noreferrer"&gt;https://pub.dev/packages/shared_preferences&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Shared preferences is a no-brainer plugin for flutter developers. This plugin are mostly used for saving simple data like tokens, usernames. It is simple to use shared preferences and can store multiple data types.&lt;/p&gt;

&lt;p&gt;To Write the data to shared preferences&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Obtain shared preferences.
final prefs = await SharedPreferences.getInstance();
// the first parameter is called key and second parameter is its value
// to save integer
await prefs.setInt('counter', 10);
// to save boolean
await prefs.setBool('value', true);
// to save double
await prefs.setDouble('decimal', 1.5);
// to save string
await prefs.setString('action', 'Start');
// to save list of strings
await prefs.setStringList('list', &amp;lt;String&amp;gt;['Earth', 'Moon', 'Sun']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To Read the data to shared preferences&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Try reading data from the 'counter' key. If it doesn't exist, returns null.
final int? counter = prefs.getInt('counter');
// same goes to all the other data types
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove entry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Remove data for the 'counter' key.
final success = await prefs.remove('counter');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Http
&lt;/h2&gt;

&lt;p&gt;url: &lt;a href="https://pub.dev/packages/http" rel="noopener noreferrer"&gt;https://pub.dev/packages/http&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Http package is used for making HTTP request to the api. There are many other packages to call the api but this is the official and easiest way to call the api. I use this package in all of my projects.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// import the package
import 'package:http/http.dart' as http;
// call the url 
var url = Uri.https('example.com', 'whatsit/create');
// get the response
var response = await http.post(url, body: {'name': 'doodle', 'color': 'blue'});
// get the response status code and body
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Go Router
&lt;/h2&gt;

&lt;p&gt;url: &lt;a href="https://pub.dev/packages/go_router" rel="noopener noreferrer"&gt;https://pub.dev/packages/go_router&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go Router is a declarative routing package for flutter. This mean it is a url-based navigation. It is very easy to use and better for the navigation rather than the old method.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() =&amp;gt; runApp(App());
class App extends StatelessWidget {
  App({Key? key}) : super(key: key);
@override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: _router,
      title: 'GoRouter Example',
    );
  }
final GoRouter _router = GoRouter(
    routes: &amp;lt;GoRoute&amp;gt;[
      GoRoute(
        path: '/',
        builder: (BuildContext context, GoRouterState state) {
          return ScreenA();
        },
      ),
      GoRoute(
        path: '/page1',
        builder: (BuildContext context, GoRouterState state) {
          return ScreenB();
        },
      ),
    ],
  );
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Google Fonts
&lt;/h2&gt;

&lt;p&gt;url: &lt;a href="https://pub.dev/packages/google_fonts" rel="noopener noreferrer"&gt;https://pub.dev/packages/google_fonts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you need to use different fonts in your app? Google fonts is the one package for you. It uses the fonts from fonts.google.com where you can check the fonts and try it out there before using in your app. Google fonts contains more than 1400 fonts and you can use any of those in your app right away.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:google_fonts/google_fonts.dart';
// using with default textstyle
Text(
  'This is Google Fonts',
  style: GoogleFonts.lato(),
),
// load font dynamically
Text(
  'This is Google Fonts',
  style: GoogleFonts.getFont('Lato'),
),
// using with exisiting text style
Text(
  'This is Google Fonts',
  style: GoogleFonts.lato(
    textStyle: TextStyle(color: Colors.blue, letterSpacing: .5),
  ),
),
Text(
  'This is Google Fonts',
  style: GoogleFonts.lato(textStyle: Theme.of(context).textTheme.headline4),
),
// override the fontSize, fontWeight, fontstyle
Text(
  'This is Google Fonts',
  style: GoogleFonts.lato(
    textStyle: Theme.of(context).textTheme.headline4,
    fontSize: 48,
    fontWeight: FontWeight.w700,
    fontStyle: FontStyle.italic,
  ),
),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but I prefer to use it on textTheme in main.dart which is very easy.&lt;/p&gt;

&lt;p&gt;go to your material app theme section and add this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;theme: ThemeData(
  fontFamily: "Lato",
  textTheme: GoogleFonts.latoTextTheme(),
),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Cached Network Image
&lt;/h2&gt;

&lt;p&gt;url: &lt;a href="https://pub.dev/packages/cached_network_image" rel="noopener noreferrer"&gt;https://pub.dev/packages/cached_network_image&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cache Network Image is the most useful image package which is used to show dynamic images from internet asap in your app.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CachedNetworkImage(
        imageUrl: "http://via.placeholder.com/350x150",
        placeholder: (context, url) =&amp;gt; CircularProgressIndicator(),
        errorWidget: (context, url, error) =&amp;gt; Icon(Icons.error),
     ),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank You!&lt;/p&gt;

&lt;p&gt;If you haven’t watched my first youtube video: &lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=XwBv0Cb648I" rel="noopener noreferrer"&gt;Click here to watch&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do subscribe and like the video. THANK YOU!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F5xqiqv6rvtpl6y6fdyk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F5xqiqv6rvtpl6y6fdyk6.png" alt="Thank you"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>package</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Ecommerce App | Home Page UI - Flutter Speed Code</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Fri, 04 Nov 2022 10:49:11 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/ecommerce-app-home-page-ui-flutter-speed-code-1bg2</link>
      <guid>https://dev.to/slimpotatoboy/ecommerce-app-home-page-ui-flutter-speed-code-1bg2</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wQ282SvA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg36t9p64rrv0osso5co.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wQ282SvA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg36t9p64rrv0osso5co.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A flutter ecommerce app home page UI project.&lt;/p&gt;

&lt;p&gt;Clean Flutter Ecommerce Home Page App Design.&lt;/p&gt;

&lt;p&gt;Do watch the video of flutter speed code in link down below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=XwBv0Cb648I"&gt;https://www.youtube.com/watch?v=XwBv0Cb648I&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;► Figma Design Reference&lt;br&gt;
&lt;a href="http://www.figma.com/file/GmfAihpI80eARQF9KY0hOF/Ecommerce-App-UI-Kit-(Community)?node-id=0%3A1"&gt;www.figma.com/file/GmfAihpI80eARQF9KY0hOF/Ecommerce-App-UI-Kit-(Community)?node-id=0%3A1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;► Social Media&lt;br&gt;
&lt;a href="https://www.instagram.com/flutter.pro.dev/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/slimpotatoboy"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dipenmaharjan.com.np"&gt;Website&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>GITHUB down - Problem with GITHUB - PUSH ??</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Thu, 17 Mar 2022 15:18:12 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/problem-with-github-push--4gl6</link>
      <guid>https://dev.to/slimpotatoboy/problem-with-github-push--4gl6</guid>
      <description>&lt;p&gt;&lt;a href="https://www.githubstatus.com/"&gt;CHECK STATUS&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;INTERNAL SERVER ERROR
 ! [remote rejected] master -&amp;gt; master (Internal Server Error)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Create Drawer With Title Header in Flutter</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Sun, 13 Mar 2022 17:08:35 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/create-drawer-with-title-header-in-flutter-50ok</link>
      <guid>https://dev.to/slimpotatoboy/create-drawer-with-title-header-in-flutter-50ok</guid>
      <description>&lt;h2&gt;
  
  
  Create Scaffold
&lt;/h2&gt;

&lt;p&gt;At home class, create a scaffold widget and inside that widget add drawer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scaffold(
    drawer: const CustomDrawer(),
    body: ....
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create CustomDrawer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
Widget build(BuildContext context) {
    return Drawer(
        child: ListView(
            children: [
                SizedBox(height: 80, child: 
                    child: DrawerHeader(
                        child: Image.network("url", fit: BoxFit.contain),
                    ),
                ),
                ListTile(
                    onTap: () {}
                    horizontalTitleGap: 0.0,
                    leading: Icon(Icons.add, color: Colors.black, height: 16),
                    title: Text("Add New", style: TextStyle(color: Colors.black),),
                ),
                const Divider(
                    height: 1,
                    thickness: 1,
                ),
                 const Padding(
                     padding: EdgeInsets.all(16.0),                 
                     child: Text('Header'),
                 ),
                ListTile(
                    onTap: () {}
                    horizontalTitleGap: 0.0,
                    leading: Icon(Icons.add, color: Colors.black, height: 16),
                    title: Text("Add New", style: TextStyle(color: Colors.black),),
                ),
            ]
        ),
    );
}
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow me &lt;a class="mentioned-user" href="https://dev.to/slimpotatoboy"&gt;@slimpotatoboy&lt;/a&gt; : &lt;a href="https://twitter.com/slimpotatoboy"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.instagram.com/slimpotatoboy/"&gt;Instagram&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to create QR Code Scanner in Flutter?</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Wed, 09 Mar 2022 17:20:56 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/how-to-creat-qr-code-scanner-in-flutter-21l2</link>
      <guid>https://dev.to/slimpotatoboy/how-to-creat-qr-code-scanner-in-flutter-21l2</guid>
      <description>&lt;p&gt;In this post, we'll be using package &lt;code&gt;barcode_scan2: ^4.2.0&lt;/code&gt; to scan the QR Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Package to the Pubspec.yaml
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  flutter:
    sdk: flutter
  barcode_scan2: ^4.2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Allow Access to Camera in Android and IOS
&lt;/h2&gt;

&lt;p&gt;To use the QR Scanner, we have to allow the app to access the camera phone so at first we'll add the code to Android and IOS Folder,&lt;/p&gt;

&lt;p&gt;go to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;path: android/app/src/main/AndroidManifest.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and Add this line of code before application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
&amp;lt;uses-permission android:name="android.permission.CAMERA" /&amp;gt;
&amp;lt;application ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and Save.&lt;/p&gt;

&lt;p&gt;Incase you get the multidex error&lt;br&gt;
please add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;path: android/app/src/build.gradle
---------------
defaultConfig {
  ....
  multiDexEnabled true
}

...
...
...

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Now Moving on to the IOS Part
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;path: ios/Runner/Info.plist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add these code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dict&amp;gt;
    &amp;lt;key&amp;gt;NSCameraUsageDescription&amp;lt;/key&amp;gt;
    &amp;lt;string&amp;gt;Camera permission is required for barcode scanning.&amp;lt;/string&amp;gt;
&amp;lt;/dict&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create QR Code Dart
&lt;/h2&gt;

&lt;p&gt;Once you have done that, now create a QRScannerScreen.dart file and add a button in the container or center&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TextButton(
    child: Text("Scan Now"),
    onPressed: (){
        var result = await BarcodeScanner.scan(); //barcode scanner         
        print(result.type);  // The result type (barcode, cancelled, failed)
        print(result.rawContent); // The barcode content
        print(result.format); // The barcode format (as enum)
        print(result.formatNote);
    }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use Barcode: &lt;a href="https://pub.dev/packages/barcode_scan2"&gt;BarCode Scan 2&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tools I use daily to code!</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Mon, 07 Mar 2022 14:12:49 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/tools-i-use-daily-to-code-1gp1</link>
      <guid>https://dev.to/slimpotatoboy/tools-i-use-daily-to-code-1gp1</guid>
      <description>&lt;p&gt;&lt;a href="https://media.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%2Fogflls3wyc64kmbryf2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fogflls3wyc64kmbryf2m.png" alt="Vs Code"&gt;&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;1. VS Code - For code editing of Flutter, 
react, html, css, php and many more
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fdtlxqiad714zvo7ucwq5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdtlxqiad714zvo7ucwq5.png" alt="Clock"&gt;&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;2. Clock - To manage time for coding and break set timer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F311zrreh7rmb60lngcgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F311zrreh7rmb60lngcgr.png" alt="Terminal"&gt;&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;3. Terminal - command line for everything 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fnkfionyceey2p8khu5ow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnkfionyceey2p8khu5ow.png" alt="Notion"&gt;&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;4. Notion and google sheet - to make daily task and 
Scrum also list out problems and questionaries

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fj8ahzlg5ht5dnupi4lv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fj8ahzlg5ht5dnupi4lv5.png" alt="Google"&gt;&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;5. Google - finally google - ( Teacher ) Ask anything 
you don't know, you'll get the answers to 
all of your questions.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tools</category>
      <category>programming</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to send data query to the route in NEXT.Js</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Sun, 06 Mar 2022 18:12:14 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/how-to-send-data-query-to-the-route-in-nextjs-o1g</link>
      <guid>https://dev.to/slimpotatoboy/how-to-send-data-query-to-the-route-in-nextjs-o1g</guid>
      <description>&lt;p&gt;It's very simple to pass the data query to the route in NExt.js &lt;/p&gt;

&lt;p&gt;At first you need to initialize it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const router = useRouter();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and import from next/router&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useRouter } from "next/router";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can use it like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;router.push({
 pathname: "/list",
 query: { search: "support" },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following code results to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000/list?search=support
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pass multiple queries
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;router.push({
 pathname: "/list",
 query: { search: "support", limit: 10 },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This results to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000/list?search=support&amp;amp;limit=10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can pass multiple parameters as well might be integer, string, boolean.&lt;/p&gt;

&lt;p&gt;you can pass dynamic data as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic pass route
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var searchData = "elonmusk";
var limitData = 15; 
router.push({
 pathname: "/list",
 query: { search: searchData, limit: limitData },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This results to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000/list?search=elonmusk&amp;amp;limit=15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow me @&lt;a href="https://twitter.com/slimpotatoboy"&gt;slimpotatoboy&lt;/a&gt; at twitter&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to use PAGINATION on React</title>
      <dc:creator>Dipen Maharjan</dc:creator>
      <pubDate>Sun, 06 Mar 2022 18:04:03 +0000</pubDate>
      <link>https://dev.to/slimpotatoboy/how-to-use-pagination-on-react-4nlf</link>
      <guid>https://dev.to/slimpotatoboy/how-to-use-pagination-on-react-4nlf</guid>
      <description>&lt;p&gt;To use pagination on the react app, there is this npm package called  &lt;a href="https://www.npmjs.com/package/react-js-pagination"&gt;react-js-pagination&lt;/a&gt; which is very easy to use and effective as well.&lt;/p&gt;

&lt;p&gt;Prerequisite&lt;br&gt;
-Create-react-app&lt;br&gt;
-Bootstrap&lt;/p&gt;

&lt;p&gt;I won't be teaching how to create react-app .&lt;/p&gt;


&lt;h2&gt;
  
  
  Install React-js-Pagination
&lt;/h2&gt;

&lt;p&gt;Install with npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i react-js-pagination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR Install with yarn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react-js-pagination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Import Pagination
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Pagination from "react-js-pagination";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Up Active Page
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [activePage, setActivePage] = useState(1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating Pagination Component
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Pagination
 activePage={activePage}
 itemsCountPerPage={10}
 totalItemsCount={data.count}
 pageRangeDisplayed={5}
 onChange={onChangePaginate}
 innerClass="pagination"
 itemClass="page-item"
 activeLinkClass="page-link active"
 linkClass="page-link"
 prevPageText="Previous"
 nextPageText="Next"
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  setting onchange function
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const onChangePaginate = (pageNumber) =&amp;gt; {
    setActivePage(pageNumber);
    // to set offset
    console.log(pageNumber * 10 - 10)
  };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="https://www.npmjs.com/package/react-js-pagination"&gt;React-JS-Pagination&lt;/a&gt; for more information.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
      <category>html</category>
    </item>
  </channel>
</rss>
