Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QRCode generation for specific uses #219

Open
FMorschel opened this issue May 27, 2024 · 1 comment
Open

QRCode generation for specific uses #219

FMorschel opened this issue May 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@FMorschel
Copy link

Is your feature request related to a problem? Please describe.
There is a site: https://br.qr-code-generator.com/ and some others that do the same. They have a list of different QRCodes that they support such as "V-Card", "WIFI", etc. Today if I'd like to do this with this package I'd have to manually implement these options.

Describe the solution you'd like
I'd like an API for me to create these QRCodes for some of these options (like WIFI, V-Card, etc).

Describe alternatives you've considered
Manually implement those defaults myself and give the result to the QR code generator API.

@FMorschel FMorschel added the enhancement New feature or request label May 27, 2024
@colmex
Copy link

colmex commented Nov 8, 2024

For anyone else that comes across this I managed to do it with this bit of code:

import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:qr_flutter/qr_flutter.dart';

class WifiQRCode extends ConsumerWidget {
  final String ssid;
  final String password;
  final String encryption;

  const WifiQRCode({
    super.key,
    required this.ssid,
    required this.password,
    required this.encryption,
  });

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    // Format the WiFi QR data string
    final wifiData = 'WIFI:T:$encryption;S:$ssid;P:$password;;';

    return QrImageView(
      data: wifiData,
      version: QrVersions.auto,
    );
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants