fl_print_pl 0.0.4 copy "fl_print_pl: ^0.0.4" to clipboard
fl_print_pl: ^0.0.4 copied to clipboard

Chinese print printer plug-in only supports android, because the print data is different, you need to download their own modification

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    FlPrintPl.init();
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
    FlPrintPl.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('打印数据'),
        ),
        body: Container(
          padding: EdgeInsets.all(16),
          child: Column(
            children: <Widget>[
              InkWell(
                child: Container(height: 50, child: Text("点击获取蓝牙数据")),
                onTap: () {
                  FlPrintPl.getBlueData();
                },
              ),
              InkWell(
                child: Container(height: 50, child: Text("点击进行蓝牙连接")),
                onTap: () {},
              ),
              Container(
                height: 50,
                width: double.infinity,
                child: RaisedButton(
                  color: Colors.white,
                  child: Text('点击进行打印机搜索'),
                  onPressed: () async {
                    await FlPrintPl.searchBlue();
                  },
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

Chinese print printer plug-in only supports android, because the print data is different, you need to download their own modification

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on fl_print_pl