A Flutter-based mobile application frontend providing a modern and responsive user interface, utilizing Firebase Firestore and Realtime Database for data storage and synchronization.
- Overview
- Project Structure
- Installation & Setup
- Usage
- Assets
- Platform Support
- Contributing
- Sketch Prediction and Game Room Features
- Drawing Features
This Flutter application serves as the frontend interface, supporting multiple platforms including iOS, Android, web, and desktop environments. It leverages Firebase Firestore and Realtime Database for efficient data management and real-time updates.
frontend/
├── lib/ # Main Dart source code
├── assets/ # Static assets
├── asset/
│ └── images/ # Image resources
├── android/ # Android-specific configurations
├── ios/ # iOS-specific configurations
├── web/ # Web platform files
├── windows/ # Windows desktop configuration
├── linux/ # Linux desktop configuration
├── macos/ # macOS desktop configuration
└── pubspec.yaml # Project dependencies and settings
-
Prerequisites
flutter --version # Ensure Flutter is installed -
Clone the Repository
git clone <repository-url> cd frontend
-
Install Dependencies
flutter pub get
-
Run the Application
flutter run
- Create a Firebase project in the Firebase Console.
- Register the app for Android, iOS, and Web.
- Download the
google-services.json(for Android) andGoogleService-Info.plist(for iOS) and place them in the respective project folders. - Add Firebase dependencies in
pubspec.yaml:dependencies: firebase_core: latest_version cloud_firestore: latest_version firebase_database: latest_version
- Initialize Firebase in your Flutter app:
void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(MyApp()); }
- Firestore is used for structured and scalable document storage.
- Realtime Database is used for real-time data synchronization, such as live game room updates and collaborative drawing.
-
Development Mode
flutter run
-
Build Release Version
flutter build <platform>
Replace
<platform>with:apkfor Androidiosfor iOSwebfor webwindowsfor Windowsmacosfor macOSlinuxfor Linux
- Images and static resources are stored in the
asset/images/directory - Additional assets can be configured in
pubspec.yaml
This application is configured to run on:
- Android
- iOS
- Web
- Windows
- Linux
- macOS
Each platform has its specific configuration in its respective directory.
- Fork the repository
- Create a feature branch
- Submit a pull request
Note: Update the dependencies regularly and ensure compatibility with the latest Flutter version.
This project includes innovative features for sketch prediction and game room management, leveraging Firebase for seamless real-time collaboration.
- Real-time Prediction: As users draw, the system predicts the sketch in real-time.
- Deep Learning Model: Utilizes a pre-trained deep learning model to recognize and predict sketches with enhanced accuracy.
- Prediction Feedback: Provides immediate feedback on the predicted sketch, helping users improve their drawings.
- Accuracy Improvement: Continuously improves prediction accuracy based on user interactions and corrections.
- Room Creation: Users can create game rooms with unique IDs.
- Room Joining: Users can join existing game rooms using the room ID.
- Collaborative Drawing: Multiple users can draw on the same canvas in a game room.
- Real-time Synchronization: Drawings are synchronized in real-time across all users using Firebase Realtime Database.
- Session Management: Manages drawing sessions, including start and end times, and participant tracking.
- Chat Functionality: Integrated chat feature for users to communicate within the game room.
- Score Tracking: Tracks and displays scores for drawing games, encouraging friendly competition.
- A service responsible for handling sketch prediction logic.
- Interfaces with the machine learning model to predict sketches based on user input.
- Manages the creation, joining, and synchronization of game rooms.
- Handles user sessions, drawing data, and real-time updates in Firebase.
- A model representing a game room, including room ID, participants, and drawing data.
- Manages the state of the game room and synchronizes data across all participants.
- Provides chat functionality within game rooms.
- Manages sending and receiving messages in real-time via Firebase Realtime Database.
- Tracks and updates scores for drawing games.
- Displays scores to users in the game room.
This project includes advanced drawing capabilities that allow users to create and interact with various shapes and freehand drawings.
- Users can draw freehand lines on the canvas.
- The freehand drawing mode supports different stroke widths and colors.
- Users can draw various shapes, including:
- Lines
- Rectangles
- Circles
- Triangles
- Stars
- Diamonds
- Arrows
- Shapes can be drawn with both stroke and fill styles.
- An eraser tool is available to remove parts of the drawing.
- The eraser size can be adjusted.
- Users can undo and redo their drawing actions.
- The undo and redo stacks are maintained to allow multiple levels of undo and redo.
- Users can select different stroke widths for their drawings.
- Fill mode can be toggled to fill shapes with color.
- A color palette is available for users to choose different colors for their drawings.
- The selected color is applied to both freehand and shape drawings.
- Drawings are synchronized in real-time for collaborative sessions using Firebase Realtime Database.
- While drawing shapes, a preview of the shape is shown to the user before finalizing the drawing.
- Drawing sessions are managed with unique session IDs.
- Users can join and collaborate in drawing sessions.
- The main widget for advanced drawing features.
- Supports freehand drawing, shape drawing, erasing, and real-time synchronization.
- A model representing a point in the drawing, including its position, paint properties, and shape information.