Blog Application — Flutter — Part II

Pradyot Prakash
3 min readApr 25, 2021

Go to the Previous Part to know how to set-up your VCS.

Welcome to the Second Part.

We will be looking at how to set up your project with Lint rules. Adding few packages. And also creating the file structure which we will be using for this project.

So let’s get started.

Step 1

Let’s add the analysis_options.yaml file in our project which will handle all the lint rules for Dart in our project. This will help us in making our project by following the dart guidelines. This will be added in the same directory where pubspec.yaml is added.

After adding the file you will see some warnings in the analysis_options.yaml. Don’t worry about that we need to add one package to it.

Go to this commit to see the changes needed when you add the analysis_options.yaml file.

To see the list of rules can go here. There are a lot of rules but we are only following the selective ones.

Step 2

Now let see which and all packages will be required to make this application.

First of all, we will be needing a package which will help us in managing the state of your application. I will be using GetX for that.

On why to use GetX can go here.

Now, we need a log printer that will log the required details in the console and it has to be formatted properly. So let’s add a logger package for it. We would also need internet_connection_checker and intl to perform basic utility checks like internet and text direction for the locale.

So below is the list of packages that we will be using for our project (will be updated as we move forward):

  1. connectivity: https://pub.dev/packages/connectivity
  2. get: https://pub.dev/packages/get
  3. google_fonts: https://pub.dev/packages/google_fonts
  4. internet_connection_checker: https://pub.dev/packages/internet_connection_checker
  5. intl: https://pub.dev/packages/intl
  6. logger: https://pub.dev/packages/logger

So, now you have the set of packages that we will be using for your project.

Check here to see the commits for this step.

Step 3

Now let’s start structuring our folders for this project. We will be using the Clean Architecture format to set up our project. To know how to set up the folders clearly and what’s the meaning of each folder can go to https://pradyotprksh4.medium.com/clean-architecture-flutter-f1baf4956be8 here.

For now, I haven’t added the data and device layer. Will be adding it as we move forward. For this project, the data layer would not be required because the Firebase package will handle the remote layer changes.

The device layer will be adding in the future to allow users for changing the theme and language of the application. So it will be in TODO.

So, for this step can go to this link which will show you the commit.

So by now, you will have a folder structure and your initial application structure. For this part, this much will be enough. We will move to the next part and there we will set up our GitHub action and will also set up the local storage for saving application-related details.

Click on Follow and Subscribe button to get notified when the Third Part is published. Will be adding the Link when it’s done. Stay Tuned.

--

--