Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create icons in flutter pdf?

I need a add icons in flutter pdf. This was completely different when compared with add icons in flutter. I am using https://pub.dev/packages/pdf this package.

Here is the code :

pw.Icon(pw.IconData(0xe047));

Error was :

ArgumentError (Invalid argument (string): Contains invalid characters.: "")
like image 894
Phanindra Avatar asked Oct 23 '25 02:10

Phanindra


1 Answers

To use Material Icons in Pdf package you just import material as mt and pdf as dynamic

import 'package:flutter/material.dart' as mt;
import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart';

Now take the Icon from the Material library and pass its codepoints to IconData Constructor in PDF Library now you can easily use the IconData instance in PDF Icon() class.

Icon(IconData(mt.Icons.check.codePoint),
                  color:
                  value PdfColors.grey,
                  size: 18,
                )
like image 194
Mehran Ullah Avatar answered Oct 25 '25 18:10

Mehran Ullah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!