Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active August 25, 2019 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoschek/a68e5ae99ea41509c847688bd99d5100 to your computer and use it in GitHub Desktop.
Save ijoschek/a68e5ae99ea41509c847688bd99d5100 to your computer and use it in GitHub Desktop.
flutter_qrreader_tut
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