widgets library
A drop-in replacement for package:pdf/widgets.dart that renders Bangla
correctly.
Change one import and nothing else:
- import 'package:pdf/widgets.dart' as pw;
+ import 'package:bangla_pdf/widgets.dart' as pw;
Every symbol package:pdf exports is re-exported here unchanged, except
the widgets that render text. Those are replaced by versions that take
exactly the same parameters and shape Bangla with the font's own OpenType
tables:
Text, RichText, TextSpan, Header, Paragraph, Bullet, TableHelper, Watermark, TableOfContent, ChartLegend, FixedAxis, TextField and ChoiceField.
A string with no Bengali in it is handed straight to package:pdf, so a
document with no Bangla renders exactly as it would without this package.
Configure the typeface and shaping mode through BanglaPdf in
package:bangla_pdf/bangla_pdf.dart; nothing here needs initialising.
Classes
- Align
- A widget that aligns its child within itself and optionally sizes itself based on the child's size.
- Alignment
- AlignmentDirectional
- An offset that's expressed as a fraction of a Size, but whose horizontal component is dependent on the writing direction.
- AlignmentGeometry
- Base class for Alignment that allows for text-direction aware resolution.
- Anchor
- Annotation
- AnnotationBuilder
- AnnotationCircle
- AnnotationInk
- AnnotationLink
- AnnotationPolygon
- AnnotationSquare
- AnnotationTextField
- AnnotationUrl
- AspectRatio
- Barcode
- Barcode generation class
- BarcodeBar
- Rectangle drawing operation
- BarcodeEan
- Base class to generate EAN Barcodes
- BarcodeElement
- Barcode drawing operation
- BarcodeText
- Text drawing operation
- BarcodeWidget
- Draw a barcode using String data
-
BarDataSet<
T extends PointChartValue> - Border
- A border of a box, comprised of four sides: top, right, bottom, left.
- BorderRadius
- An immutable set of radii for each corner of a rectangle.
- BorderRadiusDirectional
- An immutable set of radii for each corner of a rectangle, but with the corners specified in a manner dependent on the writing direction.
- BorderRadiusGeometry
- Base class for BorderRadius that allows for text-direction aware resolution.
- BorderSide
- A side of a border of a box.
- BorderStyle
- BoxBorder
- BoxConstraints
- BoxDecoration
- BoxShadow
- Builder
- A platonic widget that calls a closure to obtain its child widget.
- Bullet
- One bulleted item, with Bangla shaped correctly.
- CartesianGrid
- Center
- Chart
- This widget is in preview and the API is subject to change
- ChartGrid
- ChartLegend
- A chart legend, with Bangla shaped correctly.
- ChartValue
- Checkbox
- ChoiceField
- An interactive drop-down field whose value has Bangla shaped correctly.
- Circle
- CircleAnnotation
- CircularProgressIndicator
- ClipOval
- ClipRect
- ClipRRect
- Column
- ColumnLayout
- ConstrainedBox
- A widget that imposes additional constraints on its child.
- Container
- Context
- CustomPaint
- DataMatrixEncoder
- Encode DataMatrix messages
- Dataset
- DecoratedBox
- DecorationGraphic
- DecorationImage
- DecorationSvgImage
- DefaultTextStyle
- DelayedWidget
- Directionality
- Divider
- Document
- EdgeInsets
- EdgeInsetsDirectional
- An immutable set of offsets in each of the four cardinal directions, but whose horizontal components are dependent on the writing direction.
- EdgeInsetsGeometry
- Expanded
- FittedBox
- Scales and positions its child within itself according to fit.
- FittedSizes
- The pair of sizes returned by applyBoxFit.
-
FixedAxis<
T extends num> - A chart axis with fixed values, whose labels have Bangla shaped correctly.
- FixedColumnWidth
- FlatButton
- Flex
- FlexColumnWidth
- FlexContext
- Flexible
- A widget that controls how a child of a Row, Column, or Flex flexes.
- FlutterLogo
- Font
- Lazy font declaration, registers the font in the document only if needed. Tries to register a font only once
- FractionalOffset
-
An offset that's expressed as a fraction of a
PdfPoint. - FractionColumnWidth
- FullPage
- Gradient
- A 2D gradient.
- GridAxis
- GridPaper
- A widget that draws a rectilinear grid of lines. The grid is drawn over the child widget.
- GridView
- GridViewContext
- Header
- A section heading, with Bangla shaped correctly.
- Icon
- A graphical icon widget drawn with a glyph from a font described in an IconData such as material's predefined IconDatas in Icons.
- IconData
- A description of an icon fulfilled by a font glyph.
- IconThemeData
- Defines the color, opacity, and size of icons.
- Image
- ImageImage
- ImageProvider
- Identifies an image without committing to the precise final asset
- ImageProxy
- Inherited
- InheritedDirectionality
- InheritedWidget
- InkAnnotation
- InkList
- InlineSpan
- Inseparable
- IntrinsicColumnWidth
- LayoutBuilder
- Builds a widget tree that can depend on the parent widget's size.
- LimitedBox
- LinearGradient
- A 2D linear gradient.
- LinearProgressIndicator
- A material design linear progress indicator, also known as a progress bar.
- LineChartValue
-
LineDataSet<
T extends PointChartValue> - Link
- ListView
- Lorem
- LoremText
- MeCard
- MeCard is a data file similar to vCard but used by NTT DoCoMo in Japan in QR code format for use with Cellular Phones. https://github.com/zxing/zxing/wiki/Barcode-Contents
- MemoryImage
- MeTuple
- Tuple key/value for MeCard elements
- MultiChildWidget
- MultiPage
- Create a multi-page section, with automatic overflow from one page to another
- NewPage
- Trigger a page break if there is not enough free space. If freeSpace is null, a page break is always performed.
- Opacity
- Outline
- OverflowBox
- Padding
- Page
- PageTheme
- Paragraph
- A block of body text, with Bangla shaped correctly.
- Partition
- Partitions
- PartitionsContext
- PdfLogo
- PieDataSet
- PieGrid
- Placeholder
- PointChartValue
-
PointDataSet<
T extends PointChartValue> - Polygon
- PolygonAnnotation
- PolyLineAnnotation
- Positioned
- A widget that controls where a child of a Stack is positioned.
- PositionedDirectional
- A widget that controls where a child of a Stack is positioned without committing to a specific TextDirection.
- RadialGradient
- A 2D radial gradient.
- RadialGrid
- Radius
- A radius for either circular or elliptical shapes.
- RawImage
- Rectangle
- RichText
- Rich text with per-span styling, with Bangla shaped correctly.
- RichTextContext
- Row
- Shape
- Signature
- SingleChildWidget
- SizedBox
- A box with a specified size.
- Spacer
- Spacer creates an adjustable, empty spacer that can be used to tune the spacing between widgets in a Flex container, like Row or Column.
- SquareAnnotation
- Stack
- A widget that positions its children relative to the edges of its box.
- StatelessWidget
- SvgImage
- Table
- A widget that uses the table layout algorithm for its children.
- TableBorder
- TableColumnWidth
- TableContext
- TableOfContent
- A table of contents built from the document outline, with Bangla shaped correctly.
- TableRow
- A horizontal group of cells in a Table.
- Text
- A run of text, with Bangla shaped correctly.
- TextDecoration
- A linear decoration to draw near the text.
- TextField
- An interactive text field whose value has Bangla shaped correctly.
- TextSpan
- A span of styled text, with Bangla shaped correctly.
- TextStyle
- Theme
- ThemeData
- Transform
- TtfFont
- UrlLink
- VerticalDivider
- Watermark
- A page watermark, with Bangla shaped correctly.
- Widget
- WidgetContext
- WidgetSpan
- Wrap
- A widget that displays its children in multiple horizontal or vertical runs.
- WrapContext
Enums
- Axis
- BarcodeCodabarStartStop
- Start and Stop symbols for BCodabar
- BarcodeQRCorrectionLevel
- QR Code Correction Level
- BarcodeTextAlign
- Text alignement inside the BarcodeText zone
- BarcodeType
- Supported barcode types
- BoxFit
- BoxShape
- CrossAxisAlignment
- DecorationPosition
- FlexFit
- FontStyle
- FontWeight
- MainAxisAlignment
- MainAxisSize
- Overflow
- Whether overflowing children should be clipped, or their overflow be visible.
- PageOrientation
- PaintPhase
- Pdf417SecurityLevel
- Error correction levels
- PieLegendPosition
- StackFit
- How to size the non-positioned children of a Stack.
- TableCellVerticalAlignment
- TableWidth
- TextAlign
- TextDecorationStyle
- TextDirection
- TextOverflow
- How overflowing text should be handled.
- TileMode
- Defines what happens at the edge of the gradient.
- Type1Fonts
- ValuePosition
- VerticalDirection
- WrapAlignment
- How Wrap should align objects.
- WrapCrossAlignment
- Who Wrap should align children within a run in the cross axis.
Mixins
- AnnotationAppearance
- SpanningWidget
- TableHelper
- Builds a pw.Table from raw data, with Bangla shaped correctly.
Functions
-
applyBoxFit(
BoxFit fit, PdfPoint inputSize, PdfPoint outputSize) → FittedSizes -
transformPoint(
Matrix4 transform, PdfPoint point) → PdfPoint -
transformRect(
Matrix4 transform, PdfRect rect) → PdfRect
Typedefs
- BuildCallback = Widget Function(Context context)
-
BuildListCallback
= List<
Widget> Function(Context context) - CustomPainter = dynamic Function(PdfGraphics canvas, PdfPoint size)
- DefaultThemeDataBuilder = ThemeData Function()
- GridAxisBuildLabel = Widget Function(num value)
- GridAxisFormat = String Function(num value)
-
Hyphenation
= List<
String> Function(String word) - IndexedWidgetBuilder = Widget Function(Context context, int index)
- LayoutWidgetBuilder = Widget Function(Context context, BoxConstraints? constraints)
- The signature of the LayoutBuilder builder function.
-
LineSplitter
= List<
String> Function(String word) - Signature of a function that splits a line of text into words that may be wrapped independently.
- OnCell = Widget? Function(int index, dynamic data, int rowNum)
- OnCellDecoration = BoxDecoration Function(int index, dynamic data, int rowNum)
- OnCellFormat = String Function(int index, dynamic data)
- OnCellTextStyle = TextStyle? Function(int index, dynamic data, int rowNum)
- SvgCustomFontLookup = Font? Function(String fontFamily, String fontStyle, String fontWeight)
- VisitorCallback = bool Function(InlineSpan span, TextStyle? parentStyle, AnnotationBuilder? annotation)
- WidgetBuilder = Widget Function(Context context)
Exceptions / Errors
- BarcodeException
- Exception raised if the library cannot generate the Barcode