Skip to content

FLUT-6473 - [Others] Highlighting certain lines in code blocks has been added. #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Flutter/pdf-viewer/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ documentation: ug
The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) can be accessed by the screen readers by wrapping the [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget to the [`Semantics`](https://api.flutter.dev/flutter/widgets/Semantics-class.html) widget.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="4" %}

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions Flutter/pdf-viewer/bookmark-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The built-in bookmark view in the `SfPdfViewer` can be opened using the [openBoo
The following code example explains the opening of built-in bookmark view programmatically.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="1 15" %}

final GlobalKey<SfPdfViewerState> _pdfViewerKey = GlobalKey();

Expand Down Expand Up @@ -56,7 +56,7 @@ Widget build(BuildContext context) {
You can navigate to the desired bookmark topic programmatically using the [jumpToBookmark](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToBookmark.html) controller method. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="24 31 32 33 34" %}

late PdfViewerController _pdfViewerController;
late PdfBookmark _pdfBookmark;
Expand Down
2 changes: 1 addition & 1 deletion Flutter/pdf-viewer/document-link-annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ By default, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_p
You can enable or disable the navigation of document link annotation using the [enableDocumentLinkAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDocumentLinkAnnotation.html) property. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand Down
22 changes: 11 additions & 11 deletions Flutter/pdf-viewer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Once the package has been imported, initialize the `SfPdfViewer` as a child of a
The [SfPdfViewer.asset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.asset.html) creates a widget that displays the PDF document obtained from an [`AssetBundle`](https://api.flutter.dev/flutter/services/AssetBundle-class.html). The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="4 5" %}

@override
Widget build(BuildContext context) {
Expand All @@ -93,7 +93,7 @@ Widget build(BuildContext context) {
The [SfPdfViewer.network](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.network.html) creates a widget that displays the PDF document obtained from a URL. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="4 5" %}

@override
Widget build(BuildContext context) {
Expand All @@ -118,7 +118,7 @@ tag to enable the network access in your application:
The [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) creates a widget that displays the PDF document obtained from a [`File`](https://api.flutter.dev/flutter/dart-io/File-class.html). The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="4 5" %}

@override
Widget build(BuildContext context) {
Expand All @@ -137,7 +137,7 @@ N> On Android, this may require the `android.permission.READ_EXTERNAL_STORAGE`.
The [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) creates a widget that displays the PDF document obtained from the [`Uint8List`](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html). The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="4 5" %}

@override
Widget build(BuildContext context) {
Expand All @@ -154,7 +154,7 @@ Widget build(BuildContext context) {
The `SfPdfViewer` allows you to load the document with the specified scroll offset position or zoom level using the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html) and [initialZoomLevel](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialZoomLevel.html) properties. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7" %}

@override
Widget build(BuildContext context) {
Expand All @@ -173,7 +173,7 @@ Widget build(BuildContext context) {
The `SfPdfViewer` allows you to get the current scroll offset position using the [scrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/scrollOffset.html) property. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="16 17" %}

final PdfViewerController _pdfViewerController=PdfViewerController();

Expand Down Expand Up @@ -211,7 +211,7 @@ Widget build(BuildContext context) {
By default, the `SfPdfViewer` displays the spacing between the PDF pages with the value of **4 pixels**. You can customize the space being displayed using the [pageSpacing](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/pageSpacing.html) property. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -229,7 +229,7 @@ Widget build(BuildContext context) {
By default, the `SfPdfViewer` displays the scroll head and scroll status. You can customize the visibility of these items using the [canShowScrollHead](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowScrollHead.html) and [canShowScrollStatus](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowScrollStatus.html) properties. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7" %}

@override
Widget build(BuildContext context) {
Expand All @@ -250,7 +250,7 @@ N> On a desktop or mobile web browser, this `canShowScrollHead` property will ha
By default, the page navigation dialog will be displayed when the scroll head is tapped. You can customize the visibility of the page navigation dialog using the [canShowPaginationDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowPaginationDialog.html) property. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -274,7 +274,7 @@ The `SfPdfViewer` loading supports the [PdfDocumentLoadedCallback](https://pub.d
The [onDocumentLoaded](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onDocumentLoaded.html) callback triggers after the `document` are loaded in the `SfPdfViewer`. The document in the [PdfDocumentLoadedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfDocumentLoadedDetails-class.html) will return the loaded [PdfDocument](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) instance. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7 8" %}

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -302,7 +302,7 @@ The [onDocumentLoadFailed](https://pub.dev/documentation/syncfusion_flutter_pdfv
The [PdfDocumentLoadFailedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfDocumentLoadFailedDetails-class.html) will return the `error` title and `description` message for the failure reason. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7 8 9 10 11 12 13 14 15 16 17 18 19" %}

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions Flutter/pdf-viewer/interaction-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ N> On a touch device, setting the [interactionMode](https://pub.dev/documentatio
By default, the `selection` interaction mode will be enabled on a desktop web browser and allows users to select and copy text from the PDF files. This also helps to copy and share the text content. Refer to the following code to enable the `selection` mode in `SfPdfViewer`.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -39,7 +39,7 @@ Widget build(BuildContext context) {
In `pan` mode, the dragging and scrolling of the pages can be performed in any direction using the mouse and touch interactions on a desktop web browser, but the text selection cannot be performed. Refer to the following code to enable the `pan` mode in `SfPdfViewer`.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion Flutter/pdf-viewer/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ syncfusion_localizations: ^XX.X.XX
Next, import the `flutter_localizations` and `syncfusion_localizations` library and specify the `localizationsDelegates` and `supportedLocales` for `MaterialApp` to localize the contents in the `SfPdfViewer` (page navigation dialog and bookmark view).

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="1 2 7 8 9 10 11 12 13 14 15 16 17" %}

import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:syncfusion_localizations/syncfusion_localizations.dart';
Expand Down
6 changes: 3 additions & 3 deletions Flutter/pdf-viewer/magnification.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The content of a document can be zoomed in and out either by pinch to zoom or ch
You can change or control the zoom level factor programmatically using the [zoomLevel](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/zoomLevel.html) property. The zoom level factor value can be set between 1.0 and 3.0. The default value is 1.0. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="21" %}

late PdfViewerController _pdfViewerController;

Expand Down Expand Up @@ -60,7 +60,7 @@ N> The maximum allowed zoom level is 3.0 and if any value is set beyond that, th
By default, the `SfPdfViewer` will be zoomed in and out when double-tapped. You can enable or disable the double-tap zoom using the [enableDoubleTapZooming](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDoubleTapZooming.html) property. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -90,7 +90,7 @@ The [onZoomLevelChanged](https://pub.dev/documentation/syncfusion_flutter_pdfvie
The [PdfZoomDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfZoomDetails-class.html) will return the `oldZoomLevel` title and `newZoomLevel` values. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7 8" %}

@override
Widget build(BuildContext context) {
Expand Down
8 changes: 4 additions & 4 deletions Flutter/pdf-viewer/page-layout-and-scroll-direction.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ N> For now, only `Horizontal` scrolling is supported in `Single page layout mode
By default, the `continuous` page layout mode is enabled, which scrolls the PDF pages vertically and horizontally. To enable the `continuous` page layout mode in `SfPdfViewer`, use the following code sample.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -43,7 +43,7 @@ Widget build(BuildContext context) {
In `Single` page layout mode, PDFs will be displayed page by page horizontally. To enable the `Single` page layout mode in `SfPdfViewer`, use the following code sample.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -70,7 +70,7 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat
By default, `Vertical` scrolling is enabled, which moves the PDF pages from up to down. To enable the `Vertical` scrolling in `SfPdfViewer`, use the following code sample.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand All @@ -88,7 +88,7 @@ Widget build(BuildContext context) {
In `Horizontal` scrolling, PDF pages can be scrolled from left to right. To enable the `Horizontal` scrolling in `SfPdfViewer`, use the following code sample.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6" %}

@override
Widget build(BuildContext context) {
Expand Down
10 changes: 5 additions & 5 deletions Flutter/pdf-viewer/page-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Navigate to the desired pages instantly either by using the page navigation dial
The [jumpToPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToPage.html) controller method helps you to navigate to the specified page number in a PDF document. The following code example explains the same

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="21" %}

late PdfViewerController _pdfViewerController;

Expand Down Expand Up @@ -60,7 +60,7 @@ Widget build(BuildContext context) {
The [nextPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/nextPage.html) and [previousPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/previousPage.html) controller methods help you to navigate to the next and previous page of a PDF document. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="21 30" %}

late PdfViewerController _pdfViewerController;

Expand Down Expand Up @@ -111,7 +111,7 @@ Widget build(BuildContext context) {
The [firstPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/firstPage.html) and [lastPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/lastPage.html) controller methods help you to navigate to the first and last page of a PDF document. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="21 30" %}

late PdfViewerController _pdfViewerController;

Expand Down Expand Up @@ -164,7 +164,7 @@ The [jumpTo](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/p
N> Both the `xOffset` and `yOffset` are optional parameters and if the offset values are not provided, then the `SfPdfViewer` will be scrolled or moved to the default position (0, 0).

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="21" %}

late PdfViewerController _pdfViewerController;

Expand Down Expand Up @@ -217,7 +217,7 @@ The [onPageChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/l
The [PdfPageChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfPageChangedDetails-class.html) will return the `oldPageNumber`, `newPageNumber`, `isFirstPage` and `isLastPage` values. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="6 7 8 9" %}

@override
Widget build(BuildContext context) {
Expand Down
12 changes: 6 additions & 6 deletions Flutter/pdf-viewer/text-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To differentiate the highlighted texts, the current text instance highlight colo
N> Import **'package:syncfusion_flutter_pdf/pdf.dart'** in the Dart code if you use the [TextSearchOption](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/TextSearchOption.html) parameter.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="23 24 25 26" %}

late PdfViewerController _pdfViewerController;
late PdfTextSearchResult _searchResult;
Expand Down Expand Up @@ -65,7 +65,7 @@ void initState() {
The [nextInstance](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/nextInstance.html) and [previousInstance](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/previousInstance.html) methods in the [PdfSearchTextResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) class help you to navigate to the next and previous search text instance in the PDF document. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="36 48" %}


late PdfViewerController _pdfViewerController;
Expand Down Expand Up @@ -134,7 +134,7 @@ Widget build(BuildContext context) {
The [clear](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/clear.html) method in the [PdfSearchTextResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) class is used to cancel the text search operation. When the text search is in progress, this method can be used to cancel the same and clear all the highlighted texts in the `SfPdfViewer`. The following code example explains the same

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="37" %}

late PdfViewerController _pdfViewerController;
late PdfTextSearchResult _searchResult;
Expand Down Expand Up @@ -194,7 +194,7 @@ The colors in which the current instance and other instances are highlighted can
The following code example explains how to customize the search text highlight color.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="32 33" %}

late PdfViewerController _pdfViewerController;
late PdfTextSearchResult _searchResult;
Expand Down Expand Up @@ -240,7 +240,7 @@ Widget build(BuildContext context) {
The [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) property in the [PdfSearchTextResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object can be used to identify if no instance of the searched text is found in the PDF document. That is, if the [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) returns value 0, then there is no matching instance found for the searched text. The following code explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="25 26 27" %}

late PdfViewerController _pdfViewerController;
late PdfTextSearchResult _searchResult;
Expand Down Expand Up @@ -286,7 +286,7 @@ Widget build(BuildContext context) {
The [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) and [currentInstanceIndex](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/currentInstanceIndex.html) properties in the [PdfSearchTextResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object can be used to identify if a complete cycle of text search is completed in the PDF document. That is, when the [nextInstance](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/nextInstance.html) method is called, you can check if the `currentInstanceIndex` equals the `totalInstanceCount`, then it can be considered that a complete cycle of text search is completed. The following code example explains the same.

{% tabs %}
{% highlight Dart %}
{% highlight dart hl_lines="63 64 65" %}

late PdfViewerController _pdfViewerController;
late PdfTextSearchResult _searchResult;
Expand Down
Loading