Browse Source

bug fixes

pull/3/head
Khoren Markosyan 3 years ago
parent
commit
e006104795
  1. 4
      example/pubspec.lock
  2. 9
      lib/reader_widget.dart
  3. 2
      lib/writer_widget.dart
  4. 2
      pubspec.yaml
  5. 2
      zxscanner/lib/pages/creator_page.dart
  6. 26
      zxscanner/pubspec.lock
  7. 6
      zxscanner/pubspec.yaml

4
example/pubspec.lock

@ -28,7 +28,7 @@ packages:
name: camera
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+24"
version: "0.9.5+1"
camera_platform_interface:
dependency: transitive
description:
@ -197,7 +197,7 @@ packages:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+2"
version: "0.8.5+4"
image_picker_platform_interface:
dependency: transitive
description:

9
lib/reader_widget.dart

@ -41,6 +41,7 @@ class _ReaderWidgetState extends State<ReaderWidget>
with TickerProviderStateMixin {
List<CameraDescription>? cameras;
CameraController? controller;
var _cameraOn = false;
bool isAndroid() => Theme.of(context).platform == TargetPlatform.android;
@ -79,9 +80,11 @@ class _ReaderWidgetState extends State<ReaderWidget>
}
if (mounted) {
if (message == AppLifecycleState.paused.toString()) {
cameraController.dispose();
_cameraOn = false;
setState(() {});
}
if (message == AppLifecycleState.resumed.toString()) {
_cameraOn = true;
onNewCameraSelected(cameraController.description);
}
}
@ -121,6 +124,7 @@ class _ReaderWidgetState extends State<ReaderWidget>
});
if (mounted) {
_cameraOn = true;
setState(() {});
}
@ -198,7 +202,8 @@ class _ReaderWidgetState extends State<ReaderWidget>
if (cameras != null && cameras?.isEmpty == true) {
return const Text('No cameras found');
} else if (cameraController == null ||
!cameraController.value.isInitialized) {
!cameraController.value.isInitialized ||
!_cameraOn) {
return const CircularProgressIndicator();
} else {
final size = MediaQuery.of(context).size;

2
lib/writer_widget.dart

@ -12,7 +12,7 @@ class WriterWidget extends StatefulWidget {
this.onError,
}) : super(key: key);
final Function(EncodeResult, Uint8List)? onSuccess;
final Function(EncodeResult, Uint8List?)? onSuccess;
final Function(String)? onError;
@override

2
pubspec.yaml

@ -8,7 +8,7 @@ environment:
flutter: ">=2.5.0"
dependencies:
camera: ^0.9.4
camera: ^0.9.5
ffi: ^1.2.1
flutter:
sdk: flutter

2
zxscanner/lib/pages/creator_page.dart

@ -77,7 +77,7 @@ class _CreatorPageState extends State<CreatorPage> {
return Column(
children: [
// Barcode image
Image.memory(encode?.data ?? Uint8List(0)),
if (encode?.data != null) Image.memory(encode?.data ?? Uint8List(0)),
const SizedBox(height: spaceLarge),
// Share button
Row(

26
zxscanner/pubspec.lock

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "38.0.0"
version: "40.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "3.4.1"
version: "4.1.0"
archive:
dependency: transitive
description:
@ -77,7 +77,7 @@ packages:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.10"
version: "2.1.11"
build_runner_core:
dependency: transitive
description:
@ -105,7 +105,7 @@ packages:
name: camera
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+24"
version: "0.9.5+1"
camera_platform_interface:
dependency: transitive
description:
@ -325,7 +325,7 @@ packages:
name: flutter_mobx
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5+1"
version: "2.0.6+1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@ -370,7 +370,7 @@ packages:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.3"
glob:
dependency: transitive
description:
@ -391,7 +391,7 @@ packages:
name: hive
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.1"
hive_flutter:
dependency: "direct main"
description:
@ -405,7 +405,7 @@ packages:
name: hive_generator
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
version: "1.1.3"
http:
dependency: transitive
description:
@ -461,7 +461,7 @@ packages:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+2"
version: "0.8.5+4"
image_picker_platform_interface:
dependency: transitive
description:
@ -552,21 +552,21 @@ packages:
name: mobx
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.0.7+2"
mobx_codegen:
dependency: "direct dev"
description:
name: mobx_codegen
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6+1"
version: "2.0.7"
nb_utils:
dependency: "direct main"
description:
name: nb_utils
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.1"
version: "4.5.2"
nm:
dependency: transitive
description:
@ -970,7 +970,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.2"
version: "2.6.1"
xdg_directories:
dependency: transitive
description:

6
zxscanner/pubspec.yaml

@ -20,13 +20,13 @@ dependencies:
flutter_zxing:
path: ../
font_awesome_flutter: ^10.1.0
hive: ^2.1.0
hive: ^2.2.1
hive_flutter: ^1.1.0
image: ^3.1.3
image_picker: ^0.8.5
intl: ^0.17.0
mobx: ^2.0.7
nb_utils: ^4.5.1
nb_utils: ^4.5.2
path_provider: ^2.0.10
share_plus: ^4.0.4
@ -35,7 +35,7 @@ flutter_intl:
enabled: true
dev_dependencies:
build_runner: ^2.1.10
build_runner: ^2.1.11
flutter_lints: ^2.0.1
flutter_test:
sdk: flutter

Loading…
Cancel
Save