-
-
Save ijoschek/a68e5ae99ea41509c847688bd99d5100 to your computer and use it in GitHub Desktop.
flutter_qrreader_tut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:qr_mobile_vision/qr_camera.dart'; | |
//... | |
class _MyHomePageState extends State<MyHomePage> { | |
//... | |
_qrCallback(String code) {} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
//... | |
body: _camState | |
? Center( | |
child: SizedBox( | |
width: 512, | |
height: 1024, | |
child: QrCamera( | |
onError: (context, error) => Text( | |
error.toString(), | |
style: TextStyle(color: Colors.red), | |
), | |
qrCodeCallback: (code) { | |
_qrCallback(code); | |
}, | |
), | |
), | |
) | |
: Center( | |
child: Text(_qrInfo), | |
), | |
//... | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment