From 5ca1a5fc8d8085e3f409be2675356a863024bd7f Mon Sep 17 00:00:00 2001 From: alexanderkind Date: Wed, 31 May 2023 20:55:07 +0700 Subject: [PATCH] Change README.md --- README.md | 57 +++++++++++++++++++++++++++++++++++- example/android/build.gradle | 2 +- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49869e1..11bf6bd 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ dependencies: dependencies: qr_flutter: git: - url: https://github.com/theyakka/qr.flutter.git + url: https://github.com/alexanderkind/qr.flutter ``` Keep in mind the `master` branch could be unstable. @@ -80,6 +80,12 @@ Depending on your data requirements you may want to tweak the QR code output. Th | `embeddedImageStyle` | QrEmbeddedImageStyle | Properties to style the embedded image. | | `embeddedImageEmitsError` | bool | If true, any failure to load the embedded image will trigger the `errorStateBuilder` or render an empty `Container`. If false, the QR code will be rendered and the embedded image will be ignored. | | `semanticsLabel` | String | `semanticsLabel` will be used by screen readers to describe the content of the QR code. | +| `borderRadius` | double | Setting corner rounding for shape types `QrEyeShape.square`, `QrDataModuleShape.square`, `EmbeddedImageShape.square`. Set in appropriate styles. | +| `roundedOutsideCorners` | bool | If true, the outer corners of the data are rounded. Set to `QrDataModuleStyle`. Rounded to `borderRadius` by default. Only `QrDataModuleShape.square`. | +| `outsideBorderRadius` | double | It is set if the outer rounding `outsideBorderRadius` should differ from the inner one `borderRadius`. No more than `borderRadius`. Only `QrDataModuleShape.square` | +| `gradient` | Gradient | Changing the solid color of the code to a gradient, e.g. `LinearGradient`. | +| `safeArea` | bool | If true, data is hidden behind the `embeddedImage`. Set to `QrEmbeddedImageStyle`. | +| `safeAreaMultiplier` | double | Multiplier `safeArea` size. | # Examples @@ -135,6 +141,55 @@ QrImageView( ) ``` +A QR code with inside and outside corners rounding and safe area of embedded image: + +```dart +QrImageView( + data: 'London is the capital of Great Britain', + version: QrVersions.auto, + size: 320, + eyeStyle: const QrEyeStyle( + borderRadius: 10, + ), + dataModuleStyle: const QrDataModuleStyle( + borderRadius: 5, + roundedOutsideCorners: true, + ), + embeddedImage: AssetImage('assets/images/my_embedded_image.png'), + embeddedImageStyle: QrEmbeddedImageStyle( + size: Size.square(40), + color: Colors.white, + safeArea: true, + safeAreaMultiplier: 1.1, + embeddedImageShape: EmbeddedImageShape.square, + borderRadius: 10, + ), +) +``` + +A QR code with gradient: + +```dart +QrImageView( + data: 'Rainbow after the rain', + version: QrVersions.auto, + size: 320, + gradient: LinearGradient( + begin: Alignment.bottomLeft, + end: Alignment.topRight, + colors: [ + Color(0xffff0000), + Color(0xffffa500), + Color(0xffffff00), + Color(0xff008000), + Color(0xff0000ff), + Color(0xff4b0082), + Color(0xffee82ee), + ], + ), +) +``` + # Outro ## Credits Thanks to Kevin Moore for his awesome [QR - Dart](https://github.com/kevmoo/qr.dart) library. It's the core of this library. diff --git a/example/android/build.gradle b/example/android/build.gradle index 29a8f72..0575ae6 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -29,6 +29,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir }