분류, 패키지 및 저장소 검색

pretty_qr_code 표지
패키지 상세v3.6.0

pretty_qr_code

QR 코드를 쉽게 렌더링할 수 있도록 해주는 매우 사용자 정의 가능한 Flutter 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
21.2만
좋아요
587
Pub 점수
140

패키지 설치

flutter pub add pretty_qr_code

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

간편하게 QR 코드를 렌더링할 수 있는 매우 사용자 정의 가능한 Flutter 위젯입니다. 크기, 색상, 모양 및 로고 통합 옵션을 통해 QR 코드의 외관을 맞춤 설정할 수 있습니다. Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 크로스플랫폼 애플리케이션에 적합합니다. 깔끔한 API와 내장된 스타일 기능으로 외부 종속성 없이 QR 코드 생성을 간소화합니다. 브랜드화 또는 인터랙티브한 QR 코드가 필요한 앱에 이상적입니다.

사용 사례

  • 브랜드 QR 코드 생성
  • QR 코드에 로고 추가하기
  • 웹 및 모바일 앱에 QR 코드 삽입
  • 동적 QR 코드 생성
  • 다시보드에서 QR 코드 표시

주요 기능

  • 사용자 지정 가능한 색상 및 크기
  • 로고 오버레이 지원
  • 크로스 플랫폼 호환성
  • 간단한 API
  • 높은 구성 가능성을 가진 디자인
  • 내장 오류 보정

적합한 대상

  • 모바일 앱 개발자
  • 웹 애플리케이션 제작자
  • 디자인 중심 프로젝트
  • 전자상거래 및 마케팅 앱
  • 사용자 생성 QR 코드가 필요한 앱

고려 사항

  • 대용량 배치에 대한 성능 최적화가 필요할 수 있습니다
  • 제한된 고급 QR 데이터 인코딩 옵션
  • 로고 크기 조정은 가독성에 영향을 줄 수 있습니다
  • 고용량 QR 생성에 적합하지 않습니다
  • 플랫폼 고유의 렌더링 기능에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Pretty QR Code

Pub Likes on pub.dev Star on Github License: MIT

A highly customizable Flutter widget that makes it easy to render QR codes. Built on top of the qr package.

Features

  • Live Preview
  • Shapes - The widget provides functionality for rendering various built-in shapes, namely smooth, squares and dots, or you can even create your patterns using the package API.
  • Themes - Allows you easily switch between themes using the material theme extension.
  • Branding - Configure the display of the embedded image and adjust its style to best fit your needs.
  • Exporting - Save the QR сode as an image for sharing, embedding, or anything else.
  • Customization - Customize the appearance by setting the shape color or filling with a gradient.

If you want to say thank you, star us on GitHub or like us on pub.dev.

Usage

First, follow the package installation instructions and add a PrettyQrView widget to your app:

PrettyQrView.data(
  data: 'lorem ipsum dolor sit amet',
  decoration: const PrettyQrDecoration(
    image: PrettyQrDecorationImage(
      image: AssetImage('images/flutter.png'),
    ),
    quietZone: PrettyQrQuietZone.standart,
  ),
)

If you want to pass non-string data or want to specify a QR version, consider using the default PrettyQrView constructor:

@protected
late QrImage qrImage;

@override
void initState() {
  super.initState();

  final qrCode = QrCode(
    8,
    QrErrorCorrectLevel.H,
  )..addData('lorem ipsum dolor sit amet');

  qrImage = QrImage(qrCode);
}

@override
Widget build(BuildContext context) {
  return PrettyQrView(
    qrImage: qrImage,
    decoration: const PrettyQrDecoration(),
  );
}

Note: Do not create QrImage inside the build method; otherwise, you may have an undesired jank in the UI thread.

Combine several styles

To combine multiple styles in a single QR code, you can use PrettyQrCustomShape, as shown in the example below:

PrettyQrView.data(
  data: 'lorem ipsum dolor sit amet',
  decoration: const PrettyQrDecoration(
    shape: PrettyQrShape.custom(
      PrettyQrSquaresSymbol(),
      finderPattern: PrettyQrSmoothSymbol(),
      alignmentPatterns: PrettyQrDotsSymbol(),
    ),
  ),
)

Save the symbol as an image

You can save the QR code as an image using the toImage or toImageAsBytes extension methods that apply to QrImage. Optionally, the configuration parameter may be used to set additional saving options, such as pixel ratio or text direction.

final qrCode = QrCode.fromData(
  data: 'lorem ipsum dolor sit amet',
  errorCorrectLevel: QrErrorCorrectLevel.H,
);

final qrImage = QrImage(qrCode);
final qrImageBytes = await qrImage.toImageAsBytes(
  size: 512,
  format: ImageByteFormat.png,
  decoration: const PrettyQrDecoration(),
);

See the example folder for more code samples of the various possibilities.

Contributing

Contributions are welcomed!

Here is a curated list of how you can help:

  • Fix typos/grammar mistakes
  • Report parts of the documentation that are unclear
  • Report bugs and scenarios that are difficult to implement

Planned for future release(s)

  • Quiet Zone
  • Gradient filling
  • Export as image
  • Error handling API
  • Background color for QR code
  • Timing Patterns and Alignment Patterns
  • Support custom clippers for embedded images (#38)
  • Export as vector image (#42)

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트