Skip to content

Instantly share code, notes, and snippets.

@JosephineAkello
Last active April 17, 2024 21:25
Show Gist options
  • Save JosephineAkello/e0e23c7336f66996ba9053a8f108dba2 to your computer and use it in GitHub Desktop.
Save JosephineAkello/e0e23c7336f66996ba9053a8f108dba2 to your computer and use it in GitHub Desktop.
QR Image -> where QR Code generated is displayed
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