CSOC'24 Project in App Dev track using Flutter.
If any of the above is missing, please follow these links: Installing Git and Setting up flutter guide.
Fork this repo.
Clone the forked repo into your local system with this command:
git clone <your_forked_repo_url>
Open the cloned repo in VS Code terminal.
Check whether upstream is set successfully by running:
git remote
If upstream is not found, add upstream with this command:
git remote add upstream https://github.com/Varun-Kolanu/csoc_flutter.git
Fetch the code from remote:
git fetch --all
Add the debug.keystore
file provided to you (if not, ask a maintainer) in android folder i.e., as /android/debug.keystore
Run the following command to install dependencies:
flutter pub get
Run this to start running the app in Physical device or Android emulator:
flutter run
Do git fetch --all
and git rebase upstream/main
frequently to update the local repository.
Contributions to this app are welcome. If you're looking to get into COPS, this is one of the projects we are considering. Irrespective of the result, you'll get a hands on experience in flutter and a wonderful experience contributing to an open source project.
@csoc-bot claim
to get the issue assigned. Only after getting an issue assigned, start working on it.If you see any bug or want to suggest a new feature, open an issue by filling the issue template in issue tab.
After completing an issue, commit them and make a pull request. The commit messages should follow commit guidelines.
Before making a commit or before making a PR, always fetch the current remote repo from github into local machine so that any code changes by other contributors are reflected:
git fetch --all
Before making a PR rebase your repo with upstream with the following command and solve any merge conflicts if exist: (To know more about rebase refer to this video ).
git rebase upstream/main
The PR message should contain any of the following keywords and should contain the issue number it is solving so that it gets linked in that issue:
close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved
Example PR message:
This PR does this...
fixes #1
Then make a PR to the upstream/main branch and check whether all tests from GitHub actions got passed.
If you don't make any contributions in 3 days after getting issue assigned, your assignment will be removed.
Each commit message should convey a single change.
If a change is suggested in a commit, don't do a new commit, rather undo the last commit and edit it. Use this command for this:
git commit --amend -m "<your_commit_message>"
This will replace the last commit fully with the new changes (including commit message and code changes)
Important: When you have edited the last commit, don't push it to the remote repo directly. Rather, use the following command:
git push -f
Every commit message should follow a fixed format:
type(scope?): subject #scope is optional
Example commit messages:
feat(blog): add comment section
fix: some message
Valid types:
Examples of scopes: server, ui, services etc
git fetch --all
.
├── assets
│ ├── images
│ ├── icons
│ ├── videos
| └── attendance_data.json
├── ...
└── lib
├── cubit
│ ├── feature_cubit.dart
│ ├── feature_state.dart
│ └── ...
├── models
│ ├── feature_model.dart
│ └── ...
├── repository
│ ├── feature_repository.dart
│ └── ...
├── services
│ ├── feature_service.dart
│ └── ...
├── ui
│ ├── screens
│ │ ├── feature_screen.dart
│ │ └── ...
│ └── widgets
│ ├── feature_widget.dart
│ └── ...
└── utils
├── colors.dart
├── constants.dart
└── ...
assets
have three folders images, icons and videos.cubit
: For managing the state. You'll reach out to the functions in cubit for any work. These emit states, which are listened by UI.repositories
: Cubit functions call repositories. These have functions which call APIs, acts a bridge between backend and flutter.models
: Used by repositories or when JSONs are needed. Used to serialize or deserialize in JSONs (like changing data to JSON for API calls)services
: Any function to be used by UI or cubit or literally any part of application. All the functions reside hereui
: Has two folders for screens
and widgets
. Only UI and no functions in these. cubit and serices are present for that. Use BlocBuilder to update UI when states are emitted from cubit.utils
: General folder for colors, constants, image paths etcGetting the commit hashes of all the previous commits:
git log
Check a previous commit without resetting:
git checkout <commit-hash>
Go to a commit by undoing all the next commits (For eg., go to commit 2 while undoing 3rd, 4th commits):
git reset --hard <commit-hash>
Undo the last commit and keep the changes in local repo so that you can change them and recommit later:
git reset --soft HEAD~1
For git commit --amend
and git rebase
, always use git push -f
instead of simple git push
Update your repo in intervals using git fetch --all
and git rebase upstream/main
.
To edit a particular commit use Interactive rebase: git rebase --interactive <commit-hash>~
and follow the commands.
For example, to edit a commit message of a particular commit: