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

9
lib/reader_widget.dart

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

2
lib/writer_widget.dart

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

2
pubspec.yaml

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

2
zxscanner/lib/pages/creator_page.dart

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

26
zxscanner/pubspec.lock

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

6
zxscanner/pubspec.yaml

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

Loading…
Cancel
Save