Create QR Codes Easily with Flutter QR Flutter

Flutter QR is a simple and user-friendly app for generating and sharing QR codes. To create QR codes in Flutter, we'll be using the qr_flutter plugin, which provides an easy way to generate QR codes for website URLs and other types of content. 

In this tutorial, we'll walk through the process of using qr_flutter to create and share QR codes with Flutter QR.


Usage:

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.


Code:

import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';

class QRGenerator extends StatelessWidget {
  final String url;

  QRGenerator({required this.url});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter QR'),
      ),
      body: Center(
        child: QrImage(
          data: url,
          version: QrVersions.auto,
          size: 200.0,
        ),
      ),
    );
  }
}


..


Properties:

  • url (String): The website URL for which to generate the QR code.
..
Flutter Plugins,

Ref:

..

GET source code on Github:

Comments