TextViewer.file constructor

TextViewer.file(
  1. String filePath, {
  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.file(
  String filePath, {
  TextStyle textStyle = const TextStyle(),
  TextStyle? highLightTextStyle,
  TextStyle? focusTextStyle,
  Color highLightColor = Colors.yellow,
  Color focusColor = Colors.amber,
  bool ignoreCase = true,
  OnErrorCallback? onErrorCallback,
}) {
  return TextViewer._(
    filePath: filePath,
    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,
  );
}