print_pda 0.1.1

Flutter Android iOS

A new Flutter plugin for pda print

print_pda #

A Flutter plugin ๐Ÿ›  to print . Ready for Android ๐Ÿš€

Permission๏ผš #

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED"
      tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

Installation #

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

dependencies:
 print_pda: ^0.1.1

Scan Usage example #

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:print_pda/print_pda.dart';

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

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

class _MyAppState extends State<MyApp> {
  var _print;

  @override
  void initState() {
    super.initState();
    if(mounted) {
      _print = PrintPda();
      _print.onScanResult.listen((String result){
        print("่ฟ”ๅ›ž็ป“ๆžœ:"+result);
      });
    }

  }

  // Platform messages are asynchronous, so we initialize in an async method.


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              RaisedButton(
                child: Text('ๅˆๅง‹ๅŒ–'),
                onPressed: _init,
              ),
              RaisedButton(
                child: Text('ๆ‰“ๅผ€'),
                onPressed: _open,
              ),
              RaisedButton(
                child: Text('ๆ‰“ๅฐ'),
                onPressed:()=>_printText("Hello World!Flutter Plugin"),
              ),


            ],
          )
        ),
      ),
    );
  }

  Future<void> _printText(String text) async {
    print("็ป“ๆžœ่ฟ”ๅ›ž"+await _print.print(text));
  }

  Future<void> _init() async {
    print("็ป“ๆžœ่ฟ”ๅ›ž"+await _print.init(true));

  }

  Future<void> _open() async {
    print("็ป“ๆžœ่ฟ”ๅ›ž"+await _print.open);
  }
}

0
likes
65
pub points
0%
popularity

A new Flutter plugin for pda print

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

jeffluogang@gmail.com

License

unknown (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on print_pda