flutter_barcode_sdk 3.0.1 copy "flutter_barcode_sdk: ^3.0.1" to clipboard
flutter_barcode_sdk: ^3.0.1 copied to clipboard

The only Flutter barcode SDK for Android, iOS, Web, Windows, Linux, macOS. Supported 1D/2D barcodes include Code39, Code128, EAN13, QR Code, DataMatrix, MaxiCode, PDF417, etc.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'dart:io';

import 'package:camera/camera.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter_barcode_sdk_example/desktop.dart';
import 'package:flutter_barcode_sdk_example/mobile.dart';
import 'package:flutter_barcode_sdk_example/web.dart';

Future<void> main() async {
  StatefulWidget app;
  if (kIsWeb) {
    app = Web();
  } else if (Platform.isAndroid || Platform.isIOS) {
    // Ensure that plugin services are initialized so that `availableCameras()`
    // can be called before `runApp()`
    WidgetsFlutterBinding.ensureInitialized();

    // Obtain a list of the available cameras on the device.
    final cameras = await availableCameras();

    // Get a specific camera from the list of available cameras.
    final firstCamera = cameras.first;

    app = Mobile(
      camera: firstCamera,
    );
  } else {
    app = Desktop();
  }

  runApp(
    MaterialApp(
      title: 'Dynamsoft Barcode Reader',
      home: Scaffold(
        body: app,
      ),
    ),
  );
}
copied to clipboard
148
likes
140
points
2.92k
downloads

Publisher

verified publisheryushulx.me

Weekly Downloads

2024.09.13 - 2025.03.28

The only Flutter barcode SDK for Android, iOS, Web, Windows, Linux, macOS. Supported 1D/2D barcodes include Code39, Code128, EAN13, QR Code, DataMatrix, MaxiCode, PDF417, etc.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, js

More

Packages that depend on flutter_barcode_sdk