How can I show the flagging field edit form on a node? On a flagged node, instead of showing the flag/unflag link, I want to show the flag edit form.
Here's my setup.
Basic page content type can be flagged with the flag Bookmark.  Bookmark is a per-user flag that has an int list field Rating, which has values from 1 to 5.  On the flag admin page (/admin/structure/flags/manage/bookmark), Link type is set to Field Entry Form.
What happens now:

Go to a basic page that has been flagged.
Click the &quot;Unflag&quot; link for bookmark.
The Field Entry Form pops up and lets me edit the value of Rating or delete the flag.

What I want to happen:

Go to a basic page that has been flagged.
The Field Entry Form is embedded in the page and the user can adjust the rating as he/she likes.

I don't know how to build the form.  By digging through the flag module code, I managed to find the class that generates the form in FieldEntry.php:
/**
 * Class FieldEntry
 *
 * @ActionLinkType(
 *  id = &quot;field_entry&quot;,
 *  label = @Translation(&quot;Field Entry Form&quot;),
 *  description = &quot;Redirects the user to a field entry form.&quot;
 * )
 */
class FieldEntry extends FormEntryTypeBase {

But I don't know how to embed this in a node.
I looked at Inline Entity Form but that only supports Commerce modules and Entity Reference fields out of the box.
I also tried the Twig Tweak module and tried to embed an entity edit form using a view that returns the flagging ID like this:
{{ drupal_entity_form('flagging', id__value) }} 

However, this gives me an error:
Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template (&quot;The &quot;flagging&quot; entity type did not specify a &quot;&quot; form class.&quot;) in &quot;__string_template__87f4d3d6f14aa36d2fb8ce031f07b73d8b577189b4e5f3c535809f672ffb6af8&quot; at line 1. in Twig\Template-&gt;displayWithErrorHandling() (line 469 of /app/vendor/twig/twig/src/Template.php).

I can embed the entity itself with Twig Tweak just fine (but that is not the goal; the goal is to embed the entity edit form):
{{ drupal_entity('flagging', id__value) }}
Here's the code I ended up using:
/**
 * Implements hook_node_view() for MYMODULE.
 */
function MYMODULE_node_view(array &amp;$build, NodeInterface $node, EntityViewDisplayInterface $display, $view_mode) {
  if ($node-&gt;getType() == 'MY_CONTENT_YTPE') {
    if ($display-&gt;getComponent('my_flagging_form')) {
      $flag = \Drupal::service('flag')-&gt;getFlagById('MY_FLAG');
      $flagging_entity = \Drupal::service('flag')-&gt;getFlagging($flag, $node);
      $form = \Drupal::service('entity.manager')
        -&gt;getFormObject('flagging', 'edit')
        -&gt;setEntity($flagging_entity);
      $build['my_flagging_form'] = \Drupal::formBuilder()-&gt;getForm($form);
    }
  }
}

/**
 * Implements hook_entity_extra_field_info() for MYMODULE.
 *
 * Https://www.webomelette.com/creating-pseudo-fields-drupal-8
 */
function MYMODULE_entity_extra_field_info() {
  $extra = [];

  $extra['node'][NodeType::load('MY_CONTENT_TYPE')-&gt;Id()]['display']['my_flagging_form'] = [
    'label' =&gt; t('My flagging edit form'),
    'description' =&gt; t('This shows the my flagging edit form.'),
    'weight' =&gt; 100,
    'visible' =&gt; TRUE,
  ];

  return $extra;
}

For more details, see this question.