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

A Flutter plugin for 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 {
  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,
      ),
    ),
  );
}
137
likes
130
pub points
88%
popularity

Publisher

verified publisheryushulx.me

A Flutter plugin for 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)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, js

More

Packages that depend on flutter_barcode_sdk