Skip to content

SushanShakya/tdd_flutter_restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test Driven Development in Flutter

Uses Flutter Version 2.10.5

Wanna Start TDD ?

This repo is the perfect example

How to start writing the app ?

Remember, Coding is the last thing that you'll do. The first thing that you should do is gather requirements.

Once you know what you need you'll have the sense of the bussiness logic. With that you'll know exactly what you need in your app.

So, This way, before coding stuff you already know what the structure of the code should look like.

That's where you start.

What to do and what not to do ?

Look, I don't want you to have to run the "Flutter Project" to actually see if your code works. In fact, I don't want your app to depend upon Flutter in the first place. This might feel weird at first. But don't worry it will all make sense once you start doing it.

So, you start with what you need in the app.

Case Study

Consider, this repo as a example. The only thing I want to do in the app I've built in this repo is that we want to fetch the users and we want to create a user.

These 2 things are called the "usecases" of the app. They are also sometimes called as "user stories".

Basically, it talks about what a user should be able to do in the app.

Once you have the user stories you start building your app from abstractions. First, you decide what you want. Like in this case, we want a "UserRepo" which can somehow give us a list of users and also somehow create a user.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published