brotherlabelprintdart 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Brother Label Printer Dart #

A dart plugin implementing the Brother Label Print SDK

DISCLAMER : This plugin is at really early development stage. #

Feature / OSAndroidiOS
Template PrintYEStodo
Image Printtodotodo
PDF Printtodotodo
Network ConnexionYEStodo
Bluetooth Connexiontodotodo
USB Connexiontodotodo

Supported printers :

  • MW_140BT
  • MW_145BT
  • MW_260
  • PJ_522
  • PJ_523
  • PJ_520
  • PJ_560
  • PJ_562
  • PJ_563
  • PJ_622
  • PJ_623
  • PJ_662
  • PJ_663
  • RJ_4030
  • RJ_4040
  • RJ_3150
  • RJ_3050
  • QL_580N
  • QL_710W
  • QL_720NW
  • TD_2020
  • TD_2120N
  • TD_2130N
  • PT_E550W
  • PT_P750W
  • TD_4100N
  • TD_4000
  • PJ_762
  • PJ_763
  • PJ_773
  • PJ_722
  • PJ_723
  • PJ_763MFi
  • MW_145MFi
  • MW_260MFi
  • PT_P300BT
  • PT_E850TKW
  • PT_D800W
  • PT_P900W
  • PT_P950NW
  • RJ_4030Ai
  • PT_E800W
  • RJ_2030
  • RJ_2050
  • RJ_2140
  • RJ_2150
  • RJ_3050Ai
  • RJ_3150Ai
  • QL_800
  • QL_810W
  • QL_820NWB
  • QL_1100
  • QL_1110NWB
  • QL_1115NWB
  • PT_P710BT
  • PT_E500
  • RJ_4230B
  • RJ_4250WB
  • TD_4410D
  • TD_4420DN
  • TD_4510D
  • TD_4520DN
  • TD_4550DNWB

0.1.0 #

  • Out of Alpha state
  • Applied dartanalyzer recommendations

0.0.1 #

Initial release :

  • Support for template label

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:brotherlabelprintdart/print.dart';
import 'package:brotherlabelprintdart/templateLabel.dart';
import 'package:brotherlabelprintdart/printerModel.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _printStatus = 'Initializing...';

  void print(bool bulk) async {
    setState(() {
      _printStatus = "Running...";
    });

    List<TemplateLabel> labels = List<TemplateLabel>();

    if (bulk) {
      for (int i = 0; i < 5; i++) {
        labels.add(TemplateLabel(i < 3 ? 1 : 2, [
          "0 : Label $i",
          "1 : 31/03/2020 - 12:00",
          "2 : Primael.Q",
          "3 : 02/04/2020",
          "4 : 03/04/2020",
          "5 : 12:00",
          "6 : 12:00"
        ]));
      }
    } else {
      labels.add(TemplateLabel(1, [
        "0 : Cheddar Mozzarella Rapé",
        "1 : 31/03/2020 - 12:00",
        "2 : Primael.Q",
        "3 : 02/04/2020",
        "4 : 03/04/2020",
        "5 : 12:00",
        "6 : 12:00"
      ]));
    }

    String result;
    try {
      result = await Brotherlabelprintdart.printLabelFromTemplate(
          "192.168.1.42", PrinterModel.TD_2120N, labels);
    } catch (e) {
      result = "An error occured : $e";
    }

    setState(() {
      _printStatus = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Brother Label Print Dart'),
        ),
        body: Center(
            child: Column(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('Print status : $_printStatus\n'),
            MaterialButton(
              child: Text("Print 1 label"),
              onPressed: () {
                print(false);
              },
            ),
            MaterialButton(
              child: Text("Print 5 labels"),
              onPressed: () {
                print(true);
              },
            )
          ],
        )),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  brotherlabelprintdart: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:brotherlabelprintdart/pair.dart';
import 'package:brotherlabelprintdart/print.dart';
import 'package:brotherlabelprintdart/printerModel.dart';
import 'package:brotherlabelprintdart/templateLabel.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:brotherlabelprintdart/pair.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:brotherlabelprintdart/pair.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:brotherlabelprintdart/pair.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:brotherlabelprintdart/pair.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [brotherlabelprintdart] that is in a package requiring null.

Health issues and suggestions

Document public APIs. (-0.66 points)

87 out of 88 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test