Skip to content

Instantly share code, notes, and snippets.

@ijoschek ijoschek/.\lib\main.dart Secret
Last active Aug 25, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.