|
|
@@ -89,23 +89,23 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
bluetooth.getEchannel().receiveBroadcastStream().listen(onEvent, onError: onError);
|
|
|
bluetooth.isEnableBluetooth().then((value){//如果蓝牙打开的情况下去拿缓存的蓝牙相关数据
|
|
|
if(value){
|
|
|
- getKey('check').then((value) {
|
|
|
- if (value == null) {
|
|
|
- setState(() {
|
|
|
- check = false;
|
|
|
- });
|
|
|
- } else if (value == 'false') {
|
|
|
- setState(() {
|
|
|
- check = false;
|
|
|
- });
|
|
|
- } else if (value == 'true') {
|
|
|
- setState(() {
|
|
|
- check = true;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ // getKey('check').then((value) {
|
|
|
+ // if (value == null) {
|
|
|
+ // setState(() {
|
|
|
+ // check = false;
|
|
|
+ // });
|
|
|
+ // } else if (value == 'false') {
|
|
|
+ // setState(() {
|
|
|
+ // check = false;
|
|
|
+ // });
|
|
|
+ // } else if (value == 'true') {
|
|
|
+ // setState(() {
|
|
|
+ // check = true;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
getKey('btList').then((value) {
|
|
|
- if (value != '' && check == true) {
|
|
|
+ //if (value != '') {
|
|
|
List tempList = [];
|
|
|
for (int i = 0; i < 999; i++) {
|
|
|
if (value.indexOf('&') != -1) {
|
|
|
@@ -129,7 +129,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ //}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -462,6 +462,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
btLinkStatus = false;
|
|
|
});
|
|
|
setKey('check', 'true');
|
|
|
+ setKey('checkedBt','');
|
|
|
bluetooth.scanBT(); //
|
|
|
});
|
|
|
});
|
|
|
@@ -541,7 +542,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
Widget _btList() {
|
|
|
return Container(
|
|
|
padding: EdgeInsets.all(ScreenUtil.getInstance().setHeight(30)),
|
|
|
- child: (btList.length > 0 && check == true) ? ListView.builder(
|
|
|
+ child: (btList.length > 0) ? ListView.builder(
|
|
|
itemCount: btList.length,
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
return _btItem(btList[index], index);
|