story_printer 0.0.1 copy "story_printer: ^0.0.1" to clipboard
story_printer: ^0.0.1 copied to clipboard

PlatformAndroid

A printer plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:story_printer/pint_info.dart';
import 'package:story_printer/story_printer.dart';
import 'package:story_printer/text_info.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _storyPrinterPlugin = StoryPrinter();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ElevatedButton(
              onPressed: () {
                List<TextInfo> list = [
                  TextInfo(text: '松语乌龙茶汤1份', fontWeight: 'Bold'),
                  TextInfo(text: '最佳期限:22-10-12 19:45', fontWeight: 'Bold'),
                  TextInfo(text: '制作时间:22-10-09 19:45'),
                  TextInfo(text: '保存:常温'),
                  TextInfo(text: '制作人:yc'),
                ];
                PrintInfo printInfo = PrintInfo(list, 1, 'test');
                _storyPrinterPlugin.print(printInfo);
              },
              child: const Text('打印')),
        ),
      ),
    );
  }
}
1
likes
140
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A printer plugin.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on story_printer

Packages that implement story_printer