TextViewer.asset constructor

TextViewer.asset(
  1. String assetPath, {
  2. TextStyle textStyle = const TextStyle(),
  3. TextStyle? highLightTextStyle,
  4. TextStyle? focusTextStyle,
  5. Color highLightColor = Colors.yellow,
  6. Color focusColor = Colors.amber,
  7. bool ignoreCase = true,
  8. OnErrorCallback? onErrorCallback,
})

Implementation

factory TextViewer.asset(
  String assetPath, {
  TextStyle textStyle = const TextStyle(),
  TextStyle? highLightTextStyle,
  TextStyle? focusTextStyle,
  Color highLightColor = Colors.yellow,
  Color focusColor = Colors.amber,
  bool ignoreCase = true,
  OnErrorCallback? onErrorCallback,
}) {
  return TextViewer._(
      assetPath: assetPath,
      textStyle: textStyle,
      highLightTextStyle: highLightTextStyle ??
          textStyle.copyWith(background: Paint()..color = highLightColor),
      focusTextStyle: focusTextStyle ??
          textStyle.copyWith(background: Paint()..color = focusColor),
      highLightColor: highLightColor,
      focusColor: focusColor,
      ignoreCase: ignoreCase,
      onErrorCallback: onErrorCallback);
}