MessageSheet class

The commit messages, merge messages and version increments of several repositories as one file the user edits in their editor — instead of one prompt per question and repository.

The file is JSON with comments (.jsonc), one block per repository. Every message is a list of lines, so a message of several lines needs no \n:

{
  "gg_one_core": {
    // 2.14.0 → patch 2.14.1 · minor 2.15.0 · major 3.0.0
    "versionIncrement": "minor",
    "mergeMessage": ["Edit the messages in VS Code"],
    "commitMessage": ["Add MessageSheet", "Render and parse the sheet"]
  }
}

The sheet is only a view: callers read the defaults from the repositories' publish_config.json, and write the edited values back.

Constructors

MessageSheet({required List<MessageSheetEntry> entries})
Constructor

Properties

entries → List<MessageSheetEntry>
One entry per repository, in the order they are shown.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

edit({required String title, required String fileName, EditText editText = defaultEditText}) → Future<List<MessageSheetEntry>?>
Lets the user edit the sheet and returns the edited entries — or null when no editor can be opened, so the caller asks one by one instead.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String text) → List<MessageSheetEntry>
Reads the edited text back. A field that was emptied or left out keeps its default. Throws a FormatException naming the problem — and for broken JSON, where it is — when the text is no valid sheet.
render({required String title}) → String
The sheet as the user sees it, headed by title.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

errorPrefix → const String
The lines a first comment line starts with when the last edit could not be read. They are replaced on every attempt.