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
* 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.
unnecessary_null_comparison: warning
exclude:
- "zxscanner/**"
- "bin/cache/**"
# Ignore protoc generated files
- "dev/conductor/lib/proto/*"
- "lib/generated_bindings.dart"
linter:

2
example/pubspec.lock

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

2
zxscanner/lib/pages/barcodes_page.dart

@ -1,5 +1,3 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter/services.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(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
ElevatedButton(
Builder(builder: (BuildContext context) {
return ElevatedButton(
onPressed: () {
// Save image to device
final File file = File(tempPath);
file.writeAsBytesSync(encode?.data ?? Uint8List(0));
final String path = file.path;
// 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'),
),
);
}),
ElevatedButton(
onPressed: () async {
if (encode != null) {

Loading…
Cancel
Save