Skip to content

Commit

Permalink
#74 연결 종료 showSnackbar flag 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
latteishorse committed Aug 3, 2022
1 parent cc98e8d commit 758aced
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/screens/sharing/sharing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ class _DraggableCardState extends State<DraggableCard>
// geolocator
bool servicestatus = false;
bool haspermission = false;
bool isChecked = false;

late LocationPermission permission;
late Position position;
String lng = '', lat = '';
Expand Down Expand Up @@ -425,6 +427,9 @@ class _DraggableCardState extends State<DraggableCard>
Nearby().stopDiscovery();
Nearby().stopAdvertising();
Nearby().stopAllEndpoints();
if (isChecked == false) {
showSnackbar('연결에 실패하였습니다. QR을 시도해주세요.');
}
});
bool a = await Nearby().startAdvertising(
userName,
Expand Down Expand Up @@ -500,6 +505,9 @@ class _DraggableCardState extends State<DraggableCard>
Nearby().stopDiscovery();
Nearby().stopAdvertising();
Nearby().stopAllEndpoints();
if (isChecked == false) {
showSnackbar('연결에 실패하였습니다. QR을 시도해주세요.');
}
});
bool a = await Nearby().startDiscovery(
userName,
Expand Down Expand Up @@ -604,6 +612,9 @@ class _DraggableCardState extends State<DraggableCard>
});
Nearby().acceptConnection(id, onPayLoadRecieved: (endid, payload) async {
if (payload.type == PayloadType.BYTES) {
setState(() {
isChecked = true;
});
Nearby().disconnectFromEndpoint(id);
Nearby().stopDiscovery();
Nearby().stopAdvertising();
Expand Down

0 comments on commit 758aced

Please sign in to comment.