Skip to content

NyForm #214

Answered by B3K4682
shriharip asked this question in Ideas
Jan 29, 2025 · 1 comment
Discussion options

You must be logged in to vote

You can extend the form field and set enabled: false. Here's an example:

class ProfileForm extends NyFormData {
  ProfileForm({String? name}) : super(name ?? "profile");

  @override
  fields() => [
    Field.text(
      "name",
      style: "outlined".extend(
        enabled: false,
      ),
    ),
  ];
}

Or if you want to make text selectable, but not editable, you can replace enabled: false with readOnly: true

Hope this helps!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shriharip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants