sunmiconditionalimports 0.0.7
sunmiconditionalimports: ^0.0.7 copied to clipboard
A wrapper for the sunmi_printer_plus package and the bitmap package to use them conditionally based on the platform.
This package is a wrapper for the sunmi_printer_plus package aswell as the bitmap package. It provides a way to import the sunmi_printer_plus package and the bitmap package conditionally based on the platform. This is useful for when you want to use the sunmi_printer_plus package and bitmap package on Android, while also deploying the same code to the web. Specifically made for usage with FlutterFlow, since FlutterFlow does not support conditional imports.
Features #
This package provides a way to import the sunmi_printer_plus package and the bitmap package conditionally based on the platform.
Getting started #
Add the following to your pubspec.yaml file:
dev_dependencies:
sunmiconditionalimports: ^0.0.7
Usage #
import 'package:sunmiconditionalimports/sunmiprinterimports_exports.dart';
DO NOT import the other files directly, as they are not intended to be used directly.
Replace SunmiPrinter class with SunmiPrinterImports() example: SunmiPrinterImports.printText('Hello World') Replace SunmiPrintAlign class with SunmiPrintAlignImports() example: SunmiPrintAlignImports.center() Replace SunmiFontSize class with SunmiFontSizeImports() example: SunmiFontSizeImports.md() Replace ColumnMaker class with ColumnMakerImports() example: ColumnMakerImports.createColumnMaker(text: 'Hello World', width: 10, align: SunmiPrintAlignImports.center()) Replace Bitmap class with BitmapImports() example: BitmapImports.fromProvider(NetworkImage('https://example.com/image.png'), 100)