Skip to content

Commit

Permalink
Merge pull request #58 from truonghoangduy/master
Browse files Browse the repository at this point in the history
fix: `ble_scan_android`  hot fix scanning mode, location services in android platfrom
  • Loading branch information
truonghoangduy authored Mar 21, 2022
2 parents d80c64e + 1911027 commit c4c73d1
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 42 deletions.
18 changes: 18 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ PODS:
- GoogleUtilities/UserDefaults (~> 7.7)
- PromisesObjC (< 3.0, >= 1.2)
- Flutter (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- google_ml_kit (0.6.0):
- Flutter
- GoogleMLKit/BarcodeScanning (~> 2.2.0)
Expand Down Expand Up @@ -184,6 +187,8 @@ PODS:
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- path_provider_ios (0.0.1):
- Flutter
- "permission_handler (5.1.0+2)":
- Flutter
- PromisesObjC (2.0.0)
Expand All @@ -195,6 +200,9 @@ PODS:
- SwiftProtobuf (~> 1.0)
- shared_preferences_ios (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- SSZipArchive (2.4.3)
- SwiftProtobuf (1.18.0)
- TensorFlowLiteC (2.7.0):
Expand All @@ -214,9 +222,11 @@ DEPENDENCIES:
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
- google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- tflite (from `.symlinks/plugins/tflite/ios`)

SPEC REPOS:
Expand All @@ -225,6 +235,7 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FMDB
- GoogleDataTransport
- GoogleMLKit
- GoogleToolboxForMac
Expand Down Expand Up @@ -272,12 +283,16 @@ EXTERNAL SOURCES:
:path: Flutter
google_ml_kit:
:path: ".symlinks/plugins/google_ml_kit/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
reactive_ble_mobile:
:path: ".symlinks/plugins/reactive_ble_mobile/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
tflite:
:path: ".symlinks/plugins/tflite/ios"

Expand All @@ -291,6 +306,7 @@ SPEC CHECKSUMS:
FirebaseCoreDiagnostics: c2836d254a8f0bbb4121ff18f2c2ea39d118fd08
FirebaseInstallations: 60edbf7e11d91ae4c751d26c200dfd037099abe0
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
google_ml_kit: a85eefb9ea6156b27ee2fba2b71e461e7b26a4f6
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
GoogleMLKit: 85ffdc9641d05311c76dbba5bbf93059087be12f
Expand Down Expand Up @@ -319,12 +335,14 @@ SPEC CHECKSUMS:
MLKitVisionKit: 226bac429eda1d84285409e31ce9da72606850fb
MLKitXenoCommon: bf5b3528d77cabe0d04f3c13536ba1302346e31c
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Protobuf: 0ac2cdc92fb5c33dab66dd1c4e9f9cc4c34d00ba
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
SwiftProtobuf: c3c12645230d9b09c72267e0de89468c5543bd86
TensorFlowLiteC: 50d75ed3640c15dcfbaf88ca4326297b445e00a1
Expand Down
5 changes: 4 additions & 1 deletion lib/blocs/ble_scan/bloc/ble_scan_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class BleScanBloc extends Bloc<BleScanEvent, BleScanState> {
try {
emitter(BleScanState.load());
scanSubscription = repository.ble
.scanForDevices(withServices: ble_constants.deviceServices)
.scanForDevices(
withServices: ble_constants.deviceServices,
scanMode: ScanMode.lowLatency,
requireLocationServicesEnabled: false)
.listen((data) {
if (data.name == ble_constants.DEVICE_NAME) {
device = data;
Expand Down
2 changes: 1 addition & 1 deletion lib/services/tensorflow_service/qr_code_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GoogleMLKitQRService extends ITensorFlowCommon<InputImage, String> {
var qrRecognitions = await _barcodeScanner.processImage(data);
for (var element in qrRecognitions) {
sink.add(element.value.rawValue!);
// print(element.value.rawValue);
print(element.value.rawValue);
}
isBusy = false;
return;
Expand Down
90 changes: 52 additions & 38 deletions lib/widgets/confirm/organization_confirm.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gateway/config/themes/gateway_color.dart';
import 'package:gateway/generated/locale_keys.g.dart';
import 'package:gateway/model/organization_info.dart';
import 'package:shimmer/shimmer.dart';

class OrganizationConfirm extends StatefulWidget {
const OrganizationConfirm({Key? key,
required this.organizationInfo,
required this.callBack,
}) : super(key: key);
const OrganizationConfirm({
Key? key,
required this.organizationInfo,
required this.callBack,
}) : super(key: key);
final Function callBack;
final OrganizationInfo organizationInfo;

Expand All @@ -26,9 +29,19 @@ class _OrganizationConfirmState extends State<OrganizationConfirm> {
SizedBox(
width: 277.w,
height: 138.h,
child: Image.network(
widget.organizationInfo.imageUrl.toString(),
child: CachedNetworkImage(
imageUrl: widget.organizationInfo.imageUrl.toString(),
fit: BoxFit.cover,
placeholder: (context, url) {
return Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
width: 277.w,
height: 138.h,
),
);
},
),
),
Padding(
Expand Down Expand Up @@ -79,40 +92,41 @@ class _OrganizationConfirmState extends State<OrganizationConfirm> {
],
),
SizedBox(height: 24.h),
thisOrganization ?
Align(
alignment: Alignment.bottomRight,
child: InkWell(
onTap: () {
widget.callBack();
setState(() {
thisOrganization = !thisOrganization;
});
},
child: Container(
width: 186.w,
height: 36.h,
decoration: BoxDecoration(
color: GatewayColors.bgButtonColorHaveBorder,
borderRadius: BorderRadius.circular(8.r),
border: Border.all(
color: GatewayColors.buttonBgLight,
width: 1.h,
),
),
child: Center(
child: Text(
LocaleKeys.this_is_my_organization.tr(),
style: TextStyle(
color: Colors.black87,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
thisOrganization
? Align(
alignment: Alignment.bottomRight,
child: InkWell(
onTap: () {
widget.callBack();
setState(() {
thisOrganization = !thisOrganization;
});
},
child: Container(
width: 186.w,
height: 36.h,
decoration: BoxDecoration(
color: GatewayColors.bgButtonColorHaveBorder,
borderRadius: BorderRadius.circular(8.r),
border: Border.all(
color: GatewayColors.buttonBgLight,
width: 1.h,
),
),
child: Center(
child: Text(
LocaleKeys.this_is_my_organization.tr(),
style: TextStyle(
color: Colors.black87,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
),
),
),
),
),
),
),
),
): Container(),
)
: Container(),
],
),
),
Expand Down
Loading

0 comments on commit c4c73d1

Please sign in to comment.