修复打印bug

master
章文轩 2 years ago
parent 952b5c75b4
commit 1d11eb7b2c

@ -172,7 +172,8 @@ public class Bluetooth {
public int btConn(final String address, Context context) throws Exception { public int btConn(final String address, Context context) throws Exception {
// bluetoothPort.connect(address); // bluetoothPort.connect(address);
final int[] portOpen = {-4}; //final int[] portOpen = {};
final int[] portOpen = new int[1];
btThread = new Thread(new Runnable() { btThread = new Thread(new Runnable() {
@Override @Override
@ -307,6 +308,7 @@ public class Bluetooth {
public void ExcuteDisconnect(Context context) { public void ExcuteDisconnect(Context context) {
new ExcuteDisconnectBT().execute(context); new ExcuteDisconnectBT().execute(context);
} }
private class ExcuteDisconnectBT extends AsyncTask<Context, Void, Void> { private class ExcuteDisconnectBT extends AsyncTask<Context, Void, Void> {

@ -4,6 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import cpcl.PrinterHelper;
import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.EventChannel; import io.flutter.plugin.common.EventChannel;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
@ -65,7 +66,7 @@ public class HyPrinterPlugin implements FlutterPlugin, MethodCallHandler {
if (call.method.equals("startSearch")) { if (call.method.equals("startSearch")) {
bluetooth.SearchingBTDevice(); bluetooth.SearchingBTDevice();
} else if (call.method.equals("connect")) { } else if (call.method.equals("connect")) {
int code = -4; int code;
String arg = call.argument("address"); String arg = call.argument("address");
System.out.println(arg); System.out.println(arg);
try { try {
@ -104,9 +105,19 @@ public class HyPrinterPlugin implements FlutterPlugin, MethodCallHandler {
} }
result.success(sta); result.success(sta);
} else if (call.method.equals("disposeDiscovery")) { } else if (call.method.equals("disposeDiscovery")) {
try {
PrinterHelper.portClose();
} catch (Exception e) {
e.printStackTrace();
}
bluetooth.cancelDiscoveryResult(context); bluetooth.cancelDiscoveryResult(context);
result.success(true); result.success(true);
} else if (call.method.equals("disposeConnect")) { } else if (call.method.equals("disposeConnect")) {
try {
PrinterHelper.portClose();
} catch (Exception e) {
e.printStackTrace();
}
bluetooth.ExcuteDisconnect(context); bluetooth.ExcuteDisconnect(context);
result.success(true); result.success(true);
} }

@ -168,26 +168,18 @@ public class PrintAsOrder {
PrinterHelper.printAreaSize("0", "200", "200", "800", "1"); PrinterHelper.printAreaSize("0", "200", "200", "800", "1");
//PrinterHelper.Encoding("gb2312"); //PrinterHelper.Encoding("gb2312");
PrinterHelper.Box("0","10","575","790","3"); PrinterHelper.Box("0","10","575","790","3");
PrinterHelper.Line("0", "160", "575", "160", "3"); PrinterHelper.Line("0", "160", "575", "160", "3");
PrinterHelper.Line("0", "400", "575", "400", "3"); PrinterHelper.Line("0", "400", "575", "400", "3");
PrinterHelper.Line("0", "560", "575", "560", "3"); PrinterHelper.Line("0", "560", "575", "560", "3");
PrinterHelper.Line("380", "360", "540", "200", "3"); PrinterHelper.Line("380", "360", "540", "200", "3");
PrinterHelper.Line("333", "160", "333", "400", "3"); PrinterHelper.Line("333", "160", "333", "400", "3");
PrinterHelper.SetBold("3");
PrinterHelper.SetMag("5","5");
PrinterHelper.Align(PrinterHelper.CENTER);
//PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", "0", "55", code);
PrinterHelper.PrintTextCPCL(PrinterHelper.TEXT,60,"0","55",code,1,false,0);
// PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", "100", "0", code);
// PrinterHelper.Text(PrinterHelper.TEXT, "24", "0", "200", "0", code);
PrinterHelper.Align(PrinterHelper.CENTER);
PrinterHelper.SetBold("4");
PrinterHelper.SetMag("5","5");
PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", "0", "55", code);
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
@ -197,28 +189,38 @@ public class PrintAsOrder {
PrinterHelper.SetBold("3"); PrinterHelper.SetBold("3");
PrinterHelper.SetMag(cMultiple,cMultiple); PrinterHelper.SetMag(cMultiple,cMultiple);
PrinterHelper.Text(PrinterHelper.TEXT,cSize , "0",String.valueOf(cx), String.valueOf(cy), country); PrinterHelper.Text(PrinterHelper.TEXT,cSize , "0",String.valueOf(cx), String.valueOf(cy), country);
PrinterHelper.Align(PrinterHelper.LEFT);
if(!country1.isEmpty()){ if(!country1.isEmpty()){
PrinterHelper.Text(PrinterHelper.TEXT,cSize , "0",String.valueOf(cx1), String.valueOf(cy1), country1); PrinterHelper.Text(PrinterHelper.TEXT,cSize , "0",String.valueOf(cx1), String.valueOf(cy1), country1);
} }
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.SetBold("2");
PrinterHelper.SetMag("2.5","2.5");
PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", "390", "210", num);
PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", String.valueOf(500-sum.length()*10), String.valueOf(315), sum);
PrinterHelper.Align(PrinterHelper.LEFT);
PrinterHelper.SetBold("2");
PrinterHelper.SetMag("3","3");
PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", "390", "210", num);
PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", String.valueOf(500-sum.length()*10), String.valueOf(315), sum);
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.Align(PrinterHelper.CENTER); PrinterHelper.Align(PrinterHelper.CENTER);
printBarCode(barCode,"0","590"); printBarCode(barCode,"0","590");
PrinterHelper.Align(PrinterHelper.CENTER);
PrinterHelper.SetMag("2","2");
PrinterHelper.Text(PrinterHelper.TEXT,"55" , "0","0", "730", barCode);
PrinterHelper.SetMag("1","1");
// PrinterHelper.SetBold("2"); PrinterHelper.Align(PrinterHelper.CENTER);
PrinterHelper.SetMag("2","2"); PrinterHelper.SetMag("2","2");
PrinterHelper.Text(PrinterHelper.TEXT,"3" , "0","0", String.valueOf(channelY), channel); PrinterHelper.Text(PrinterHelper.TEXT,"3" , "0","0", String.valueOf(channelY), channel);
@ -228,6 +230,9 @@ public class PrintAsOrder {
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.Form(); PrinterHelper.Form();
PrinterHelper.Print(); PrinterHelper.Print();
} catch (Exception e) { } catch (Exception e) {
@ -247,7 +252,7 @@ public class PrintAsOrder {
width = "1"; width = "1";
} }
try { try {
PrinterHelper.Barcode(PrinterHelper.BARCODE, PrinterHelper.code128, width, "0", "130", x, y, true, "15", "15", "15", code); PrinterHelper.Barcode(PrinterHelper.BARCODE, PrinterHelper.code128, width, "0", "130", x, y, false, "15", "15", "15", code);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -269,22 +274,21 @@ public class PrintAsOrder {
PrinterHelper.Line("380", "360", "540", "200", "3"); PrinterHelper.Line("380", "360", "540", "200", "3");
PrinterHelper.Line("333", "160", "333", "400", "3"); PrinterHelper.Line("333", "160", "333", "400", "3");
PrinterHelper.SetBold("3");
PrinterHelper.SetMag("5","5");
PrinterHelper.Align(PrinterHelper.CENTER); PrinterHelper.Align(PrinterHelper.CENTER);
PrinterHelper.Text(PrinterHelper.TEXT, "1", "0", "0", "55", code); PrinterHelper.SetBold("4");
PrinterHelper.SetMag("5","5");
// PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", "100", "0", code);
// PrinterHelper.Text(PrinterHelper.TEXT, "24", "0", "200", "0", code);
PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", "0", "55", code);
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.Align(PrinterHelper.LEFT); PrinterHelper.Align(PrinterHelper.LEFT);
PrinterHelper.SetBold("3"); PrinterHelper.SetBold("3");
@ -294,17 +298,30 @@ public class PrintAsOrder {
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.Align(PrinterHelper.LEFT);
PrinterHelper.SetBold("2"); PrinterHelper.SetBold("2");
PrinterHelper.SetMag("2.5","2.5"); PrinterHelper.SetMag("3","3");
PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", "390", "210", num); PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", "390", "210", num);
PrinterHelper.Text(PrinterHelper.TEXT, "50", "0", String.valueOf(500-sum.length()*10), String.valueOf(315), sum); PrinterHelper.Text(PrinterHelper.TEXT, "55", "0", String.valueOf(500-sum.length()*10), String.valueOf(315), sum);
closeBold(); closeBold();
PrinterHelper.SetMag("1","1"); PrinterHelper.SetMag("1","1");
PrinterHelper.Align(PrinterHelper.CENTER); PrinterHelper.Align(PrinterHelper.CENTER);
printBarCode(barCode,"0","520"); printBarCode(barCode,"0","520");
PrinterHelper.Align(PrinterHelper.CENTER);
PrinterHelper.SetMag("2","2");
PrinterHelper.Text(PrinterHelper.TEXT,"55" , "0","0", "660", barCode);
PrinterHelper.SetMag("1","1");
PrinterHelper.Form(); PrinterHelper.Form();

@ -1,6 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hy_printer/device.dart'; import 'package:hy_printer/device.dart';
import 'package:hy_printer/dj_printer.dart'; import 'package:hy_printer/dj_printer.dart';
@ -79,126 +79,16 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) {return MaterialApp( Widget build(BuildContext context) {return MaterialApp(
home: Scaffold( title: '安速货运',
appBar: AppBar( builder: (context, widget) {
title: const Text('Plugin example app'), // ScreenUtil.setContext(context);
), return MediaQuery(
body: Center( data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Column( child: BotToastInit().call(context, widget));
children: [ },
TextButton( navigatorObservers: [BotToastNavigatorObserver()],
onPressed: () { home: const ScanPage()
devices.clear();
setState(() {});
DjPrinter().startSearch;
},
child: const Text('扫描设备')),
// TextButton(onPressed: () {}, child: const Text('打印')),
const SizedBox(
height: 20,
),
...devices
.map((e) => TextButton(
onPressed: ()async {
// [Permission.bluetoothConnect,].request().then((value) async {
// print("===============${value[Permission.bluetoothConnect]}");
// if(value[Permission.bluetoothConnect]!=PermissionStatus.denied){
//
// }
// });
await DjPrinter().connect(e.address);
//
},
child: Column(
children: [
Text(e.name),
Text(e.address),
],
)))
.toList(),
const SizedBox(
height: 20,
),
TextButton(
onPressed: () {
// DjPrinter().printNewAScode(
// code: 'ASSZ000000002',
// barCode: 'ASSZ0000000020001',
// channel: '加拿大温哥华海派快线-',
// country: '美国',
// num: '2',
// sum:'9',
// offset: 0,
// hasPlan: true, );
DjPrinter().printNewAScode(
code: 'ASSZ000000002',
barCode: 'ASSZ0000000020001',
channel: '加拿大温哥华海派快线-卡派 / UPS派送',
country: '美国啊啊',
num: '2',
sum:'999',
offset: 0,
hasPlan: true, );
// DjPrinter().printNewAScode(
// code: 'ASSZ000000002',
// barCode: 'ASSZ0000000020001',
// channel: '加拿大温哥华海派快线-卡派 / UPS派送',
// country: '捷克斯洛伐克',
// num: '2',
// sum:'99',
// offset: 0,
// hasPlan: true, );
},
child: const Text('打印')),
TextButton(
onPressed: () {
// DjPrinter().printNewAScode(
// code: 'ASSZ000000002',
// barCode: 'ASSZ0000000020001',
// channel: '加拿大温哥华海派快线-',
// country: '美国',
// num: '2',
// sum:'9',
// offset: 0,
// hasPlan: true, );
DjPrinter().printNewAScode(
code: 'ASSZ000000002',
barCode: 'ASSZ0000000020001',
channel: '加拿大温哥华海派快线-卡派 / UPS派送',
country: '美国啊啊',
num: '2',
sum:'999',
offset: 0,
hasPlan: false, );
// DjPrinter().printNewAScode(
// code: 'ASSZ000000002',
// barCode: 'ASSZ0000000020001',
// channel: '加拿大温哥华海派快线-卡派 / UPS派送',
// country: '捷克斯洛伐克',
// num: '2',
// sum:'99',
// offset: 0,
// hasPlan: true, );
},
child: const Text('noplan打印')),
const SizedBox(
height: 20,
),
TextButton(
onPressed: () {
DjPrinter().disposeConnect();
},
child: const Text('取消链接')),
],
),
),
),
); );
} }
} }

@ -1,52 +1,198 @@
// import 'package:flutter/material.dart'; import 'dart:convert';
// import 'package:hy_printer/device.dart';
// import 'package:hy_printer/hy_printer.dart'; import 'package:bot_toast/bot_toast.dart';
// import 'package:flutter/material.dart';
// class ScanPage extends StatefulWidget { import 'package:hy_printer/device.dart';
// const ScanPage({Key? key}) : super(key: key); import 'package:hy_printer/dj_printer.dart';
// import 'package:hy_printer/hy_printer.dart';
// @override
// _ScanPageState createState() => _ScanPageState(); class ScanPage extends StatefulWidget {
// } const ScanPage({Key? key}) : super(key: key);
//
// class _ScanPageState extends State<ScanPage> { @override
// List<Device> _devices = []; _ScanPageState createState() => _ScanPageState();
// }
// @override
// void initState() { class _ScanPageState extends State<ScanPage> {
// HyPrinter.init(); List<Device> devices = [];
// init(); var cancel;
// super.initState(); @override
// } void initState() {
// super.initState();
// Future init() async { initPlatformState();
// _devices = await HyPrinter.getDeiveces(); }
// setState(() {});
// } // Future<void> initPlatformState() async {
// // if (!mounted) return;
// @override // setState(() {});
// Widget build(BuildContext context) { // }
// return Scaffold( Future<void> initPlatformState() async {
// appBar: AppBar( // var per = await Permission.bluetooth.isGranted;
// title: const Text('设备列表'), // if (!per) {
// ), // Permission.bluetooth.request();
// body: ListView( // }
// padding: const EdgeInsets.all(10), // var pers = await Permission.locationWhenInUse.isGranted;
// children: _devices // if (!pers) {
// .map((e) => TextButton( // Permission.locationWhenInUse.request();
// onPressed: () async { // }
// var result = await HyPrinter.connect('04:7F:0E:95:FD:A1'); // var per1 = await Permission.bluetoothScan.isGranted;
// if (result == 0) { // if (!per1) {
// Navigator.pop(context); // Permission.bluetoothScan.request();
// } // }
// }, // var per2 = await Permission.bluetoothConnect.isGranted;
// child: Column( // if (!per2) {
// children: [ // Permission.bluetoothConnect.request();
// Text(e.name), // }
// Text(e.address),
// ], DjPrinter().init();
// ))) DjPrinter().addDiscoveryListen(onReceive: (data) {
// .toList()), var js = json.decode(data.toString());
// ); if ((js['name'] as String).startsWith('HM')) {
// } devices.add(Device(
// } name: js['name'],
address: js['address'],
isPaired: js['isPaired']));
}
setState(() {});
}, onStart: () {
print("————————————————————————");
}, onFinish: () {
print('——————————————————————————————');
DjPrinter().cancelDiscovery();
cancel();
});
DjPrinter().addConnectListen(onConnect: () {
print("connected");
}, onDisconnect: () {
print('disconnected');
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('设备列表'),
),
body: Center(
child: Column(
children: [
TextButton(
onPressed: () {
devices.clear();
setState(() {});
cancel =
BotToast.showLoading(wrapToastAnimation: (controller, func, child) {
return discoveryLoadingWidget();
});
DjPrinter().startSearch;
},
child: const Text('扫描设备')),
// TextButton(onPressed: () {}, child: const Text('打印')),
const SizedBox(
height: 20,
),
...devices
.map((e) => TextButton(
onPressed: ()async {
BotToast.showLoading(wrapToastAnimation: (controller, func, child) {
return discoveryLoadingWidget();
});
int? value = await DjPrinter().connect(e.address);
Future.delayed(Duration(seconds: 3), () async {
if(value==0){
BotToast.closeAllLoading();
}else{
BotToast.closeAllLoading();
}
});
},
child: Column(
children: [
Text(e.name),
Text(e.address),
],
)))
.toList(),
const SizedBox(
height: 20,
),
TextButton(
onPressed: () {
DjPrinter().printNewAScode(
code: 'ASSZ000000002',
barCode: 'ASSZ0000000020001',
channel: '加拿大温哥华海派快线-卡派 / UPS派送',
country: '美国啊啊',
num: '2',
sum:'99',
offset: 0,
hasPlan: true, );
},
child: const Text('nocode打印')),
TextButton(
onPressed: () {
DjPrinter().printNewAScode(
code: 'ASSZ000000002',
barCode: 'ASSZ0000000020001',
channel: '加拿大温哥华海派快线-卡派 / UPS派送',
country: '美国',
num: '2',
sum:'999',
offset: 0,
hasPlan: false, );
},
child: const Text('noplan打印')),
const SizedBox(
height: 20,
),
TextButton(
onPressed: () {
DjPrinter().disposeConnect();
},
child: const Text('取消链接')),
],
),
),
);
}
Container discoveryLoadingWidget() {
return Container(
padding: const EdgeInsets.all(15),
decoration: const BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(
backgroundColor: Colors.white,
),
Text(
'扫描中……请稍作等待',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
)
],
),
);
}
}

@ -5,56 +5,63 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.8.2" version: "2.8.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
bot_toast:
dependency: "direct main"
description:
name: bot_toast
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.16.0" version: "1.16.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
flutter: flutter:
@ -66,7 +73,7 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
flutter_test: flutter_test:
@ -85,35 +92,35 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.11" version: "0.12.11"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
sky_engine: sky_engine:
@ -125,49 +132,49 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.2" version: "1.8.2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.9" version: "0.4.9"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
sdks: sdks:

@ -29,7 +29,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
bot_toast: ^4.0.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

@ -78,14 +78,14 @@ class DjPrinter {
bool get hasInit => _hasInit; bool get hasInit => _hasInit;
Future<bool?> connect(String address) async { Future<int?> connect(String address) async {
await Future.delayed(const Duration(milliseconds: 2000), () async { await Future.delayed(const Duration(milliseconds: 2000), () async {
var res = await _channel.invokeMethod('connect', {'address': address}); var res = await _channel.invokeMethod('connect', {'address': address});
print('connect'); print('connect');
print(res); print(res);
return res;
}); });
return true;
} }
void disposeDiscovery() { void disposeDiscovery() {

@ -5,49 +5,49 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.8.2" version: "2.8.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.16.0" version: "1.16.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
flutter: flutter:
@ -59,7 +59,7 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
flutter_test: flutter_test:
@ -71,35 +71,35 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.11" version: "0.12.11"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
sky_engine: sky_engine:
@ -111,49 +111,49 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.2" version: "1.8.2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.9" version: "0.4.9"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
sdks: sdks:

Loading…
Cancel
Save