Replies: 7 comments
-
Try this final myDevice = BluetoothDevice.fromMap({
'name': data['name'],
'address': data['address'],
'type': data['type']
}); |
Beta Was this translation helpful? Give feedback.
-
where do I put this code?
…On Fri, May 14, 2021 at 10:23 AM calimba ***@***.***> wrote:
Try this
final myDevice = BluetoothDevice.fromMap({ 'name': data['name'],
'address': data['address'], 'type': data['type'] });
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#77 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFSGZW6ZK7GOV37JBARXWSDTNTFY3ANCNFSM44JGZBGA>
.
|
Beta Was this translation helpful? Give feedback.
-
Hi Calimba,
Kindly guide on where I should insert this piece of code for the bluetooth
printer to be permanently remembered whenever the printing is done.
On Tue, May 25, 2021 at 4:29 PM ALEXANDER KITHOME ***@***.***>
wrote:
… where do I put this code?
On Fri, May 14, 2021 at 10:23 AM calimba ***@***.***> wrote:
> Try this
> final myDevice = BluetoothDevice.fromMap({ 'name': data['name'],
> 'address': data['address'], 'type': data['type'] });
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#77 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFSGZW6ZK7GOV37JBARXWSDTNTFY3ANCNFSM44JGZBGA>
> .
>
|
Beta Was this translation helpful? Give feedback.
-
I do this void _checkIfLoggedIn() async {
SharedPreferences localStorage = await SharedPreferences.getInstance();
var token = localStorage.getString('token');
var userJson = localStorage.getString('user');
var user = json.decode(userJson);
var stringValue = user['dispositivo'].toString();
var stringValue2 = user['address'].toString();
var stringValue3 = user['tipo'];
if(token != null){
setState(() => {
_isLoggedIn = true,
userData = user,
_dispositivo = stringValue,
_direccion = stringValue2,
_tipo = stringValue3
});
}
if(_direccion != null){
final myDevice = BluetoothDevice.fromMap({
'name': _dispositivo,
'address': _direccion,
'type': _tipo
});
bluetooth.isConnected.then((isConnected) {
if (!isConnected) {
bluetooth.connect(myDevice).catchError((error) {
setState(() {
_connected = false;
});
});
}
});
}
} |
Beta Was this translation helpful? Give feedback.
-
i used the root widget with the widget life cycle mixing to invoke the search and connect and disconnect with the bluetooth device |
Beta Was this translation helpful? Give feedback.
-
Kindly expound.
Regards,
Alex Kithome.
…On Sun, Oct 24, 2021 at 12:05 PM E.Mansur ***@***.***> wrote:
i used the root widget with the widget life cycle mixing to invoke the
search and connect with the bluetooth device
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#77 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFSGZW4SENORXPRWBSZ2HB3UIPD5TANCNFSM44JGZBGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Here is the approach.....
....if you need more explanation here is my |
Beta Was this translation helpful? Give feedback.
-
how can I tie the connected printer so that no need to connect every time the application is loaded.
Beta Was this translation helpful? Give feedback.
All reactions