State class

Known as head in git The State object represents the current state of a Repository in memory

Available extensions

Constructors

State.new(Repository repository)

Properties

exists bool

Available on State, provided by the StateStorage extension

Returns status of state file i.e. exists or not
no setter
hashCode int
The hash code for this object.
no setterinherited
repository Repository
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateFile File

Available on State, provided by the StateStorage extension

Actual state File
no setter
stateFilePath String

Available on State, provided by the StateStorage extension

Path to stateFile
no setter
stateInfo StateData?

Available on State, provided by the StateStorage extension

Returns current StateData if exists
no setter

Methods

deleteStateFile({dynamic onDoesntExists()? = onStateDoesntExist, dynamic onSuccessfullyDeleted()? = onSuccessfullyStateDeleted}) → void

Available on State, provided by the StateStorage extension

Deletes the current stateFile
getCurrentBranch({dynamic onNoStateFile()? = onStateDoesntExist}) Branch?

Available on State, provided by the StateActions extension

Gets current Branch that StateData points to currently only if exists
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveStateData({required StateData stateData, dynamic onSuccessfullySaved()? = onSuccessfullyStateSaved}) StateData

Available on State, provided by the StateStorage extension

This function is idempotent Saves the stateData to stateFile
toString() String
A string representation of this object.
inherited

Operators

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