FLUTTER ECOSYSTEM

elrizwiraswara/flutter_pos

Flutter로 구축된 포인트 오브 세일(POS) 애플리케이션으로, 클린 아키텍처 원칙과 오프라인 우선 설계 패턴을 보여줍니다.

flutter_pos 프로젝트 이미지
Stars
213
Forks
86
최근 푸시(UTC)
2026. 5. 6.
프로젝트 상태
활성
Elriz Wiraswara GitHub avatar
GITHUB User

Elriz Wiraswara ↗

making stuff & figuring things out

언어DartC++CMakeSwiftCHTMLKotlinObjective-C

기술 주제

사용 중인 의존성

의존성 목록 47 개

순위

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

Flutter POS

License: MIT Made with Flutter

🚀 This project is the base model of Zirel POS. If you want a ready-to-use, feature-complete POS app, you might want to check it out, it's free, no card required.

A Point of Sale (POS) application built with Flutter, demonstrating Clean Architecture principles and offline-first design patterns. This project serves as a learning resource and reference implementation for building Flutter apps with proper architecture and automatic data synchronization between local storage (SQLite) and cloud database (Firestore).

The app prioritizes local-first operations, storing all data in SQLite and automatically syncing with Firestore when online. When offline, all user actions (create, update, delete) are recorded as QueuedActions in the local database and automatically executed in sequence when internet connectivity is restored.


Image 2 Image 1 Image 2 Image 2 Image 2

Demo APK

Download Demo APK

Features

Core Functionality
  • Product Management: Full CRUD operations for products with image upload support
  • Sales Transactions: POS interface with cart management and transaction history
  • Thermal Receipt Printing: Print transaction receipts via USB, Bluetooth, BLE, or network printers with configurable paper sizes (58mm, 72mm, 80mm)
  • User Authentication: Firebase Authentication with Google Sign-In integration
  • Account Management: User profile management and settings
Technical Implementation
  • Offline-First Architecture: Works seamlessly without internet connection
  • Automatic Data Sync: SQLite ↔ Firestore bidirectional synchronization
  • Queued Actions: Automatic retry mechanism for offline operations (create, update, delete)
  • Clean Architecture: Separation between presentation, domain, and data layers
  • State Management: Riverpod (migrated from Provider) for safer, more testable state management
  • Dependency Injection: Centralized DI setup for better code organization
  • Unit Testing: Tests for datasources, repositories, and use cases
  • Material Design 3: Material design 3 and Dark & Light theme switching support
  • Customizable Theming: Adjustable colors and typography
  • Multi-Platform: Supports Android, iOS, Windows, macOS, and Linux
  • Error Handling: User-friendly error messages and states
  • Reusable Widgets: Custom UI components for consistent design

Architecture

Architecture

Project Structure

flutter_pos/
├── lib/
│   ├── app/                          # Application setup and configuration
│   │   ├── di/                       # Dependency injection
│   │   ├── error/                    # Error handling
│   │   └── routes/                   # App routing and navigation
│   │
│   ├── core/                         # Core utilities and shared resources
│   │   ├── assets/                   # Asset management
│   │   ├── common/                   # Common utilities (Result wrapper)
│   │   ├── constants/                # App constants
│   │   ├── extensions/               # Dart extensions
│   │   ├── locale/                   # Localization
│   │   ├── services/                 # Core services
│   │   │   ├── connectivity/         # Network connectivity checking
│   │   │   ├── database/             # Local database service (sqflite)
│   │   │   ├── info/                 # Device info service
│   │   │   ├── logger/               # Error logging service
│   │   │   └── printer/              # Thermal printer service
│   │   ├── themes/                   # App theming (colors, sizes, themes)
│   │   ├── usecase/                  # Base usecase interface
│   │   └── utilities/                # Helper utilities (formatters, loggers, etc.)
│   │
│   ├── data/                         # Data layer
│   │   ├── datasources/              # Data sources
│   │   │   ├── interfaces/           # Datasource interfaces
│   │   │   ├── local/                # Local datasources (sqflite)
│   │   │   └── remote/               # Remote datasources (Firestore, Firebase Auth)
│   │   ├── models/                   # Data models with JSON serialization
│   │   └── repositories/             # Repository implementations
│   │
│   ├── domain/                       # Domain layer (Business logic)
│   │   ├── entities/                 # Business entities
│   │   ├── repositories/             # Repository interfaces
│   │   └── usecases/                 # Use cases (business logic operations)
│   │
│   ├── presentation/                 # Presentation layer (UI)
│   │   ├── providers/                # State management (Riverpod)
│   │   │   ├── account/              # Account-related state
│   │   │   ├── auth/                 # Authentication state
│   │   │   ├── home/                 # Home screen state
│   │   │   ├── main/                 # Main navigation state
│   │   │   ├── products/             # Products management state
│   │   │   ├── theme/                # Theme state
│   │   │   └── transactions/         # Transactions state
│   │   ├── screens/                  # UI screens
│   │   │   ├── account/              # Account screens
│   │   │   ├── auth/                 # Authentication screens
│   │   │   ├── error/                # Error screens
│   │   │   ├── home/                 # Home/POS screen
│   │   │   ├── main/                 # Main navigation screen
│   │   │   ├── products/             # Product management screens
│   │   │   └── transactions/         # Transaction history screens
│   │   └── widgets/                  # Reusable UI components
│   │
│   ├── firebase_options.dart         # Firebase configuration
│   └── main.dart                     # App entry point
│
├── test/                             # Unit and widget tests
│   ├── core/services/                # Service tests
│   ├── data/                         # Data layer tests
│   │   ├── datasources/              # Datasource tests
│   │   └── repositories/             # Repository tests
│   ├── domain/usecases/              # Usecase tests
│   └── presentation/screens/         # Screen tests
│
├── assets/                           # Static assets
├── android/                          # Android platform files
├── ios/                              # iOS platform files
├── linux/                            # Linux platform files
├── macos/                            # macOS platform files
├── web/                              # Web platform files
├── windows/                          # Windows platform files
│
├── analysis_options.yaml             # Dart analyzer configuration
├── pubspec.yaml                      # Package dependencies
└── README.md                         # Project documentation

Getting Started

Prerequisites
Installation
  1. Clone the repository:

    git clone https://github.com/elrizwiraswara/flutter_pos.git
    cd flutter_pos
    
  2. Install dependencies:

    flutter pub get
    
  3. Set up Firebase:

    • Create a new project on Firebase.
    • Follow the instructions to add Firebase to your Flutter app here.
    • Enable google authentication provider
    • Update cloud firestore rules to allow read write operation
    service cloud.firestore {
      match /databases/{database}/documents {
        match /{document=**} {
          allow read, write: if request.auth != null;
        }
      }
    }
    
    • Add cloud firestore indexes to enable query
      Cloud Firestore Indexes

    • Update firebase storage rules to allow read write operation
    service firebase.storage {
      match /b/{bucket}/o {
        match /{allPaths=**} {
          allow read, write: if request.auth != null;
        }
      }
    }
    
  4. Set up your config.json file
    GOOGLE_SERVER_CLIENT_ID is Web client ID that you can get from your Firebase Google sign-in method provider

    {
      "GOOGLE_SERVER_CLIENT_ID": "xxxxxxxxxxxxx.apps.googleusercontent.com"
    }
    
  5. Run the application:

    flutter run --dart-define-from-file config.json
    
Test

To test the application, run the following command:

flutter test --coverage

To view the test coverage you can use genhtml or test_cov_console

AI Agent Guidelines

This project includes documentation files designed for AI coding agents (e.g., Claude Code) to keep code consistent when modifying the project:

  • CLAUDE.md — Project conventions (architecture, naming, code style)
  • UI.md — UI reference (layouts, components, design specs)
  • DATABASE.md — Database schema reference (tables, columns)
  • WORKFLOW.md — Git workflow (commits, branches, PRs)

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any bugs, feature requests, or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.