Skip to content
Snippets Groups Projects
Commit 8d23b1b2 authored by vjrj's avatar vjrj
Browse files

Fix for #20

parent 0e41419b
No related branches found
No related tags found
No related merge requests found
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jsqr/scanner.dart'; import 'package:jsqr/scanner.dart';
...@@ -15,20 +16,29 @@ class QrManager { ...@@ -15,20 +16,29 @@ class QrManager {
} }
static Future<String?> _webQrScan(BuildContext context) async { static Future<String?> _webQrScan(BuildContext context) async {
const Scanner sc = Scanner();
final double height = MediaQuery.of(context).size.height - 20;
final double width = MediaQuery.of(context).size.width - 20;
Scanner.vidDiv.style.cssText =
'max-width: ${width}px; max-height: ${height}px; overflow: hidden;';
final String? result = await showDialog( final String? result = await showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
// final double height = MediaQuery.of(context).size.height;
final double width = MediaQuery.of(context).size.width;
return AlertDialog( return AlertDialog(
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(tr('cancel')),
),
],
insetPadding: const EdgeInsets.all(5), insetPadding: const EdgeInsets.all(5),
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0))), borderRadius: BorderRadius.all(Radius.circular(10.0))),
title: const Text('Scan QR Code'), title: const Text('Scan QR Code'),
content: SizedBox( content: SizedBox(height: height, width: width, child: sc),
// height: height - 20,
width: width - 6,
child: const Scanner()),
); );
}); });
return result; return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment