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

A Flutter plugin of Dynamsoft Barcode Reader SDK. It covers Android, iOS, Web, Windows, Linux and macOS, supporting linear barcode, 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 {
  if (kIsWeb) {
    runApp(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;

    runApp(
      MaterialApp(
        title: 'Dynamsoft Barcode Reader',
        home: Scaffold(
          appBar: AppBar(
            title: Text("Dynamsoft Barcode Reader"),
          ),
          body: Mobile(
            camera: firstCamera,
          ),
        ),
      ),
    );
  } else if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
    runApp(Desktop());
  }
}
148
likes
140
points
2.18k
downloads

Publisher

verified publisheryushulx.me

Weekly Downloads

A Flutter plugin of Dynamsoft Barcode Reader SDK. It covers Android, iOS, Web, Windows, Linux and macOS, supporting linear barcode, 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