---
title: "Define annotation behavior in a document with flags in Flutter | Nutrient"
canonical_url: "https://www.nutrient.io/guides/flutter/annotations/create-edit-and-remove/annotation-flags/"
md_url: "https://www.nutrient.io/guides/flutter/annotations/create-edit-and-remove/annotation-flags.md"
last_updated: "2026-07-08T00:00:00.000Z"
description: "Use annotation flags to define annotation behavior and capabilities in a Flutter document."
---

# Define annotation behavior with flags in Flutter

Every [`Annotation`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter.bindings/Annotation-class.html) in a document can specify [`AnnotationFlag`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter.bindings/AnnotationFlag.html) values that define its behavior and capabilities. Access these flags directly on annotation objects with `Annotation.flags`.

## Capabilities of flags

Annotation flags are part of the PDF specification. They define an annotation’s behavior, its appearance onscreen and on paper, and the editing actions available to your users. You can use flags to control these behaviors:

- Mark an annotation as `hidden` so it won’t be displayed or printed.

- Set `print` to include the annotation in print output while keeping it hidden onscreen.

- Set the `locked` and `lockedContents` flags to prevent users from editing an annotation.

For a complete list of available flags, refer to the [`AnnotationFlag`](https://pub.dev/documentation/nutrient_flutter/latest/nutrient_flutter.bindings/AnnotationFlag.html) API reference.

## Example

The following example creates a locked annotation that users can’t edit:

```dart

import 'package:nutrient_flutter/bindings.dart';

void createReadOnlyAnnotation() {
  // Create a new text annotation.
  final annotation = FreeTextAnnotation(
	 pageIndex: 0,
    bbox: [50.0, 650.0, 200.0, 50.0],
	 text: TextContent(
      format: TextFormat.plain,
      value: 'This is a free text annotation',
    ),
	 // Set the `readOnly` flag to prevent editing.
	 flags: [AnnotationFlag.readOnly, AnnotationFlag.print],... // Other annotation properties.
  );
  // Add the annotation to the document.
  controller.document.annotations.addAnnotation(annotation);
}

```
---

## Related pages

- [Set the annotation author in Flutter](/guides/flutter/annotations/create-edit-and-remove/author-name.md)
- [Disable annotation editing in Flutter](/guides/flutter/annotations/create-edit-and-remove/disable-editing.md)
- [Programmatically manage PDF annotations in Flutter](/guides/flutter/annotations/create-edit-and-remove/programmatic.md)
- [Update PDF annotation properties in Flutter](/guides/flutter/annotations/create-edit-and-remove/update-properties.md)

