aspose_barcode_cloud 0.23.2 copy "aspose_barcode_cloud: ^0.23.2" to clipboard
aspose_barcode_cloud: ^0.23.2 copied to clipboard

This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily

example/main.dart

import 'dart:io';
import 'dart:typed_data';

import 'package:aspose_barcode_cloud/api.dart';
import 'package:http/http.dart';

Future<void> main() async {
  const fileName = "qr.png";

  final api = BarcodeApi(ApiClient(
    clientId: "Client Id from https://dashboard.aspose.cloud/applications",
    clientSecret:
        "Client Secret from https://dashboard.aspose.cloud/applications",
    // For testing only
    accessToken: Platform.environment["TEST_CONFIGURATION_ACCESS_TOKEN"],
  ));

  // Generate image with barcode
  final Uint8List generated =
      await api.getBarcodeGenerate("QR", "text", textLocation: "None");
  // Save generated image to file
  new File(fileName).writeAsBytesSync(generated);
  print("Generated image saved to " + fileName);

  // Recognize generated image
  final formFile = MultipartFile.fromBytes("image", generated.toList(),
      filename: "barcode.png");
  final BarcodeResponseList recognized =
      await api.postBarcodeRecognizeFromUrlOrContent(image: formFile);

  if (recognized.barcodes != null && recognized.barcodes!.length > 0) {
    print("Recognized Type: " + recognized.barcodes![0].type!);
    print("Recognized Value: " + recognized.barcodes![0].barcodeValue!);
  } else {
    print("No barcode found");
  }
}
4
likes
0
pub points
28%
popularity

Publisher

verified publisheraspose.cloud

This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http

More

Packages that depend on aspose_barcode_cloud