flutter_receipt_printer 1.0.0 copy "flutter_receipt_printer: ^1.0.0" to clipboard
flutter_receipt_printer: ^1.0.0 copied to clipboard

PlatformAndroid

A modern Bluetooth thermal printer plugin for Flutter. Supports ESC/POS receipts, TSC labels, QR codes, barcodes, and Unicode on Android, iOS, macOS, Windows & Linux.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'basic_usage_example.dart';
import 'unicode_examples.dart';
import 'indian_languages_example.dart';
import 'advanced_printing_example.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Bluetooth Printer Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('flutter_receipt_printer'),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            const Card(
              child: Padding(
                padding: EdgeInsets.all(16.0),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      'flutter_receipt_printer',
                      style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                    ),
                    SizedBox(height: 8),
                    Text(
                      'A modern Bluetooth thermal printer plugin for Flutter. Supports ESC/POS receipts, TSC labels, QR codes, barcodes, and Unicode on Android, iOS, macOS, Windows & Linux.',
                    ),
                    SizedBox(height: 8),
                    Text(
                      '✅ iOS & Android Compatible\n✅ ESC/POS & TSC Support\n✅ Unicode & Indian Languages\n✅ QR Codes & Barcodes\n✅ Modern Architecture',
                      style: TextStyle(color: Colors.green),
                    ),
                  ],
                ),
              ),
            ),
            
            const SizedBox(height: 20),
            
            ElevatedButton.icon(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const BasicUsageExample()),
                );
              },
              icon: const Icon(Icons.school),
              label: const Text('Basic Usage Tutorial'),
              style: ElevatedButton.styleFrom(
                padding: const EdgeInsets.all(16),
              ),
            ),
            
            const SizedBox(height: 12),
            
            ElevatedButton.icon(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const UnicodeExamplesDemo()),
                );
              },
              icon: const Icon(Icons.translate),
              label: const Text('Unicode & Multilingual Examples'),
              style: ElevatedButton.styleFrom(
                padding: const EdgeInsets.all(16),
              ),
            ),
            
            const SizedBox(height: 12),
            
            ElevatedButton.icon(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const IndianLanguagesDemo()),
                );
              },
              icon: const Text('🇮🇳'),
              label: const Text('Indian Languages Examples'),
              style: ElevatedButton.styleFrom(
                padding: const EdgeInsets.all(16),
              ),
            ),
            
            const SizedBox(height: 12),
            
            ElevatedButton.icon(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const AdvancedPrintingExample()),
                );
              },
              icon: const Icon(Icons.receipt_long),
              label: const Text('Advanced Examples'),
              style: ElevatedButton.styleFrom(
                padding: const EdgeInsets.all(16),
              ),
            ),
            
            const Spacer(),
            
            const Card(
              color: Colors.orange,
              child: Padding(
                padding: EdgeInsets.all(12.0),
                child: Column(
                  children: [
                    Icon(Icons.info, color: Colors.white),
                    SizedBox(height: 8),
                    Text(
                      'iOS Testing Reminder',
                      style: TextStyle(
                        color: Colors.white,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    SizedBox(height: 4),
                    Text(
                      'Use a physical iOS device for testing.\nBluetooth doesn\'t work in iOS Simulator.',
                      style: TextStyle(color: Colors.white, fontSize: 12),
                      textAlign: TextAlign.center,
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
140
points
95
downloads

Publisher

verified publishersnippetcoder.com

Weekly Downloads

A modern Bluetooth thermal printer plugin for Flutter. Supports ESC/POS receipts, TSC labels, QR codes, barcodes, and Unicode on Android, iOS, macOS, Windows & Linux.

Homepage
Repository (GitHub)
View/report issues

Topics

#bluetooth #printer #thermal-printer #esc-pos

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_blue_plus, flutter_bluetooth_serial, permission_handler, shared_preferences

More

Packages that depend on flutter_receipt_printer