Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esc_pos_print_plus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
esc_pos_print_plus
Commits
96ba0941
Commit
96ba0941
authored
Jan 15, 2020
by
Andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring
parent
aa490654
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
main.dart
example/blue/lib/main.dart
+1
-7
No files found.
example/blue/lib/main.dart
View file @
96ba0941
...
...
@@ -38,10 +38,6 @@ class _MyHomePageState extends State<MyHomePage> {
List
<
BluetoothDevice
>
_devices
=
[];
StreamSubscription
_scanResultsSubscription
;
StreamSubscription
_isScanningSubscription
;
// Buffers used for rescan before sending the data
List
<
BluetoothDevice
>
_bufDevices
=
[];
StreamSubscription
_bufScanSubscription
;
// StreamSubscription _isScanningSubscription;
void
_startScanDevices
()
{
setState
(()
{
...
...
@@ -59,7 +55,7 @@ class _MyHomePageState extends State<MyHomePage> {
_isScanningSubscription
=
bluetoothManager
.
isScanning
.
listen
((
isScanningCurrent
)
async
{
//
i
f isScanning value changed (scan just stopped)
//
I
f isScanning value changed (scan just stopped)
if
(
_isScanning
&&
!
isScanningCurrent
)
{
_scanResultsSubscription
.
cancel
();
_isScanningSubscription
.
cancel
();
...
...
@@ -81,12 +77,10 @@ class _MyHomePageState extends State<MyHomePage> {
void
_testPrint
(
BluetoothDevice
printer
)
async
{
const
int
timeout
=
5
;
if
(
_isScanning
)
{
// print('Print failed (scanning in progress)');
showToast
(
'Print failed (scanning in progress)'
);
return
;
}
if
(
_isPrinting
)
{
// print('Print failed (another printing in progress)');
showToast
(
'Print failed (another printing in progress)'
);
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment