Open Flutter Project: developers guidelines
There are two very common ways of contributing to Open Flutter Project. You can be a member of the core team or contribute every now and then. This article is written for developers who are making first steps in contributing to Open Source Projects. If you are an experienced developer, you might find it useful too. It will help establish a common workflow for contributing to the project for everyone.
Please, follow Dart Styling recommendations for naming described here.
If you are familiar with Flutter, git and ready to start you should review Open Flutter Project: E-commerce App Widgets.
Step 1
If you are not a member of the core team and do not have access to the main repository of the app then you need to fork the repository first.
You need to clone the repository to your local computer
git clone “<github-repository-link>”
Use the correct link to the repository you work on. For example:
git clone “https://github.com/4seer/openflutterecommerceapp.git”
Step 2
Now you need to add your updates. It is a common practice to work on new features or fixes in a separate branches. Therefore you need to create a new branch. First you need to enter the folder of the project that you just cloned from github.
cd openflutterecommerceapp/
You need to change “openflutterecommerceapp” to the correct folder name.
git checkout -b <branch-name>
For example:
git checkout -b dev_newfeature
Please follow naming convention where new features branches start with dev_ prefix and issues fixes start with fix_ prefix. That will allow us to quickly navigate branches and understand what is what as the team grows.
Step 3
Make your changes and commit them to remote branch.
First add your updated files
git add <file name>
For example
git add lib/screens/products/products.dart
or you can add all of the updated and added files using this command
git add — all
Now let`s commit the chagnes
git commit -m “Your commit message goes here”
Step 4
Push the changes to the remote branch
git push origin <remote-branch-name>
For instance:
git push origin dev_newfeature
Step 5
Make a pull request to submit your changes and get them reviewed.
Check that your pull request is valid and submit it with title and comments
Now you should report to an issue to say that it was fixed within your pull request.
Flutter version
Make sure you are using latest version of flutter from master branch. To upgrade flutter do the following:
flutter channel master
flutter upgrade
Or may be you will need dev channel
flutter channel dev
flutter upgrade
Run flutter doctor to make sure you have everything working properly
flutter doctor -v
We are using pedantic_package to bring the code more clear.
The app is using flutter_clean_architecture that implements Uncle Bob’s Clean Architecture.
Continuous integration / Continuous Development
We are using general workflow for validating the code and running tests with flutter. GitHub CI/CD workflow is described here.
Congratulations!
You did your first contribution to open-source project. What next?
Keep Fluttering...
… and help others.
Open Flutter Project on LinkedIn
Regards,
Andrey