This is a Flutter app that calculates the total marks for a programming course based on various assessments and their respective weights.
To run this app on your local machine, follow these steps:
-
Make sure you have Flutter installed. If not, follow the official installation guide: Flutter Installation
-
Clone this repository using Visual Studio Code:
- Open Visual Studio Code.
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the command palette. - Type "Git: Clone" and press Enter.
- Paste the repository URL:
https://github.com/manighahrmani/programming_marks_calculator
- Choose a location to save the cloned repository.
- Click "Open" to open the cloned repository in Visual Studio Code.
-
Install the necessary extensions in Visual Studio Code:
- Dart
- Flutter
-
Open the terminal in Visual Studio Code (
Ctrl+Shift+P
and type "Terminal: Create New Integrated Terminal") and navigate to the project directory:cd programming_marks_calculator
-
Run the following command to get the dependencies:
flutter pub get
-
Connect a device or start an emulator.
-
Run the app using the following command:
flutter run
The app consists of three main parts:
-
Data: The
lib/data/assessment_data.dart
file contains the data for the assessments and their corresponding weights. -
Backend: The
lib/backend/marks_calculator.dart
file contains the logic for calculating the total marks based on the entered marks and the assessment weights. -
UI: The
lib/ui/home_page.dart
file defines the user interface of the app. It includes text fields for entering marks and a button to calculate the total marks.
The UI communicates with the backend by passing the entered marks to the MarksCalculator
class, which performs the calculations and returns the result. The data is kept separate in the assessment_data.dart
file, promoting separation of concerns.
To host your Flutter app as a website on Firebase, follow these steps:
-
Create a new Firebase project on the Firebase Console: Firebase Console
-
Install the Firebase CLI by running the following command:
npm install -g firebase-tools
-
Log in to Firebase using the CLI:
firebase login
-
In your Flutter project directory, initialize Firebase:
firebase init
Select "Hosting" and follow the prompts to set up hosting.
-
Build your Flutter app for the web:
flutter build web
-
Deploy your app to Firebase Hosting:
firebase deploy
-
Your app will be hosted at the provided URL, which will look like:
https://your-project-id.web.app
You can test the live version of the Programming Marks Calculator app hosted on Firebase: Programming Marks Calculator
Feel free to explore the app and provide feedback!