DevClub Summer of Code 2024
App Development: Week 2
Goals:
- Learn to use the Provider package for state management in Flutter.
- Implement barcode scanning functionality to enhance inventory management.
- Understand the basics of object-oriented programming (OOP) in Dart.
- Implement a profile page and logout functions.
Tasks:
Task 1: Provider Package
Objective: Use the Provider package for state management.
- Add the Provider package: Add the
provider
package to your Flutter project by including it in your pubspec.yaml
file:
dependencies:
provider: ^6.0.0
- Handle Loading State of Auth Pages
- Use Provider to manage the loading state during authentication (login and registration).
- Display loading indicators appropriately.
- State Management of User Data and Products
- updtae user screen after scanning product using provider
- Manage user data after login using Provider.
- Display user data on various pages using provider
- Refactor Existing State Management Code
- Refactor any existing state management code in your project to use Provider.
Resources
Task 2: OOP Concepts in Dart
Objective
- Understand the basics of object-oriented programming in Dart.
Steps
- Learn to Create Classes, Objects, and Methods
- Understand how to create and use classes, objects, and methods in Dart.
- Understand Inheritance, Polymorphism, and Encapsulation
- Learn about these core OOP concepts and how they are implemented in Dart.
- Use OOP to Make User Model and Product Classes
- Create user and product classes to store data.
- Implement Basic OOP Concepts in Your Flutter Project
- Apply OOP principles in your Flutter project for better code organization and management.
Resources
Task 3: Developing Barcode Scanner
Objective
- Implement barcode scanning functionality.
Steps
- Add the
flutter_barcode_scanner
Package
- Add the
flutter_barcode_scanner
package to your Flutter project by including it in your pubspec.yaml
file:
dependencies:
flutter_barcode_scanner: ^2.0.0
- Manage Permissions with
permission_handler
- Request permission for camera access using
permission_handler
package.
- Handle permission responses and display appropriate UI based on permission status
-
Android Manifest Configuration
- Add the following permissions to your Android manifest (
android/app/src/main/AndroidManifest.xml
) file:
```xml
- Implement Barcode Scanning
- Integrate barcode scanning in your inventory management screen.
- Store Scanned Data in Local Preferences
- Use the
shared_preferences
package to store scanned data.
- Show Scanned Product List on the Screen
- Display the list of scanned products in your inventory management screen.
Resources
Task 4: Profile Page
Objective
- Implement a profile page and logout functions.
Steps
- Create a Profile Page
- Design and implement a profile page that displays user information.
- Implement Logout Functionality
- Add functionality to log out the user from the application.
- Use Provider for State Management
- Manage the state of the profile page and logout functionality using Provider.
Resources