Last active
April 17, 2024 21:25
-
-
Save JosephineAkello/e0e23c7336f66996ba9053a8f108dba2 to your computer and use it in GitHub Desktop.
QR Image -> where QR Code generated is displayed
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_flutter/qr_flutter.dart'; | |
class QRImage extends StatelessWidget { | |
const QRImage(this.controller, {super.key}); | |
final TextEditingController controller; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Flutter + QR code'), | |
centerTitle: true, | |
), | |
body: Center( | |
child: QrImageView( | |
data: controller.text, | |
size: 280, | |
// You can include embeddedImageStyle Property if you | |
//wanna embed an image from your Asset folder | |
embeddedImageStyle: QrEmbeddedImageStyle( | |
size: const Size( | |
100, | |
100, | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment