Browse Source

fixed share issue on ipad

pull/30/head
Khoren Markosyan 2 years ago
parent
commit
151504db51
  1. 2
      CHANGELOG.md
  2. 4
      analysis_options.yaml
  3. 2
      example/pubspec.lock
  4. 2
      zxscanner/lib/pages/barcodes_page.dart
  5. 17
      zxscanner/lib/pages/creator_page.dart

2
CHANGELOG.md

@ -1,3 +1,5 @@
# Changelog
## 0.8.0 ## 0.8.0
* added ability to set localization messages for `writer_widget` * added ability to set localization messages for `writer_widget`

4
analysis_options.yaml

@ -26,10 +26,6 @@ analyzer:
# Turned off until null-safe rollout is complete. # Turned off until null-safe rollout is complete.
unnecessary_null_comparison: warning unnecessary_null_comparison: warning
exclude: exclude:
- "zxscanner/**"
- "bin/cache/**"
# Ignore protoc generated files
- "dev/conductor/lib/proto/*"
- "lib/generated_bindings.dart" - "lib/generated_bindings.dart"
linter: linter:

2
example/pubspec.lock

@ -141,7 +141,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "0.7.4" version: "0.8.0"
font_awesome_flutter: font_awesome_flutter:
dependency: "direct main" dependency: "direct main"
description: description:

2
zxscanner/lib/pages/barcodes_page.dart

@ -1,5 +1,3 @@
import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';

17
zxscanner/lib/pages/creator_page.dart

@ -84,17 +84,28 @@ class _CreatorPageState extends State<CreatorPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
ElevatedButton( Builder(builder: (BuildContext context) {
return ElevatedButton(
onPressed: () { onPressed: () {
// Save image to device // Save image to device
final File file = File(tempPath); final File file = File(tempPath);
file.writeAsBytesSync(encode?.data ?? Uint8List(0)); file.writeAsBytesSync(encode?.data ?? Uint8List(0));
final String path = file.path; final String path = file.path;
// Share image // Share image
Share.shareFiles(<String>[path]); final RenderBox? box =
context.findRenderObject() as RenderBox?;
if (box != null) {
Share.shareFiles(
<String>[path],
sharePositionOrigin:
box.localToGlobal(Offset.zero) & box.size,
);
}
}, },
child: const Text('Share'), child: const Text('Share'),
), );
}),
ElevatedButton( ElevatedButton(
onPressed: () async { onPressed: () async {
if (encode != null) { if (encode != null) {

Loading…
Cancel
Save