update redesign, add more option
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:max_print_plus/max_print_plus.dart';
|
||||
import 'package:max_print_plus/print/max_print.dart';
|
||||
import 'package:max_print_plus/print/max_print_bt.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
@@ -54,16 +55,21 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
child: Text('Click me')),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_printReceiveTest(true);
|
||||
_printReceiveTest(false);
|
||||
},
|
||||
child: Text('Print page mode')),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_printReceiveTest(true);
|
||||
},
|
||||
child: Text('Print page single mode')),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Future _printReceiveTest(bool isPage) async {
|
||||
Future _printReceiveTest(bool isSinglePage) async {
|
||||
List<int> bytes = [];
|
||||
|
||||
// Xprinter XP-N160I
|
||||
@@ -259,13 +265,24 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
bytes += generator.text('TERIMA KASIH',
|
||||
styles: const PosStyles(align: PosAlign.center));
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MaxPrint(
|
||||
bytes: bytes,
|
||||
generator: generator,
|
||||
)));
|
||||
if (isSinglePage) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MaxPrintBt(
|
||||
bytes: bytes,
|
||||
generator: generator,
|
||||
onSuccess: (p0) {},
|
||||
)));
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MaxPrint(
|
||||
bytes: bytes,
|
||||
generator: generator,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
// _showPrintDialog(List<int> bytes, Generator generator) {
|
||||
|
Reference in New Issue
Block a user