Allow overriding onSubmit event in dialogs.

Fixes #2327 , #2326 

@dinhviethoa PTAL thanks.
You're trying to intercept the click event right before `_commit()` gets called and block it. You don't need to introduce a new function which will *always* be calling some other function. So a couple of suggestions:
* Just change `_commit()` -> `_commit(Event e)` and block the event in those `_commits` you need.
* If you wish it to be explicit, introduce `_preCommit(Event e)` and change this call to:
```dart
submitBtn.onClick.listen((Event e) {
         _preCommit(e);
         _commit(); 
});
```
* If you end up adding new function after all, it doesn't need to be public. So, as a last resort, `_onSubmit`.
* You now have 5 classes with identical new piece of code. Not very maintainable ;) Introduce `class GitAction` and move the shared code there, whether it's `_onSubmit`, `_preCommit`, or just the basic common part of `_commit`.