mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(remote): add ability to pass callbacks as arguments
This commit is contained in:
parent
b15b56f0ae
commit
299d1a17e7
8 changed files with 374 additions and 68 deletions
25
lib/src/callbacks.dart
Normal file
25
lib/src/callbacks.dart
Normal file
|
@ -0,0 +1,25 @@
|
|||
import 'oid.dart';
|
||||
import 'remote.dart';
|
||||
|
||||
class Callbacks {
|
||||
const Callbacks({
|
||||
this.transferProgress,
|
||||
this.sidebandProgress,
|
||||
this.updateTips,
|
||||
this.pushUpdateReference,
|
||||
});
|
||||
|
||||
/// Callback function that reports transfer progress.
|
||||
final void Function(TransferProgress)? transferProgress;
|
||||
|
||||
/// Callback function that reports textual progress from the remote.
|
||||
final void Function(String)? sidebandProgress;
|
||||
|
||||
/// Callback function matching the `void Function(String refname, Oid old, Oid new)`
|
||||
/// that report reference updates.
|
||||
final void Function(String, Oid, Oid)? updateTips;
|
||||
|
||||
/// Callback function matching the `void Function(String refname, String message)`
|
||||
/// used to inform of the update status from the remote.
|
||||
final void Function(String, String)? pushUpdateReference;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue