zatca_fatoora_flutter 1.0.0 zatca_fatoora_flutter: ^1.0.0 copied to clipboard
A package to generate ZATCA simplified e-invoice (fatoora) compatible QR code for Flutter.
Zatca e-invoice (fatoora) QR code generator in Flutter #
This package strictly follows the guidelines provided by the Zatca authority to generate a simplified e-invoice (fatoora) QR code to print into the Bill/invoice of your business.
For more info kindly visit the official Zatca Docs.
Features #
- Simple QR code
- QR code with logo and custom styling
- Custom QR code builder, so you can show your magic 🪄
Usage #
For full example of the code, kindly have a look here /example folder.
Simple QR code: #
ZatcaFatoora.simpleQRCode(
fatooraData: ZatcaFatooraDataModel(
businessName: "Business name",
vatRegistrationNumber: "323456789123453",
date: DateTime.now(),
totalAmountIncludingVat: 50.75,
),
)
Styled QR Code: #
ZatcaFatoora.styledQRCode(
fatooraData: ZatcaFatooraDataModel(
businessName: "Business name",
vatRegistrationNumber: "323456789123453",
date: DateTime.now(),
totalAmountIncludingVat: 50.85,
),
// Provide your own style to the QR code data
qrStyleData: QRStyleData(
image: const AssetImage("assets/images/logo.jpeg"),
size: 200,
backgroundColor: Colors.green.withOpacity(.1),
qrColor: Colors.green,
isBorderShapeRounded: true,
),
)
Custom QR Code Builder: #
ZatcaFatoora.customQRCode(
fatooraData: ZatcaFatooraDataModel(
businessName: "Business name",
vatRegistrationNumber: "323456789123453",
date: DateTime.now(),
totalAmountIncludingVat: 50.75,
),
builder: (BuildContext context, String qrData, Widget qrCode) {
// debugPrint("QR Code data: $qrData");
return Container(
padding: const EdgeInsets.all(30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.grey.shade200,
border: Border.all(color: Colors.grey.shade300),
),
child: qrCode,
);
},
)