A flutter plugin can be used to generate QRCode.
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
- Dependency
In your pubspec.yaml
, add the following config:
dependencies:
ef_qrcode: 0.3.2
- Generate
The method statement is as follows:
static Future<File> generate(String content, String backgroundColor, String foregroundColor)
You can call this method liek this:
void generateImage() async {
try {
var imageFile = await EfQrcode.generate("content", "#ffffff", "#000000");
setState(() {
_imageFile = imageFile;
});
}
catch (e) {
print(e);
}
}
For more information, you can see the example project.
EyreFree, eyrefree@eyrefree.org